mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Fix ESP8266 energy cal range chk
This commit is contained in:
parent
ab2d6c1169
commit
ba7161fb00
@ -988,9 +988,7 @@ void EnergyCommandSetCal(uint32_t cal_type) {
|
|||||||
float Igoal = Pgoal / Ugoal; // 0.26087 A
|
float Igoal = Pgoal / Ugoal; // 0.26087 A
|
||||||
float R = Ugoal / Igoal; // 881,666 Ohm
|
float R = Ugoal / Igoal; // 881,666 Ohm
|
||||||
|
|
||||||
uint32_t channel = XdrvMailbox.index;
|
uint32_t channel = ((1 == XdrvMailbox.index -1) && (2 == Energy->phase_count)) ? 1 : 0;
|
||||||
if (channel > Energy->phase_count) { channel = 1; }
|
|
||||||
channel--;
|
|
||||||
float Umeas = Energy->voltage[channel]; // 232.0
|
float Umeas = Energy->voltage[channel]; // 232.0
|
||||||
// Calculate current and power based on measured voltage
|
// Calculate current and power based on measured voltage
|
||||||
float Ical = Umeas / R; // 0.26306 A
|
float Ical = Umeas / R; // 0.26306 A
|
||||||
|
Loading…
x
Reference in New Issue
Block a user