Skip to content

Commit

Permalink
[DISC] SYS: RSSI, SYS: Uptime and SYS: Free memory discovery device c…
Browse files Browse the repository at this point in the history
…lasses (#1803)

SYS: RSSI, SYS: Uptime and SYS: Free memory discovery device classes additions
  • Loading branch information
DigiH authored Nov 14, 2023
1 parent 83137f6 commit 28b9718
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/ZmqttDiscovery.ino
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void pubMqttDiscovery() {
);
createDiscovery("sensor", //set Type
subjectSYStoMQTT, "SYS: Uptime", (char*)getUniqueId("uptime", "").c_str(), //set state_topic,name,uniqueId
will_Topic, "", "{{ value_json.uptime }}", //set availability_topic,device_class,value_template,
will_Topic, "duration", "{{ value_json.uptime }}", //set availability_topic,device_class,value_template,
"", "", "s", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
Expand All @@ -480,7 +480,7 @@ void pubMqttDiscovery() {
# if defined(ESP8266) || defined(ESP32)
createDiscovery("sensor", //set Type
subjectSYStoMQTT, "SYS: Free memory", (char*)getUniqueId("freemem", "").c_str(), //set state_topic,name,uniqueId
will_Topic, "", "{{ value_json.freemem }}", //set availability_topic,device_class,value_template,
will_Topic, "data_size", "{{ value_json.freemem }}", //set availability_topic,device_class,value_template,
"", "", "B", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
Expand Down Expand Up @@ -562,8 +562,8 @@ void pubMqttDiscovery() {

# ifndef ESP32_ETHERNET
createDiscovery("sensor", //set Type
subjectSYStoMQTT, "SYS: Rssi", (char*)getUniqueId("rssi", "").c_str(), //set state_topic,name,uniqueId
will_Topic, "", "{{ value_json.rssi }}", //set availability_topic,device_class,value_template,
subjectSYStoMQTT, "SYS: RSSI", (char*)getUniqueId("rssi", "").c_str(), //set state_topic,name,uniqueId
will_Topic, "signal_strength", "{{ value_json.rssi }}", //set availability_topic,device_class,value_template,
"", "", "dB", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
Expand Down
2 changes: 2 additions & 0 deletions main/config_mqttDiscovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ const char* availableHASSClasses[] = {"battery",
"humidity",
"illuminance",
"signal_strength",
"duration",
"data_size",
"temperature",
"timestamp",
"pressure",
Expand Down

0 comments on commit 28b9718

Please sign in to comment.