script to convert serial to mqtt?
-
Hi,
I am trying to find a working script that translates messages from my serial gateway to mqtt so that they are equivalent (in structure and topics) to a mysensors mqtt-gateway.
The reason I would like this is that I can't use my rfm69h chip on my raspberry pi atm but I can use a serial gateway. As soon as I can use the chip I would like to use the mqtt gateway. And I don't want to set everything up from scratch in home assistant then.
Can anybody recommend a working script for this? I have found a few very old ones and one that's fairly recent, but the ones I found that let me set subscribe and publish topics didn't accept username and passwort for the mqtt broker and the ones that did used a different messaging structure.
Thanks for the help!
-
I have no experience with Home Assistant, but in Domoticz I can just switch my gateways from one protocol to another. Maybe Home Assistant can do something similar?
-
I haven't tested it, but this one seems to fit what you need
https://github.com/mycontroller-org/serial2mqtt/blob/master/README.adoc
-
@electrik perfect, thank you both!
-
You're welcome. Can you let us know how that program worked?
-
You could also use node-red for this (and many other useful things)
-
@Gerard-van-Seventer said in script to convert serial to mqtt?:
You could also use node-red for this
I've tried this in the past, but couldn't get it to work completely. It worked only one way, as for both send and receive a serial port node was needed, and only one of them could have access to the serial port at a time.
-
@electrik
I haven't tried the script since using a serial gateway as is in home assistant was problem free and from what I have seen I can seamlessly switch to an mqtt broker in the future.
-
I am using appdaemon for my automation and I wouldn't want to install node red just for the conversion. Or are there automations that node red can that appdaemon can't?