From 475a58d8a46ebdd4a38e7c3e21a42e6ebf7f49e5 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Fri, 3 Oct 2025 10:32:14 +0200 Subject: [PATCH] upgrade ha-mqtt to v1.12 that changed path for state and command topics --- include/huzzah.h | 6 ++++-- platformio.ini | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/huzzah.h b/include/huzzah.h index 7e76092..6f2ac7d 100644 --- a/include/huzzah.h +++ b/include/huzzah.h @@ -13,6 +13,8 @@ Scheduler ts; #include "wifi.h" #include "webserver.h" +#define RAW_TOPIC MAIN_DEVICE_ID "/raw" + namespace Board { Task tReadCommand(TASK_IMMEDIATE, TASK_FOREVER, [](){ @@ -105,7 +107,7 @@ namespace Board { void publishResponse(JsonDocument& jsonDoc) { char message[255]; serializeJson(jsonDoc, message); - Mqtt::publish("homeassistant/sensor/rc-gateway/raw", message); + Mqtt::publish(RAW_TOPIC, message); if (jsonDoc.containsKey("rcSwitch")) parseSwitches(jsonDoc); if (jsonDoc.containsKey("sensor")) parseSensors(jsonDoc, message); } @@ -113,7 +115,7 @@ namespace Board { void handleJsonError(JsonDocument& jsonError) { char message[255]; serializeJson(jsonError, message); - Mqtt::publish("homeassistant/sensor/rc-gateway/raw", message); + Mqtt::publish(RAW_TOPIC, message); } } // {"rcSwitch":{"protocol":1,"state":false,"group":"11111","channel":4}} \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index f7be12c..f7fb245 100644 --- a/platformio.ini +++ b/platformio.ini @@ -33,7 +33,7 @@ framework = arduino lib_deps = ${env.lib_deps} arkhipenko/TaskScheduler@^3.8.5 - https://git.hodos.ro/libraries/ha-mqtt.git@^1.11.0 + https://git.hodos.ro/libraries/ha-mqtt.git@^1.12.0 https://git.hodos.ro/libraries/wifi.git@^2.0.0 esphome/ESPAsyncWebServer-esphome@^3.4.0 upload_port = 192.168.6.161