From f3be6b0153f99742fe96ff85a57ff90c7ef3f689 Mon Sep 17 00:00:00 2001 From: DigiH Date: Wed, 15 Nov 2023 21:45:42 +0100 Subject: [PATCH] [DISC] SYS: LED Brightness fix & SYS: Internal temperature single decimal (#1806) --- main/ZmqttDiscovery.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/ZmqttDiscovery.ino b/main/ZmqttDiscovery.ino index b445258..3a5c386 100644 --- a/main/ZmqttDiscovery.ino +++ b/main/ZmqttDiscovery.ino @@ -519,8 +519,8 @@ void pubMqttDiscovery() { # ifdef RGB_INDICATORS createDiscovery("number", //set Type subjectSYStoMQTT, "SYS: LED Brightness", (char*)getUniqueId("rgbbrightness", "").c_str(), //set state_topic,name,uniqueId - will_Topic, "", "{{ value_json.rgbbrightness/2.55}}", //set availability_topic,device_class,value_template, - "{\"rgbbrightness\":{{value*2.55}},\"save\":true}", "", "s", //set,payload_on,payload_off,unit_of_meas, + will_Topic, "", "{{ (value_json.rgbbrightness/2.55) | round(0) }}", //set availability_topic,device_class,value_template, + "{\"rgbbrightness\":{{ (value*2.55) | round(0) }},\"save\":true}", "", "", //set,payload_on,payload_off,unit_of_meas, 0, //set off_delay Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_available,payload_not available ,is a gateway entity, command topic "", "", "", "", false, // device name, device manufacturer, device model, device ID, retain, @@ -575,7 +575,7 @@ void pubMqttDiscovery() { # if defined(ESP32) && !defined(NO_INT_TEMP_READING) createDiscovery("sensor", //set Type subjectSYStoMQTT, "SYS: Internal temperature", (char*)getUniqueId("tempc", "").c_str(), //set state_topic,name,uniqueId - will_Topic, "temperature", "{{ value_json.tempc }}", //set availability_topic,device_class,value_template, + will_Topic, "temperature", "{{ value_json.tempc | round(1)}}", //set availability_topic,device_class,value_template, "", "", "°C", //set,payload_on,payload_off,unit_of_meas, 0, //set off_delay Gateway_AnnouncementMsg, will_Message, true, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic