Is it just me or does it appear that support for multiple instances is lacking? The docs are severely lacking in detail and the few references I can find online do not seem to work.
I have 2 instances of HA (0.39.2) running on separate RPi3s. The slave instance will run fine when started via systemctl, but doesn’t work when configured according to the docs. The closest I have gotten is when configuring with the info found here… https://michaelkuty.com/howto/hass-slaves/
When I start the slave instance using the code from that post, the instance will stay running and the following is output to the logs…
Slave IP ends in 181 and 180 is the master instance.
However, I am unable to get the frontend component working on the slave instance (for monitoring) and none of the events are being passed to my master instance.
Are there any better resources for getting a slave instance running on the current version of HA?
I struggled with this for a few days too. I got really close by playing with the REST API directly, but ended up just taking the advice from Reddit and using MQTT event forwarding to do multiple instances. It’s been working pretty well.
Do you have a link to an example of how you setup the event forwarding? My use case requires 2 slave instances to send events to a master instance. If you are using eventstream then it is limited to just one slave… right?
I just used the example listed in the MQTT_Eventstream. Theoretically (at least to me) you should be able to set up multiple slaves on the same publish topic, then have them all listen for the master. the slaves won’t talk to each other, but the master should republish events it receives from the slaves.
The docs aren’t very detailed. Do you know if it supports specifying a sub topic for the slaves to publish like slaves/slave1? Then simply subscribe to parent topic slaves on the master instance?
On your configuration how do the events show up for use in rules?
I believe I have found a possible solution to running multiple slaves when using mqtt_eventstream. I will post my config once I have confirmed it works as expected.
You can check out my config here. There is a branch for the master controller and one for each of my 2 door controllers. You can see in the main config file how I subscribe to the multiple slave instances and how each slave publishes to the master instance using MQTT Eventstream.
The biggest issue I’m still trying to figure out is state persistence in the GUI. HA doesn’t know the state of the remote sensors until a message is published, but after some time, it seems to forget the state for some reason. The slave sensors just disappear from the master instance interface, but haven’t figured out why. This would likely cause the remote sensor value to be unusable as a rule condition on the master instance, but I haven’t verified. I’m only responding to state changes from the slave instances, so current state being available doesn’t really impact my use case. If the sensors updated on a regular interval, this would likely not be an issue either.
I have been struggling with the same issue. I am thinking of setting up the slave with eventstream and then put the wanted sensors / switches in the master config manually using MQTT switch / MQTT sensor. This should prevent them from disappearing. I will use a MQTT client to view the messages and topics from eventstream so i can config the master properly.
I thought about doing the same. If it does work, I hate that it requires duplication of config between the instances. Please let me know if you have success with it.
The problem I have is eventstream puts the mqtt in a json while the MQTT switch / sensor don’t use json I don’t think. Another idea is to leave eventstream as is and mimic the mqtt messages that occur on slave restart at a certain interval to keep the mqtt eventstream sensors / switches alive.