Browse Source

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

FloKra 1 year ago
parent
commit
6eb956b020
2 changed files with 6 additions and 0 deletions
  1. 3 0
      CHANGELOG.md
  2. 3 0
      jeelinklog/jeelinklog.py

+ 3 - 0
CHANGELOG.md

@@ -1,5 +1,8 @@
 # JeeLinkLogMQTT - change log
 # 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
 ## 2023-01-27
 * add exit program if nothing has been received from JeeLink for 5 minutes (will be restarted by systemd)
 * 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 +"/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)
                                 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
                                 # JSON output
                                 lacrosse_json = "{\"temperature\":" + str(s_currAvgTemp) \
                                 lacrosse_json = "{\"temperature\":" + str(s_currAvgTemp) \
                                     + ", \"humidity\":" + str(s_currAvgHum) \
                                     + ", \"humidity\":" + str(s_currAvgHum) \