Allow rules on energy margins

Allow rules on energy margins (#8935)
This commit is contained in:
Theo Arends 2020-07-20 16:41:05 +02:00
parent 0a64625e9a
commit 59f50d04f2
1 changed files with 2 additions and 2 deletions

View File

@ -306,7 +306,7 @@ void EnergyMarginCheck(void)
uint16_t energy_power_u = (uint16_t)(Energy.active_power[0]); uint16_t energy_power_u = (uint16_t)(Energy.active_power[0]);
bool jsonflg = false; bool jsonflg = false;
Response_P(PSTR("{")); Response_P(PSTR("{\"" D_RSLT_MARGINS "\":{"));
if (Settings.energy_power_delta) { if (Settings.energy_power_delta) {
int16_t power_diff = energy_power_u - Energy.power_history[0]; int16_t power_diff = energy_power_u - Energy.power_history[0];
@ -369,7 +369,7 @@ void EnergyMarginCheck(void)
} }
} }
if (jsonflg) { if (jsonflg) {
ResponseJsonEnd(); ResponseJsonEndEnd();
MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_MARGINS), MQTT_TELE_RETAIN); MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_MARGINS), MQTT_TELE_RETAIN);
XdrvRulesProcess(); XdrvRulesProcess();
EnergyMqttShow(); EnergyMqttShow();