Skip to content

Commit

Permalink
Increase upper limits user entry for energy drivers (#16059)
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Jun 30, 2024
1 parent 33062dc commit 65588b8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ bool McpCommand(void)
if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len && mcp_active_power) {
value = (unsigned long)(CharToFloat(XdrvMailbox.data) * 100);
if ((value > 100) && (value < 200000)) { // Between 1W and 2000W
if ((value > 100) && (value < 2000000)) { // Between 1W and 20000W
XdrvMailbox.payload = value;
mcp_calibrate |= MCP_CALIBRATE_POWER;
McpGetCalibration();
Expand All @@ -614,7 +614,7 @@ bool McpCommand(void)
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len && mcp_voltage_rms) {
value = (unsigned long)(CharToFloat(XdrvMailbox.data) * 10);
if ((value > 1000) && (value < 2600)) { // Between 100V and 260V
if ((value > 1000) && (value < 4000)) { // Between 100V and 400V
XdrvMailbox.payload = value;
mcp_calibrate |= MCP_CALIBRATE_VOLTAGE;
McpGetCalibration();
Expand All @@ -624,7 +624,7 @@ bool McpCommand(void)
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len && mcp_current_rms) {
value = (unsigned long)(CharToFloat(XdrvMailbox.data) * 10);
if ((value > 100) && (value < 80000)) { // Between 10mA and 8A
if ((value > 100) && (value < 800000)) { // Between 10mA and 80A
XdrvMailbox.payload = value;
mcp_calibrate |= MCP_CALIBRATE_CURRENT;
McpGetCalibration();
Expand Down
6 changes: 3 additions & 3 deletions tasmota/tasmota_xnrg_energy/xnrg_07_ade7953.ino
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ bool Ade7953Command(void) {
}
else if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len && Ade7953.active_power[channel]) {
if ((value > 100) && (value < 200000)) { // Between 1W and 2000W
if ((value > 100) && (value < 2000000)) { // Between 1W and 20000W
#ifdef ADE7953_ACCU_ENERGY
float power_calibration = (float)(Ade7953.active_power[channel] * 1000) / value; // 0.00 W
power_calibration *= ADE7953_POWER_CORRECTION;
Expand All @@ -842,14 +842,14 @@ bool Ade7953Command(void) {
}
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len && Ade7953.voltage_rms[channel]) {
if ((value > 10000) && (value < 26000)) { // Between 100V and 260V
if ((value > 10000) && (value < 40000)) { // Between 100V and 400V
XdrvMailbox.payload = (Ade7953.voltage_rms[channel] * 100) / value; // 0.00 V
}
}
}
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len && Ade7953.current_rms[channel]) {
if ((value > 2000) && (value < 1000000)) { // Between 20mA and 10A
if ((value > 2000) && (value < 10000000)) { // Between 20mA and 100A
XdrvMailbox.payload = ((Ade7953.current_rms[channel] * 100) / value) * 100; // 0.00 mA
}
}
Expand Down
6 changes: 3 additions & 3 deletions tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ bool Cse7761Command(void) {
}
else if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len && CSE7761Data.active_power[channel]) {
if ((value > 100) && (value < 200000)) { // Between 1W and 2000W
if ((value > 100) && (value < 2000000)) { // Between 1W and 20000W
XdrvMailbox.payload = ((CSE7761Data.active_power[channel]) / value) * 100;
}
}
Expand All @@ -635,7 +635,7 @@ bool Cse7761Command(void) {
}
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len && CSE7761Data.voltage_rms) {
if ((value > 10000) && (value < 26000)) { // Between 100V and 260V
if ((value > 10000) && (value < 40000)) { // Between 100V and 400V
XdrvMailbox.payload = (CSE7761Data.voltage_rms * 100) / value;
}
}
Expand All @@ -646,7 +646,7 @@ bool Cse7761Command(void) {
}
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len && CSE7761Data.current_rms[channel]) {
if ((value > 1000) && (value < 1000000)) { // Between 10mA and 10A
if ((value > 1000) && (value < 10000000)) { // Between 10mA and 100A
XdrvMailbox.payload = ((CSE7761Data.current_rms[channel] * 100) / value) * 1000;
}
}
Expand Down
6 changes: 3 additions & 3 deletions tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,21 @@ bool Bl6523Command(void) {
}
else if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len) {
if ((abs_value > 100) && (abs_value < 200000)) { // Between 1.00 and 2000.00 W
if ((abs_value > 100) && (abs_value < 2000000)) { // Between 1.00 and 20000.00 W
XdrvMailbox.payload = abs_value;
}
}
}
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len) {
if ((abs_value > 10000) && (abs_value < 26000)) { // Between 100.00 and 260.00 V
if ((abs_value > 10000) && (abs_value < 40000)) { // Between 100.00 and 400.00 V
XdrvMailbox.payload = abs_value;
}
}
}
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len) {
if ((abs_value > 1000) && (abs_value < 1000000)) { // Between 10.00 mA and 10.00000 A
if ((abs_value > 1000) && (abs_value < 10000000)) { // Between 10.00 mA and 100.00000 A
XdrvMailbox.payload = abs_value;
}
}
Expand Down

0 comments on commit 65588b8

Please sign in to comment.