diff --git a/mqtt.py b/mqtt.py index 357605b..75c00e5 100644 --- a/mqtt.py +++ b/mqtt.py @@ -7,9 +7,10 @@ def on_connect(client, userdata, flags, reason_code, properties): print(f"Connected with result code {reason_code}") # Subscribing in on_connect() means that if we lose the connection and # reconnect then subscriptions will be renewed. - client.subscribe("$SYS/#") - client.subscribe('test/hallo') + #client.subscribe("$SYS/#") + client.subscribe('test/topic') client.subscribe('homeassistant/status') + publish.single('test/topic', 'Hello, MQTT!', hostname='192.168.188.30', auth={'username': 'mqtt', 'password': 'mqtt'}) # The callback for when a PUBLISH message is received from the server.