Closed bruxy70 closed 2 weeks ago
It does work (some of the time) but since UDP is an unreliable protocol it can't effectively be used to transmit events, only state. Since in your case the state only persists for half a second, there is a good chance that the receiving node will not see the change to true and it will not be re-broadcast since the sensor goes back to false almost immediately.
Your work-around using a switch toggle is a good solution, as this captures a longer-lasting state, and you can use a state change in the receiver to recognise that a pulse occurred. You could also use a Pulse Counter Sensor which will increment its value when a pulse is seen. This also effectively converts events to a state which can be relatively reliably transmitted by UDP.
The problem
I have a binary sensor for a gpio input connected to Hoermann RF receiver. When the button is pressed, the receiver will close the relay (and therefore the gpio binary_sensor) for 0.5s (and then open it again). When I configure this binary sensor as UDP transmitter, it will not send the signal. As a workaround, I configure an on_press automation to toggle a relay, and have a template binary sensor to return the relay state. And then use this as UDP transmitter and it works fine (as the binary sensor state will toggle on each 0.5s impulse and stay there).
Which version of ESPHome has the issue?
2024.9.0
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2024.9.2
What platform are you using?
ESP8266
Board
sonoff basic + Hoermann RF receiver
Component causing the issue
UDP
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response