Master/slave with mqtt_eventstream retain all published devices

Hello, i have a master/slave setup with mqtt_eventstream, with mosquitto as broker (ubuntu default)
The following HA configurations:

Slave HA:

mqtt:
  broker: 192.168.111.117
  client_id: home-assistant-2
mqtt_eventstream:
  publish_topic: slaves/zwave
  subscribe_topic: master/#

Master HA:

mqtt:
  broker: 192.168.111.117
  client_id: home-assistant-1
  discovery: true
mqtt_eventstream:
  subscribe_topic: slaves/#
  publish_topic: master

The problem is that the Master HA looses MQTT devices from time to time, reasons unknown. And i figure if i can force all MQTT devices that my Slave HA publishes to be retained by default the problem would be solved.

Anyone who knows how to do this?
Or any other way to fix MQTT devices to be lost in the UI?

I am setting up MQTT eventstream and I am interested in a solution to this and also determining states on restart. If you fire an event from the slave on the dev tool page, does the device appear on the master? If it is just device inactivity that cause this, can you automate the slave to fire an event every so often. We can test which event doesn’t do anything but causes the device to appear on the master. I would like an event that fires the state (without changing it) so I can automate the master to tell the slave to fire that event on restart.

Yeah, if a device is triggered anywhere it will show up on the master again, it seems like they dissapear after inactivity.

did you find a solution to this.
I recently started using eventstream again and had completely forgot about this issue (disappearing devices).

I am thinking that the mqtt “retain” flag would take care of this but the eventstream component doesn’t have configuration option for this

No i did not.

I gave up the HASS master/slave configuration.
The reason i need it is because i have a RPi with RazBerry zwave-module that i want to use as a dumb slave to my main HASS server.

I use Domoticz on my RPi slave now, set up to my MQTT-server, and my main HASS is subscribed to the MQTT-devices i need.

Its too bad its not possible, in a easy way, to set up a master/slave setup in HASS at the moment.

For what it’s worth, I’m currently facing this same issue and looking for a solution too. Entities from the slave show up in the master only if triggered (or if I restart the slave HASS instance whilst having the interface on master open). I have multiple Raspberry Pis throughout the house which I want to connect to my master Home Assistant instance.

Has anybody made any progress in the meantime?

I use this code for my mqtt_eventstream:

Master hass server:

mqtt_eventstream:
publish_topic: master/topic
subscribe_topic: slaves/#

Slave hass server:

mqtt_eventstream:
publish_topic: slaves/hass197
subscribe_topic: master/topic

I have this message on both hass server gui:
mqtt eventstream is “True” and its “initialized”

I want to have, if my master hass server is down, my slave hass server will take over for the mqtt commands and other sensors.

Greetings DK.

I hate to resurrect the dead here but I’m trying to get this setup today. I also see the same problem where when I first restart my master node it doesn’t know anything about the slaves. Once I make a state change to a device then it shows up in the master. The problem is I’m working on offloading some of the work from the pi over to a server in my house. If I move appdaemon over to the server and its not able to see that this device exists it won’t fire. Did anyone come up with a solution for the event stream? I loved how easy it was to configure and the fact that the HA nodes just talk to each other and register the entities like its nothing. Thanks.

So it turns out that if you just leave it alone for a like 10 min it will eventually pick up the state of all of the zwave devices on its own. You can speed this process up by triggering a device but it does slowly learn about everyone. Still got more work to do before I start moving things off of the pi and over the to VM for triggering but its coming.

Ok I lied they do end up vanishing again after lack of use. Sad

Hi @TheFuzz4 did you got this to work ?

I am still trying to get this fixed.

Sadly not yet. Even more sad my sdcard went RO this morning so had to scramble around the house to find a new SDcard for it. Luckily I was able to yank the snapshot off of the old card. So glad I set that up to fire off every Sat early AM. New project is to network boot the pi with foreman (this is going to take some figuring out) so I can remove the sdcard from the picture all together and just let this thing run off of a network filesystem. This is going to be interesting.

What about running Home-assistant on a cluster with backup?
Use proxmox cluster and when venv on a linux box.

Run great :slight_smile:

1 Like

Do you have a guide for how you threw that together?

Only internal, sorry.

But you can find the venv guide on home-assistant.io under installation

proxmox can you download from proxmox.com

Hi, howto only run automation on one hass instance, not both instances?

So if my sensor is motion detected at night, the light toggle, but with two hass instance, the light goes on and off.
How can i fix that?

Resurrection time again.

Has anybody solved this problem of MQTT devices disappearing? Unless I can resolve this, I can’t reliably run automations (or schedy) on the master HA instance, expecting to be able to control ZWave devices controlled by a subsidiary HA instance. And that pretty much rules out HA for me.

While I haven’t found a solution to the MQTT issue.

I am using Node-RED to do automations and scheduling between my multiple HA instances.

Thanks. I had to give up using multiple HA instances and move everything on to a single server. Its not optimal bit at least i can see all the devices.