mirror of
https://gitlab.sectorq.eu/jaydee/mqtt_srv.git
synced 2025-12-15 02:54:54 +01:00
vars
This commit is contained in:
@@ -917,9 +917,9 @@ def on_message(client, userdata, msg):
|
|||||||
print("not a json!")
|
print("not a json!")
|
||||||
|
|
||||||
client = mqtt.Client()
|
client = mqtt.Client()
|
||||||
payload = "off"
|
payload = '{"status": "off"}'
|
||||||
client.username_pw_set("jaydee", password="jaydee1")
|
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_connect = on_connect
|
||||||
client.on_message = on_message
|
client.on_message = on_message
|
||||||
writeLog(MQTT_HOST)
|
writeLog(MQTT_HOST)
|
||||||
|
|||||||
Reference in New Issue
Block a user