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?
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Gateways
Development • 6 Feb 2024, 01:16 • OldSurferDude 6 Feb 2024, 14:22 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
MQTT GW on ESP8266 supporting SSL/TLS?
Development • 4 Jun 2024, 10:21 • bgunnarb 27 Jun 2024, 13:53 -
Serial Gateway woes
Development • 3 Feb 2024, 20:31 • OldSurferDude 3 Feb 2024, 20:31 -
Sensebender Gateway (SAMD21)
Development • 25 Dec 2021, 23:02 • pikim 3 Jan 2024, 12:12