Is there anyone using MQTT as gateway for connecting to openHab running on another Rpi. If so please help with any links, post or any information to direct me on the right path.
Just one final question... is the approach to MQTT correct or should I stick with simple Ethernet? I was planning on using OpenHab or Home Assistant.
Thank You all
@tsunami My setup is max 50m radius and 433MHz standard power RFM69s so a small 1/4 wave whip works reliably even from a below ground pump chamber 10m away.
Your 915MHz at 200m SHOULD work on 1/4 wave if obstacle free line of sight, but you could try a 2.4GHz Wifi router at one location and use a mobile at the other to test if you can see the router. I can see at least 3 neighbouring routers identified on my mobile from over 40m away through masonry, 10 on the laptop, so it's a simple enough test.
If you can see the router on either, 915MHz should be rock solid with a simple whip and no need of directional antenna.
@Boots33
Thanks a lot for the quick response.
I now have my Nano running as a serial gateway and it is connected via a USB cable directly to my controller (Raspberry Pi 4 running Home Assistant / Hass.io).
I added a local motion sensor to the Nano gateway HW and pasted the mysensors MotionSensor example code to the setup(), presentation() and loop() functions as well as to the definitions in the top of the GatewaySerial example code.
I disabled the radio definitions as I currently have no radio capability in my gateway (not sure if this was necessary).
In Home Assistant / Hass.io I updated the configuration.yaml with the following text (as described on the Home Assistant integration help):
mysensors:
gateways:
- device: '/dev/ttyUSB0'
And it works
In Home Assistant Developer Tools under States I can now see my motion sensor go on and off by the flick of my hand.
I had expected a bit more bumps on the road just to get this far, but wow - I am obviously walking in the foot prints of people who have worked hard to make it easy for the rest of us.
I am sure I will hit bumps on the way when the radios have to send results to the gateway (thick concrete walls with lots of steel), but for now I will enjoy this big success.
Thanks again Boots33
@A3V such a feature would definitely make sense now that gateways can have local sensors. But no-one has added it unfortunately.
A solution could be to use the code at https://github.com/mysensors/MySensors/blob/2e00bf6a10f76d6aaa1999e12313237bc3edabd3/core/MyTransport.cpp#L446 as inspiration and do something similar at https://github.com/mysensors/MySensors/blob/2e00bf6a10f76d6aaa1999e12313237bc3edabd3/core/MyGatewayTransportEthernet.cpp#L175