From d3ccd668b080cba466ac10c62aa499e98b28df45 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 12 Dec 2018 20:32:10 +0100 Subject: [PATCH] Publish state message when changing effect --- sonoff/xdrv_04_light.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonoff/xdrv_04_light.ino b/sonoff/xdrv_04_light.ino index 6fad79fe3..52eba7d2d 100644 --- a/sonoff/xdrv_04_light.ino +++ b/sonoff/xdrv_04_light.ino @@ -1260,6 +1260,12 @@ boolean LightCommand(void) } LightPowerOn(); strip_timer_counter = 0; + // Publish state message for Hass + if (Settings.flag3.hass_tele_on_power) { + mqtt_data[0] = '\0'; + MqttShowState(); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE), MQTT_TELE_RETAIN); + } } snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_NVALUE, command, Settings.light_scheme); }