This is probably a stupid questions but how do I get two Home Assistant instances to talk to each other? I have my main instance as a VM, which works great. I want to add another on a Pi for my z-wave “hub” if you will. I need the main instance to receive states from the z-wave instance, and also be able to send commands to the z-wave instance to control things.
I’ve read a bit about MQTT but still don’t really know what it is, how it works, or even if that’s what I want. It also seems like you need some type of cloud broker which I absolutely don’t want. All control needs to stay local. I also found this but it says it’s depreciated: https://home-assistant.io/developers/multiple_instances/
Is this even possible? And if so how does one go about setting it up?
MQTT is the way I do it. I have a Hass.io instance in my bedroom controlling all other devices, and I installed Home Assistant on my Retropie unit so I can execute custom python code for Switchmate devices. I communicate via MQTT (where the Brokeris the Hass.io add on) and the Retropie connects to it.
It was daunting at first for me but if you take time to understand it, it’s super simple and straightforward.
Heh, daunting is an understatement, I still don’t understand even where to start. Do you have a guide of some sort that you used? I mean, I see that you can turn on an embeded instance with:
mqtt:
But then what? Do I do that on both? How do they talk? Do I have to setup something on both for a two-way communication? I’m totally lost as to what I’m supposed to do with it.
@Tinkerer - So that appears to be one way, as in pushing state changes from the z-wave instance to the main instance. But how do I push the other way? I need to be able to control the z-wave devices on that instance from the main instance.
Furthermore, I’m still unclear what to do with MQTT other than turn on the embedded instance. Nor what needs done on both sides.
You have to configure one MQTT server (either side, doesn’t matter) and configure both Home Assistant systems to use it for MQTT statestream. As long as you ensure that entity names are unique across systems you’ll have no problems.
If you can’t ensure that, you’ll need to use MQTT eventstream.
there are 2 ways you can “communicate” between 2 instances from hass.
let both instances communicate with 1 hub or file or mqtt server.
see that as 2 people updating 1 document online. both can look at it through a browser, change things, add things, and both see what the other does.
use api from 1 hass instance to update the other. for some devices it is inpossible to connect to them with several hass instances. then you can create a sensor, switch or something in 1 hass instance that reads the value from the other instance and updates the other instance.
I have the below configuration on the HASSIo (on a PI3) instance that has the (zwave stick) value to pass to the other HASSIO (on a NUC)
On the other instance how would I do this?