diff --git a/src/main.cpp b/src/main.cpp index fbed474..6eeeb30 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,7 +22,8 @@ static SocketServer socketServer; WiFiClient client; Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY); -Adafruit_MQTT_Subscribe mqtt_subscribe_topic = Adafruit_MQTT_Subscribe(&mqtt, "homeassistant/marquee_sign/text"); +Adafruit_MQTT_Subscribe mqtt_subscribe_topic = Adafruit_MQTT_Subscribe(&mqtt, "homeassistant/marquee_sign/text/set"); +Adafruit_MQTT_Publish mqtt_publish_topic = Adafruit_MQTT_Publish(&mqtt, "homeassistant/marquee_sign/text/status"); void MQTT_connect(); @@ -79,6 +80,8 @@ void loop() { const char* signText = (char *)mqtt_subscribe_topic.lastread; sendTextToSign(signText); + + mqtt_publish_topic.publish(signText); } }