mirror of
https://github.com/schinken/esp8266-geigercounter.git
synced 2024-11-22 00:20:20 +01:00
Comply with new home assistant 2023.8 naming requirements
This commit is contained in:
parent
8a47d2a644
commit
05e1b3ba22
1 changed files with 6 additions and 4 deletions
|
@ -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<JsonObject>();
|
||||
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<JsonObject>();
|
||||
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");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue