diff --git a/ESP8266-MQTT-Teufel-DS5/ESP8266-MQTT-Teufel-DS5.ino b/ESP8266-MQTT-Teufel-DS5/ESP8266-MQTT-Teufel-DS5.ino index 8a6cfe9..544a220 100644 --- a/ESP8266-MQTT-Teufel-DS5/ESP8266-MQTT-Teufel-DS5.ino +++ b/ESP8266-MQTT-Teufel-DS5/ESP8266-MQTT-Teufel-DS5.ino @@ -211,6 +211,10 @@ void incoming_mqtt(char* topic, byte* payload, unsigned int length) { } } + if (strcmp(topic, mqtt_topic_power) == 0) { + code = codes[0]; + } + free(msgCopy); // Check if we found a code to send @@ -236,6 +240,7 @@ void reconnect() { // subscribe to incoming topics client.subscribe(mqtt_topic_command); client.subscribe(mqtt_topic_volume); + client.subscribe(mqtt_topic_power); if (DEBUGTOSERIAL) { Serial.println("Subscriptions done"); }