Bridging Switcher’s UDP over OpenWRT

1 minute read

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

  1. A router running OpenWRT, with two networks:
    1. lan that houses the trusted devices
    2. lan-jail that houses untrusted home automation gizmos
  2. A Switcher boiler controller, connected to the lan-jail network
  3. 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

  1. Install udp-broadcast-relay-redux on the OpenWRT router, either via the UI or via CLI:
    opkg update
    opkg install udp-broadcast-relay-redux
    
  2. 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

  3. Run the stages detailed in the HomeAssistant Switcher integration. Play with the port configuration in the previous step until this works
  4. After the installation succeeds, copy the udp-broadcast-relay-redux command over to System > Startup > Local Startup, which sets it as part of /etc/rc.local.
    Remove the -d (debug prints) and add -f (fork)
  5. 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