aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2025-01-24 12:33:11 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2025-01-24 12:33:11 +0000
commit88c7f1395c889cce14a9ad67da9b21212db75dde (patch)
tree0d87dc012e1aabf260df18ef3f3edf8e14e70059
parenta8e7d91e8cdc3c48568fee9c8ca69bdc3ae28ef9 (diff)
downloadTasmotaCLI-88c7f1395c889cce14a9ad67da9b21212db75dde.tar.gz
TasmotaCLI-88c7f1395c889cce14a9ad67da9b21212db75dde.zip
Updated the MQTT topic name
-rw-r--r--tasmota-mqtt-client.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tasmota-mqtt-client.py b/tasmota-mqtt-client.py
index 9c9ccb5..2151641 100644
--- a/tasmota-mqtt-client.py
+++ b/tasmota-mqtt-client.py
@@ -34,12 +34,14 @@ class MQTTClient:
def _on_connect_cb(self, mqtt, userdata, flags, rc):
# print("Connected to broker")
+ topic = "tele/TasmotaPlug/%s/SENSOR" % self.friendlyname
if self.message is None:
- self.mqtt_c.subscribe("tele/%s/+" % self.friendlyname)
+ print("Waiting for '%s'" % topic)
+ self.mqtt_c.subscribe(topic)
else:
- self.mqtt_c.publish("cmnd/%s/Power" % self.friendlyname, payload = self.message)
- print("Sent message '%s' to topic 'cmnd/%s/Power'" % (self.message, self.friendlyname))
+ self.mqtt_c.publish("cmnd/TasmotaPlug/%s/Power" % self.friendlyname, payload = self.message)
+ print("Sent message '%s' to topic 'cmnd/TasmotaPlug/%s/Power'" % (self.message, self.friendlyname))
SENT_EVENT.set()
self.mqtt_c.disconnect()