diff --git a/Config.h b/Config.h index 339bd9b..bb1d716 100644 --- a/Config.h +++ b/Config.h @@ -1,6 +1,6 @@ #pragma once -#define NUKI_HUB_VERSION "8.9-json-2" +#define NUKI_HUB_VERSION "8.9-json-3" #define MQTT_QOS_LEVEL 1 #define MQTT_CLEAN_SESSIONS false \ No newline at end of file diff --git a/Network.cpp b/Network.cpp index a932787..fcb377a 100644 --- a/Network.cpp +++ b/Network.cpp @@ -630,7 +630,7 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n baseTopic, mqtt_topic_battery_voltage, deviceType, - "battery", + "voltage", "measurement", "diagnostic", "V"); @@ -790,7 +790,10 @@ void Network::publishHassTopic(const String& mqttDeviceType, json["~"] = baseTopic; json["name"] = name + String(" " + displayName); json["unique_id"] = String(uidString) + uidStringPostfix; - json["dev_cla"] = deviceClass; + if(deviceClass != "") + { + json["dev_cla"] = deviceClass; + } json["stat_t"] = String("~") + stateTopic; if(stateClass != "")