From 05e1b3ba2264134d44298b70c79a2d01357447b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Beye?= Date: Sun, 20 Aug 2023 21:51:25 +0200 Subject: [PATCH] Comply with new home assistant 2023.8 naming requirements --- esp8266-geigercounter.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/esp8266-geigercounter.ino b/esp8266-geigercounter.ino index 5323a82..d33cfde 100644 --- a/esp8266-geigercounter.ino +++ b/esp8266-geigercounter.ino @@ -176,7 +176,7 @@ void publishAutoConfig() { device["manufacturer"] = "MightyOhm LLC"; device["model"] = "Geiger Counter"; device["name"] = identifier; - device["sw_version"] = "0.0.1"; + device["sw_version"] = "2023.08.0"; DynamicJsonDocument cpmSensorPayload(512); @@ -184,8 +184,9 @@ void publishAutoConfig() { cpmSensorPayload["device"] = device.as(); cpmSensorPayload["availability_topic"] = MQTT_TOPIC_AVAILABILITY; cpmSensorPayload["state_topic"] = MQTT_TOPIC_CPM; - cpmSensorPayload["name"] = identifier + String(" CPM"); + cpmSensorPayload["name"] = "CPM"; cpmSensorPayload["unit_of_measurement"] = "CPM"; + cpmSensorPayload["state_class"] = "measurement"; cpmSensorPayload["unique_id"] = identifier + String("_cpm"); serializeJson(cpmSensorPayload, mqttPayload); @@ -196,12 +197,13 @@ void publishAutoConfig() { usvSensorPayload["device"] = device.as(); usvSensorPayload["availability_topic"] = MQTT_TOPIC_AVAILABILITY; usvSensorPayload["state_topic"] = MQTT_TOPIC_USV; - usvSensorPayload["name"] = identifier + String(" uSv"); + usvSensorPayload["name"] = "uSv"; usvSensorPayload["unit_of_measurement"] = "µSv/h"; + usvSensorPayload["state_class"] = "measurement"; usvSensorPayload["unique_id"] = identifier + String("_uSv"); serializeJson(usvSensorPayload, mqttPayload); mqttClient.publish(MQTT_TOPIC_AUTOCONF_USV, mqttPayload, true); Serial.println("Published MQTT Autoconf"); -} +} \ No newline at end of file