From 037b2ef12ca06890b08ef16d805ad9b1acf9ccfe Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 7 Dec 2024 16:25:54 +0100 Subject: [PATCH] Reset Serial communication statistic at start --- mqttclient/fanATserial2mqtt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mqttclient/fanATserial2mqtt.py b/mqttclient/fanATserial2mqtt.py index 3b4079a..2a068e3 100644 --- a/mqttclient/fanATserial2mqtt.py +++ b/mqttclient/fanATserial2mqtt.py @@ -5,7 +5,7 @@ from paho.mqtt import client as mqtt_client import os import serial -MAXIMUM_COMMUNICATION_FAILURE=100 +MAXIMUM_COMMUNICATION_FAILURE=1000 TEMPERATUR_MIN_DIFFERENCE = 2 TARGET_MIN_DIFFERENCE = 1 @@ -59,7 +59,9 @@ client.loop_start() client.publish(mqtt_topic + "device", ser.name) # check which port was really used +# Reset Serial Communication statistic SerialCommunicationFailureCounter=0 +client.publish(mqtt_topic + "serialcom/failure", str(SerialCommunicationFailureCounter)) # store last published value lastTemperatur = -1