Hey,
I would like to share how I managed to control the Govee Lights in a docker bridged network, with the regular “Govee Local” Integration.
The challenge:
Govee uses UDP multicast, which needs to be correctly routed to our networked container.
The solution for Multicast:
Step 1: Relay the multicast messages
I added this multicast relay to make sure the multicast protocol survives network boundaries.
Here:
- The enp2s0f0 is the interface of my host machine
- the other device (br-fab25dbbd9b8) is derived from the network-id as inspected with
docker network list. - 1.1.1.1 is a hard-coded trigger to enable source ip spoofing (required so that the light strip talks back to the right machine).
- rest of the values can stay like they are.
govee-multicast-relay:
image: frits/udp-broadcast-relay-redux:v2
restart: unless-stopped
# Host network = same L2 as your WiFi/IoT devices
network_mode: host
command: >
--id 8
-d
-s 1.1.1.1
--dev enp2s0f0
--dev br-fab25dbbd9b8
--port 4001
--multicast 239.255.255.250
Once this container starts up nicely you can remove the -d flag to disable debug output.
Step 2:
Your home assistant container needs to be able to communicate UDP unicast with the govee devices:
ports:
- 8123:8123 # you might skip this if you only access HA through a reverse proxy
- 4002:4002/udp # govee led strip
Now we are able to add the Govee Local integration to control colorful LED strips.