Hello,
@waltervl : I came across the web site
http://www.steves-internet-guide.com/in ... on-client/
Context:
MQTT GAteway prefix : zwave
MQTT Name : zwave-js-ui
I wrote a simple python script to get the MQTT info using api getInfo :
import paho.mqtt.client as mqtt #import the client
import time
def on_message(client, userdata, message):
print("message received " ,str(message.payload.decode("utf-8")))
print("message topic=",message.topic)
print("message qos=",message.qos)
print("message retain flag=",message.retain)
def on_publish(client,userdata,result): #create function for callback
print("begin data published \n")
print(result)
print("end data published \n")
def on_disconnect(client, userdata, rc):
print("client disconnected ok")
def on_log(client, userdata, level, buf):
print("log: ",buf)
broker_address="192.168.0.112"
client = mqtt.Client("zwave") #create new instance
client.on_publish = on_publish #assign function to callback
client.on_disconnect = on_disconnect
client.on_log=on_log
client.on_message=on_message #attach function to callback
client.connect(broker_address,1883) #connect to broker
publish_result=client.publish("zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/api/getInfo/set","payload")
print(publish_result.rc)
print(publish_result.is_published())
publish_result.wait_for_publish()
print(publish_result.is_published())
I do not get the Gatevay info and get stuck in the line publish_result.wait_for_publish()
Has anyone developed a python script to access to zwave-js-ui via MQTT or could help me ?
BR