This commit is contained in:
2023-07-11 09:01:39 +02:00
parent 1c3b6b7c0b
commit c71d5e02fe

View File

@@ -917,9 +917,9 @@ def on_message(client, userdata, msg):
print("not a json!")
client = mqtt.Client()
payload = "off"
payload = '{"status": "off"}'
client.username_pw_set("jaydee", password="jaydee1")
client.will_set("sectorq/systems/" + host.lower() + "/stat", payload=payload, qos=0, retain=True)
client.will_set("home-assistant/" + host.lower() + "/hwstats", payload=payload, qos=0, retain=True)
client.on_connect = on_connect
client.on_message = on_message
writeLog(MQTT_HOST)