I have a device that is spitting out UDP messages, I would like to pull these into hassio and create a sensor from the data. Is this easy and where should I start?
I am having the same problem, though no solution yet.
I think node-red can receive udp packets and react. I’m starting using it for some automation instead of yaml and it seems very promising.
Spot on! I now have my lightwaverf trv displaying on home assistant
I had the same issue with a device regularly reporting via UDP, and exploiting the existing TCP sensor I have created the following UDP sensor:
Maybe useful for your case? I’m considering to do a PR and contribute it back, even though there’s quite some duplication with the TCP sensor and it could be merged with it.
Help with tcp/udp listner
How do I use your UDP sensor? Can you give a short explanation please?
I’m trying to get data from my pellet burner and it uses an UDP protocol.
The configuration is very similar to the TCP sensor. The only required parameter is the UDP port to which to listen, e.g.:
sensor: - platform: udp port: your_port timeout: 30 name: your_favourite_name
Note that your HA must be able to bind and listen to that port. If you run it in a docker container, you have to either use the
--net=host option when creating the container or explicitly bridge the port with
Hope this helps,
Is it in a container? If so, the note above applies, otherwise I think it does not matter…
Ok. Thank you for the clarification and work!
how do you use the script ?
I get a “Unable to find component sensor.udp” when starting Home assistant on RPI
Can you make a short guide on how to load the script to make the UDP sensor work
Did you copy the script to
<your_hass_config>/custom_components/sensor/udp.py ? That’s where Home Assistant looks for any custom component, nothing specific to this one
Thx for the reply.
i now got the config of the UDP sensor working, but its not showing any data received.
Just getting these warnings in the log
Ok, that may be due to your device’s refresh interval: for example in my case I know I get an update every 60 seconds, so this is the timeout I set.
As for the warnings, this is due to the sensor being synchronous (like the TCP one) and for now I don’t have a solution.
Hope this helps
I don´t quite understand where I have to use the “–net=host” or “-p” options, since in the log I get a " Unable to bind on port"
Thanks for the component!
Which command line do you use to run your homeassistant container?
-p host_port:container_port are possible options to be given to
Well, neither do I - I run HA directly from its container and I control the way it is started, I guess Hass.io is also container-based, and if this is the case it is definitely possible to change the way it is executed. Perhaps you could ask around for more details. Sorry for not being more helpful.