The best way to connect to OpenHAB
-
Hi!
Im a slow starter , but I been following the develompent here and over at http://www.byggahus.se/forum/villalarm-hemautomation/ for some time now but just recently I bought some z-wave things to play with and it's working quite ok now in OpenHab (windows 7).
I have a question about using OpenHab as controller for mysensors that I want to double check before I dive in :)
-
Can I use Arduino Nano + Radio module as a gateway to OpenHab attached as usb ?
-
Will it power over usb ?
-
If so does that limit me to use the serial bindning or is MQTT still an option ?
-
-
Hi!
I used an Arduino Nano (clone) as serial gateway to OpenHab, it worked without problems. Meanwhile I changed to an UNO-clone because the Nano fit better into its new task.Power over USB was not an issue, it worked flawless.
The last question is a little bit ambiguous -
Scenario A - switching between serial binding or MQTT (over serial/USB) does not require much work (depending on your installation). You even don't have to change a plug. I did this several times and it is a little bit annoying -but it works.Scenario B:
Serial binding and MQTT binding of the same gateway in parallel - I haven't tried this, but you will probably run into trouble.Serial binding of the gateway and MQTT binding of a part of the messages of the MySensors network through a specialized node is not that difficult. It requires some strategy on programming the individual nodes (e.g. send this messages also to node xy which delivers these messages to a MQTT broker). The connection between this node and MQTT is serial/USB
It doesn't make much sense to use serial binding and MQTT binding from the same source to the same target, but it makes sense (at least for me) when the target is different. (e.g. switching and feedback via OpenHab, collecting sensor information via specialized programs).If you see MQTT-binding as synonym for an Ethernet connection - I tried MQTT over Ethernet a long time ago and it didn't perform to my needs. There are new programs but i haven't tested until now. Switching between serial and Ethernet connection will probably cause the same amount of work mentioned above.
-
Hi!
I used an Arduino Nano (clone) as serial gateway to OpenHab, it worked without problems. Meanwhile I changed to an UNO-clone because the Nano fit better into its new task.Power over USB was not an issue, it worked flawless.
The last question is a little bit ambiguous -
Scenario A - switching between serial binding or MQTT (over serial/USB) does not require much work (depending on your installation). You even don't have to change a plug. I did this several times and it is a little bit annoying -but it works.Scenario B:
Serial binding and MQTT binding of the same gateway in parallel - I haven't tried this, but you will probably run into trouble.Serial binding of the gateway and MQTT binding of a part of the messages of the MySensors network through a specialized node is not that difficult. It requires some strategy on programming the individual nodes (e.g. send this messages also to node xy which delivers these messages to a MQTT broker). The connection between this node and MQTT is serial/USB
It doesn't make much sense to use serial binding and MQTT binding from the same source to the same target, but it makes sense (at least for me) when the target is different. (e.g. switching and feedback via OpenHab, collecting sensor information via specialized programs).If you see MQTT-binding as synonym for an Ethernet connection - I tried MQTT over Ethernet a long time ago and it didn't perform to my needs. There are new programs but i haven't tested until now. Switching between serial and Ethernet connection will probably cause the same amount of work mentioned above.
@tboha
Thanks for clearing that out.I am not planning to run them in parallel but I do want a setup that allows me to switch controller(software) in the future and thats why I thought that MQTT was to prefer as it would allow me to easily switch but if I understand you correctly it is easy to change between MQTT and serial binding ?
-
@JimmyH : Yes, it is easy to swap bindings as well as controller. Easy - but it requires some labour. This labour is not complex, it just has to be done. In my specific setup it takes approximately 1-2 minutes per device.
If you are using the serial binding in OpenHab it is tempting to perform some processing within the nested case statements (like I did). Retrospectively this was a really bad idea.
I think it is a better idea to limit the use of these statements to dispatch the incoming data to the chosen Items - and nothing more.
I had a hard time to get used to the functions of OpenHab ".rules" but at last it was worth the effort. Transfer every processing step into separate rules - it will make things easy.
In an ideal scenario to switch between serial and MQTT (either serial or over Ethernet) you pull your USB-plug, activate your broker and you are done.
Due to laziness and little other reasons I'm stuck with an inhomogeneous system resulting in the work mentioned in the beginning - it is tedious but i leads to the desired results.