소스 검색

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) \