Bridging Switcher’s UDP over OpenWRT
Seems like I’m doing this setup once every 3 years, then forget about it until the next time it breaks.
I hope this is the last time I’m rediscovering this.
This only works because of the awesome udp-broadcast-relay-redux binary.
The players
- A router running OpenWRT, with two networks:
lan
that houses the trusted deviceslan-jail
that houses untrusted home automation gizmos
- A Switcher boiler controller, connected to the
lan-jail
network - A HomeAssistant instance, connected to the
lan
network
In order for the HomeAssistant Switcher integration, there are some UDP ports involved (20002/10002/20003/10003, depending on version).
Turns out that the switcher broadcasts status changes (and discovery info) in UDP broadcasts over these ports. For successful operation, those broadcasts need to be passed over from the lan-jail
network to the lan
network.
Solution
- Install
udp-broadcast-relay-redux
on the OpenWRT router, either via the UI or via CLI:opkg update opkg install udp-broadcast-relay-redux
- Manually start the following no OpenWRT for testing purposes:
udp-broadcast-relay-redux --id 1 --port 20002 --dev br-lan-jail --dev br-lan -d
Your port might vary
- Run the stages detailed in the HomeAssistant Switcher integration. Play with the port configuration in the previous step until this works
- After the installation succeeds, copy the
udp-broadcast-relay-redux
command over toSystem > Startup > Local Startup
, which sets it as part of/etc/rc.local
.
Remove the-d
(debug prints) and add-f
(fork) - Save, restart the router, ensure integration still works.
The way I test is to ensure that physical clicks on the Switcher register in the HomeAssistant, and that clicks in the HomeAssistant’s switch reflect on the physical device.
Hopefully I find this post next time my router loses its config or something