From 65588b8126ca0b87333b66f1114a579ae6bf2efd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 30 Jun 2024 17:26:39 +0200 Subject: [PATCH] Increase upper limits user entry for energy drivers (#16059) --- tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino | 6 +++--- tasmota/tasmota_xnrg_energy/xnrg_07_ade7953.ino | 6 +++--- tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino | 6 +++--- tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino b/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino index 1c4695b4d3dc..f3b6a580b0b7 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino @@ -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(); @@ -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(); @@ -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(); diff --git a/tasmota/tasmota_xnrg_energy/xnrg_07_ade7953.ino b/tasmota/tasmota_xnrg_energy/xnrg_07_ade7953.ino index 526950d1df3e..30330d1fe055 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_07_ade7953.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_07_ade7953.ino @@ -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; @@ -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 } } diff --git a/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino b/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino index 09a4542017b6..2fc4ea1fb40b 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino @@ -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; } } @@ -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; } } @@ -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; } } diff --git a/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino b/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino index b0b5d442a41a..1e95abf6fc2d 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino @@ -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; } }