Hey everyone, I wanted to share my journey of setting up Zigbee devices across two Home Assistant (HA) instances using just one coordinator. This was a bit of a puzzle, but I think I figured it out, and I hope this helps others who might be facing similar challenges!
Background
I started with a simple setup: three Zigbee devices (a motion sensor, illuminance sensor, and lightbulb), a Conbee II stick as the coordinator, and HA running on a Raspberry Pi. Everything worked smoothly with the ZHA integration, but then I migrated to Zigbee2MQTT to dive deeper into the network. This allowed me to understand the flow better: zigbee devices communicate with the coordinator, which then sends data through Zigbee2MQTT to an MQTT broker, and finally to HA.
Objective
I wanted to test my automations on a development HA instance running in a virtual machine on the same LAN without buying another coordinator. This was tricky because I wasn’t sure how to connect the USB coordinator to the virtual machine. Plus, I didn’t want to deal with port conflicts or other MQTT broker issues.
First Attempt - Not So Great
My initial idea was to bridge the two MQTT brokers (B1 and B2) so messages from my devices would be sent to B2 from B1. I followed some excellent tutorials and managed to get the bridge connected, but nothing showed up in the target MQTT client on the dev HA. After a lot of debugging, I realized the issue might be with the broker names and ports. I tried changing them, but it didn’t solve the problem, so I decided to try a different approach.
Second Attempt - Success!
Instead of bridging, I connected the development MQTT client (C2) directly to the production broker (B1). This meant I didn’t need a separate development broker. I reconfigured the MQTT integration on the dev HA with B1’s IP address, username, and password. After a few restarts and some tweaking, it worked! The dev HA discovered all the zigbee devices published by Zigbee2MQTT.
Here’s the flow that worked:
- Zigbee devices send data to the coordinator.
- The coordinator passes the data to Zigbee2MQTT.
- Zigbee2MQTT sends the data to the MQTT broker (B1).
- The production HA (HA1) and development HA (HA2) both connect to B1 and receive the data.
Key Takeaways
- Directly connecting the development client to the production broker was simpler than bridging.
- Using the IP address instead of the broker name worked better in my setup.
- Restarting services and checking logs were crucial for troubleshooting.
If anyone has questions or tips, I’d love to hear them! This was a great learning experience, and I’m excited to continue exploring HA and Zigbee integration.