From 504570d5d5bd406ba0bd755e2e03f5bbddf83ede Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 9 Feb 2020 16:21:48 +0100 Subject: [PATCH] Fix MaxPower functionality Fix MaxPower functionality (#7647) --- RELEASENOTES.md | 2 ++ tasmota/CHANGELOG.md | 3 ++- tasmota/support_tasmota.ino | 3 ++- tasmota/xdrv_03_energy.ino | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f632ea78d..8162ae9f2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -71,6 +71,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Fix ``RGBWWTable`` ignored (#7572) - Fix PWM flickering at low levels (#7415) - Fix Hass sensor discovery part 1/4 by Federico Leoni (#7582, #7548) +- Fix MaxPower functionality (#7647) - Add command ``SetOption79 0/1`` to enable reset of counters at teleperiod time by Andre Thomas (#7355) - Add command ``SetOption82 0/1`` to limit the CT range for Alexa to 200..380 - Add command ``SetOption84 1`` to send AWS IoT device shadow updates (alternative to retained) @@ -95,3 +96,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add support for sensors DS18x20 and DHT family on Shelly 1 and Shelly 1PM using Shelly Add-On adapter (#7469) - Add support for MI-BLE sensors using HM-10 Bluetooth 4.0 module by Christian Staars (#7683) - Add BootCount Reset Time as BCResetTime to ``Status 1`` +- Add ``ZbZNPReceived``and ``ZbZCLReceived`` being published to MQTT when ``SetOption66 1`` diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 8470fc930..4a490d2df 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -3,12 +3,13 @@ ### 8.1.0.6 20200205 - Fix Hass sensor discovery part 1/4 by Federico Leoni (#7582, #7548) +- Fix MaxPower functionality (#7647) - Add support for sensors DS18x20 and DHT family on Shelly 1 and Shelly 1PM using Shelly Add-On adapter (#7469) - Add commands ``SwitchMode 11`` PushHoldMulti and ``SwitchMode 12`` PushHoldInverted (#7603) - Add command ``Buzzer -1`` for infinite mode and command ``Buzzer -2`` for following led mode (#7623) - Add support for MI-BLE sensors using HM-10 Bluetooth 4.0 module by Christian Staars (#7683) - Add BootCount Reset Time as BCResetTime to ``Status 1`` -- Add ``ZbZNPReceived``and ``ZbZCLReceived``are published to MQTT when ``SetOption66 1`` +- Add ``ZbZNPReceived``and ``ZbZCLReceived`` being published to MQTT when ``SetOption66 1`` ### 8.1.0.5 20200126 diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 984d93d1e..888893fea 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -235,7 +235,8 @@ void SetDevicePower(power_t rpower, uint32_t source) void RestorePower(bool publish_power, uint32_t source) { if (power != last_power) { - SetDevicePower(last_power, source); + power = last_power; + SetDevicePower(power, source); if (publish_power) { MqttPublishAllPowerState(); } diff --git a/tasmota/xdrv_03_energy.ino b/tasmota/xdrv_03_energy.ino index 4573d2406..bb74b991d 100644 --- a/tasmota/xdrv_03_energy.ino +++ b/tasmota/xdrv_03_energy.ino @@ -365,7 +365,7 @@ void EnergyMarginCheck(void) EnergyMqttShow(); SetAllPower(POWER_ALL_OFF, SRC_MAXPOWER); if (!Energy.mplr_counter) { - Energy.mplr_counter = Settings.param[P_MAX_POWER_RETRY] +1; + Energy.mplr_counter = Settings.param[P_MAX_POWER_RETRY] +1; // SetOption33 - Max Power Retry count } Energy.mplw_counter = Settings.energy_max_power_limit_window; } @@ -390,6 +390,7 @@ void EnergyMarginCheck(void) ResponseTime_P(PSTR(",\"" D_JSON_MAXPOWERREACHEDRETRY "\":\"%s\"}"), GetStateText(0)); MqttPublishPrefixTopic_P(STAT, S_RSLT_WARNING); EnergyMqttShow(); + SetAllPower(POWER_ALL_OFF, SRC_MAXPOWER); } } }