浏览代码

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

FloKra 1 年之前
父节点
当前提交
6eb956b020
共有 2 个文件被更改,包括 6 次插入0 次删除
  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) \