N00b + MQTT gw + openHAB2
-
To check mqtt is working you don't need controller, but if you want some easy interaction try first as I suggested: easy steps. I wanted to start with Openhab too, but it was too much complicated for a beginner while domoticz was much simpler to connect to mysensors
-
I do not fully understand why you are using MQTT. Can you quickly sketch your setup in a block diagram?
If you want a quick setup for starters, go for
Laptop <-> Serial Gateway Arduino <-> nrf24 ******** nrf24<->Arduino<->Relay
then get OH2 up and running. If you use pure MQTT you don't need the MySensors binding because everything is going through the MQTT broker (mosquitto). I recently started playing with MQTT and it is way more complex than above suggested setup because you need to manually play with configs etc.
I remember I had problems with OH2 because some java stuff was missing/not functioning. See the threads on this forum and the OH2 forums.
Laptop is suitable, just think about the power consumption. If you let it running 24/7 I'd consider getting a (even older) Raspberry Pi. The costs will be amortized quickly. (Let's say 30W * 24h * 365d * 0.25ct/kWh = 66EUR meaning RPi will be amortized in 6 months).
-
I do not fully understand why you are using MQTT. Can you quickly sketch your setup in a block diagram?
If you want a quick setup for starters, go for
Laptop <-> Serial Gateway Arduino <-> nrf24 ******** nrf24<->Arduino<->Relay
then get OH2 up and running. If you use pure MQTT you don't need the MySensors binding because everything is going through the MQTT broker (mosquitto). I recently started playing with MQTT and it is way more complex than above suggested setup because you need to manually play with configs etc.
I remember I had problems with OH2 because some java stuff was missing/not functioning. See the threads on this forum and the OH2 forums.
Laptop is suitable, just think about the power consumption. If you let it running 24/7 I'd consider getting a (even older) Raspberry Pi. The costs will be amortized quickly. (Let's say 30W * 24h * 365d * 0.25ct/kWh = 66EUR meaning RPi will be amortized in 6 months).
-
@gohan: I understand but what's the incentive? It's more easy to plug the Arduino via USB and do serial gateway than fiddling with MQTT and network stuff.
-
I ran into NodeRed and thought it would be easy to do mqtt-functions (button press somewhere => do something elsewhere) using that and skipping coding.
I thought the serial gateway would be a hassle in terms of testing. Thought NodeRed would ease the early testing part. Plus I want to be able to access the system from the net to check/control everything (I have DNS already). That's prob all the same.
Upon @gohan recommendation, I wrote/tuned the ethernet sketch (see couple questions above) and "installed" Domoticz but as the compiling took SO LONG, I didn't have time to test it (weekend getaway house:grinning: ).
I had an extra minilaptop lying around, installed Lubuntu on it. Thought it'd have a better life upcycled than thrown out. I have a diy UPS-system (+wind power coming) that powers the whole thing so I didnt want to buy new stuff.
Plus, I've built the gateway, so I'd rather get it working.++ if the controller breaks or locks up, I'd have a way to access & control the system with MQTT.... <= further thought: wont work right?
-
If you want to play with node red, at the moment it is not supporting mysensors over mqtt but only serial and ethernet. Then depending on the level of integration and automation you want to have, there are different solutions: if you want some basic control of Arduino IO ports over Internet with a nice app, you could use cayenne, but if you want to have multiple wireless sensors and automation you'd better stay with mysensors and domoticz and start getting some experience; later on you can start looking at more complex scenarios.
-
If you want to play with node red, at the moment it is not supporting mysensors over mqtt but only serial and ethernet. Then depending on the level of integration and automation you want to have, there are different solutions: if you want some basic control of Arduino IO ports over Internet with a nice app, you could use cayenne, but if you want to have multiple wireless sensors and automation you'd better stay with mysensors and domoticz and start getting some experience; later on you can start looking at more complex scenarios.
@gohan Totally agree.
I'll push forward with your recommendations: ethernet+domoticz. After looking into Domo, I think it could serve me well for my purposes as a whole.
Any ideas about the code for the gateway: udp? controller ip? relays?
I will build one more Mysensors relay so I can verify radio working etc. -
I use MQTT and Openhab2 - I find it more flexible then the Ethernet GW but yes you need to have a good understanding on all systems I suppose.
Somethings to note
- MySensors binding doesn't support MQTT gateway as far as I know, you need to use the MQTT binding and configure your OH items accordingly.
- MySensors binding is in the IOT market place and not openhab-addons
- You'll need to assign node ID to your nodes manually.
Not entirely sure what your problem is here but don't think you've got all the right pieces for the puzzle yet.
-
I use MQTT and Openhab2 - I find it more flexible then the Ethernet GW but yes you need to have a good understanding on all systems I suppose.
Somethings to note
- MySensors binding doesn't support MQTT gateway as far as I know, you need to use the MQTT binding and configure your OH items accordingly.
- MySensors binding is in the IOT market place and not openhab-addons
- You'll need to assign node ID to your nodes manually.
Not entirely sure what your problem is here but don't think you've got all the right pieces for the puzzle yet.
-
@Qu3Uk I remember that Mysensors binding works both ethernet and MQTT, but anyway ethernet is the best solution for beginners because you can use myscontroller to debug messages while connected to controller.
-
@Qu3Uk I remember that Mysensors binding works both ethernet and MQTT, but anyway ethernet is the best solution for beginners because you can use myscontroller to debug messages while connected to controller.
@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)
-
@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)?