N00b + MQTT gw + openHAB2
-
@gohan said in N00b + MQTT gw + openHAB2:
but anyway ethernet is the best solution for beginners because you can use myscontroller to debug messages while connected to controller.
With MQTT you can also debug using MQTT-Spy or MQTTLens or various other MQTT apps.
MQTT is easy in interconnecting various systems without they have to know about each-other.
As long as you have a MQTT broker (RabbitMQ, Mosquitto, ActiveMQ, ...) you're all set.
In OpenHab in conf/services create a file called mqtt.cfg, and past the following:
mqtt:broker.url=tcp://ip-address-of-mqttbroker:1883 mqtt:broker.clientId=openhab mqtt:broker.retain=true mqtt:broker.async=falseThen in your items file you can do:
Switch Light_GV_Hall "Ceiling" (GV_Hall, Lights) {mqtt=">[broker:myhome/room/switch1:command:ON:1],>[broker:myhome/room/switch1:command:OFF:0],<[broker:myhome/room/switch1:state:ON:1],<[broker:myhome/room/switch1:state:OFF:0"}And now you can turn on/off the light from OpenHab as wel as from any other device that publishes to the same toppic (yes, even from MQTT-Spy and MQTTLens)
-
Update.
After much trying the Ethernet gw would not connect to Domoticz.
Then, tried my mqtt sketch again and presto! I have connection AND I can control the two relays on board the mqtt-gw.
Had a cold one...or four!
Thanks for the recommendations and help. I'm sure I will need more later on. Now I'm going to explore the Domoticz forum for answers.
Unless someone with the same setup can tell me why the lights are crossed (on = off in reality and off=light on)?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login