Explorar el Código

2023-11-30:
- add LaCrosse/lastUpdate MQTT output for monitoring purposes, updates every time any sensor data is received

FloKra hace 1 año
padre
commit
6eb956b020
Se han modificado 2 ficheros con 6 adiciones y 0 borrados
  1. 3 0
      CHANGELOG.md
  2. 3 0
      jeelinklog/jeelinklog.py

+ 3 - 0
CHANGELOG.md

@@ -1,5 +1,8 @@
 # JeeLinkLogMQTT - change log
 
+## 2023-11-30
+* add LaCrosse/lastUpdate MQTT output for monitoring purposes, updates every time any sensor data is received
+
 ## 2023-01-27
 * add exit program if nothing has been received from JeeLink for 5 minutes (will be restarted by systemd)
 

+ 3 - 0
jeelinklog/jeelinklog.py

@@ -676,6 +676,9 @@ try:
                                 mqttc.publish(mqtt_topic_prefix+"/"+ s_name +"/availability", "available", qos=0, retain=False)
                                 mqttc.publish(mqtt_topic_prefix+"/"+ s_name +"/lastUpdate", strftime("%Y-%m-%d %H:%M:%S", localtime()), qos=0, retain=False)
                                 
+                                # publish global lastUpdate for monitoring purposes
+                                mqttc.publish(mqtt_topic_prefix+"/lastUpdate", strftime("%Y-%m-%d %H:%M:%S", localtime()), qos=0, retain=False)
+                                
                                 # JSON output
                                 lacrosse_json = "{\"temperature\":" + str(s_currAvgTemp) \
                                     + ", \"humidity\":" + str(s_currAvgHum) \