MQTT eventstream multiple instances

Ive setup a raspberry pi with HA and use a zwave usb to connect to a dimmer switch. I wanted to connect the zwave usb directly to my server but range was an issue.
I’ve tried using the pi as a go between forwarding the device to my server instance of HA using MQTT event stream which works but the dimmer only appears briefly when its been controlled. Is there a way to get it to always display on my master installation? Or is there a better way of doing this?


Did you find the solution? Does it work for you and how?

Hello onlize,
I was frustrated with the eventstream as well, so came up with another solution for exactly that use case.
Please have a look here:

This connects directly to a remote instance via the Websocket API, replicating all remote states, and forwarding local events to the remote instance.

This allows you to either connecting to a remote server with a zwave stick; or to support two zwave sticks in the same master instance

is it possible to implement this now on

Yes, that should be fairly easy.
You just have to place the file into your custom_components directory.

ok thanks I have placed the file on both slave and master, and this code is only for the master?


  • host: 192.168.0.xx
    port: 8124
    api_password: test
    entity_prefix: “slave02_” don’t have the websockets==4.0.1 installed. Don’t know if this is something that shall be implemented into hass.

This should be installed automatically.
But it could be that it conflicts with either media_player.webostv or the spc component.

You could try to change the REQUIREMENTS line in line to:
REQUIREMENTS = ['websockets==3.2']

And actually the file would only be needed for the master instance, the websocket API is already always enabled on the slave. Nothing to configure there.

wow that did it:) So simply to setup! Now I have a own rpi for my Z-wave. Great job thanks. Will report if I find any bugs.

Im struggling with some errors. This is from the main Hass. A short time after reboot a start getting these error and the communication stops working. Do you have any idea whats happening? It looks like a overflow of message is causing it errors? I have a z-wave network with around 50 z-wave devices.

@steinis Did you find the solution? I’m getting the same thing. It works great for a couple of hours but then, it stops. On the slave side, all sensor keeps getting updated.

maybe @lukas-hetzenecker can help us.

Sorry i don’t use this function anymore. Didn’t get it stable enough.

Which function do you use? I have a HA in my Shed with bluetooth sensors and one in my home.


I use MQTT to Z-way hub right now. Maybe you can use something similar?
If its just some sensor I would try that first.

plans to update this and get it added officially (or at least now that homeassistant.remote has been deprecated)?

I have 2 HA systems at home, main that connected to almost everything (ZWave / Google Homes / Media Players / Xiaomi Gateways / BlueIris - 20 cams / Vera - too lazy too move everything to Zwave USB attached to main HA and many others),
On the secondary HA I run HA for face recognition only with dlib, it delivers the events through MQTT eventstream and works perfectly,
is there anything I can assist you to set the configuration so it will work for you?

Setup and configuration wasn’t the issue, it was that anything being pulled into the primary only did so when triggered (or it was EXTREMELY slow) so they don’t immediately show up. Other threads/reports indicate that they also may disappear if not triggered for a period of time.

Have you run into this?

It’s working for me very fast, checked it a lot, as for my usage - since the second HA is for the face recognition, I rely on that for events that it identified someone from a list and who that person is, but I did play with it before and sensors can disappear as you mentioned, my solution for that was template sensor to wrap sensors from the 2nd HA that if the state is not available I set default state.

There is another option which I didn’t investigate too much - MQTT statestream


I unfortunately didn’t have time on working to get this merged.
But I managed to make it compatible with HA >= 0.77 (was a fairly simple fix), and resolved one cause of errors.
The remote_homeassistant now lives under

It has been really stable for me the past few months and I use it productively.

is MQTT event stream stil making this kind of troubles?

@lukas-hetzenecker is it possible to store

    access_token: !secret access_token
    api_password: !secret http_password

in more secrure place than in the config file as plain text?