mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Fix swapped voltage/power in energy dummy
This commit is contained in:
parent
404589c860
commit
10af47f8f4
@ -61,10 +61,10 @@ void NrgDummyEverySecond(void) {
|
|||||||
float current_calibration = (float)EnergyGetCalibration(channel, ENERGY_CURRENT_CALIBRATION) / 100000;
|
float current_calibration = (float)EnergyGetCalibration(channel, ENERGY_CURRENT_CALIBRATION) / 100000;
|
||||||
float frequency_calibration = (float)EnergyGetCalibration(channel, ENERGY_FREQUENCY_CALIBRATION) / 100;
|
float frequency_calibration = (float)EnergyGetCalibration(channel, ENERGY_FREQUENCY_CALIBRATION) / 100;
|
||||||
|
|
||||||
Energy.voltage[channel] = power_calibration; // V
|
Energy.voltage[channel] = voltage_calibration; // V
|
||||||
Energy.frequency[channel] = frequency_calibration; // Hz
|
Energy.frequency[channel] = frequency_calibration; // Hz
|
||||||
if (bitRead(TasmotaGlobal.power, channel)) { // Emulate power read only if device is powered on
|
if (bitRead(TasmotaGlobal.power, channel)) { // Emulate power read only if device is powered on
|
||||||
Energy.active_power[channel] = (NrgDummy.power[channel]) ? ((float)NrgDummy.power[channel] / 1000) : voltage_calibration; // W
|
Energy.active_power[channel] = (NrgDummy.power[channel]) ? ((float)NrgDummy.power[channel] / 1000) : power_calibration; // W
|
||||||
if (0 == Energy.active_power[channel]) {
|
if (0 == Energy.active_power[channel]) {
|
||||||
Energy.current[channel] = 0;
|
Energy.current[channel] = 0;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user