Master HA instance with multiple slaves

Good day Community. I have done a lot of research about integrating multiple devices/sensors/etc from “slave” HA instances into a “master” instance and the prevailing wisdom is to use MQTT.

However MQTT (Either statestream or eventstream) requires you to setup each and every device manually on the master.
That is where MQTT breaks down for me. I have over 3k nodes (sensors, switches, etc) in my home. I had 4 VERA units (one for each floor and a master unit) configured in master/slave ZWAVE configuration and it worked. VERA started to show it’s age though and some of the devices I have integrate with HA but not VERA and so I wanted to shift over to HA. HA Vera integration only works with ONE vera device, so using the VERA zwave and then integrating that does not scale either.

I have a raspberry pi on each floor (3 story house) with the AEOTEC zwave controller. And then I have an Intel NUC dedicated to run Hass.io. Because I have more than 1, the USB over IP solution does not work (since HA only supports one zwave device) and using repeaters added a ton of latency, plus a single zwave network is limited to 250ish nodes and I have more than that total, but not more than that on any single floor. I am also using a smattering of zigbee devices but that is out of scope for my needs.

Having over 3000 node ids, it is irrational to expect a person to manually configure EVERY SINGLE ONE into the HA master instance. Currently I am using an IIS server that uses frames to display each device as a “floor” but that is not elegant at all and does not work with the remote access feature Nabu Casa offers that I am paying for (Totally worth it btw) My master HA instance is also where I want to collect all my event hub data (azure ML project and power BI dashboards) and also where I run my influxdb and grafana db.

Is there really no way to have a “single pane of glass” with HA? Having the multiple HA instances also means no good alexa/google integration with Nabu Casa.

Please know that I have a lot of knowledge about building automation as that is my day job, but MQTT was a new skill set for me and i have already spent 7 days trying to learn it and make it work with no success (in a way that doesn’t require me to manually add every single device into the master HA node) I have found threads with automation code, but those failed for me also(spent a day on that) For a product with such a grand development community, this seems a reasonable request!
I tried https://github.com/lukas-hetzenecker/home-assistant-remote/blob/master/README.md but that module is not in 90.1
I tried following https://github.com/home-assistant/home-assistant/pull/13876 and would love a guide on how to add custom componets to Hass.io - it seems the path of highest chance of success to me.

happy to supply frosty beverages (or coffee) to anyone that has a solution (that does not require me to spend another 7 days learning some random skill set :slight_smile: )

Out of a selfish request, it seems ironic we have integrations in hass.io for products I have never heard of or are popular in EU, but a simple integration to use web.sockets to provide a single view into a large HA deployment (or even just a master/slave deployment) isnt there :smile:

Was it this one?
Automating the sharing of sensors and switches between HA’s using MQTT Discovery and Statestream

The author developed an automation that makes the entities auto-discoverable via MQTT Discovery.

Frankly, knowing Home Assistant is more of “random skill set” than knowing MQTT. However, if you don’t want to use MQTT to connect the systems, then you don’t have any easier options left.

Spent the day working on making https://github.com/home-assistant/home-assistant/pull/13876 work - And it works like a charm! I didn’t realize I just had to make it a custom component. Thank you so much!

@mf_social if you are around, I owe you lots of coffee for this great component. Ping me if you like! :slight_smile:

@123 Thank you for your reply! I did not mean to imply knowing MQTT was a random skill set, more specifically how HA and MQTT interact was where my confusion kept cropping up.
It was that automating thread that I tried to use, but the automation sytanx in the new lovelace setup is slightly different and I just did not want to spend lots of time on it.

@mf_social’s solution worked like a charm! Only took me 30 minutes. Wish I found it sooner :wink:

Not entirely sure what I’ve done here, are you sure you’re crediting the correct person? :slight_smile:

Glad to hear you got it working.

The PR you linked was by @lukas-hetzenecker for a custom component that was never integrated into Home Assistant’s main code-base. I assume you mean you figured out how to adapt the custom component to work with 0.90.1 (probably a matter of adjusting the directory structure due to the Great Migration project and, possibly, how it handles authentication).

It would be useful to the community if you shared the results of your integration project using Lukas Hetzenecker’s custom component. Synchronizing 3000 nodes over multiple systems is far more complex than the average user’s configuration and is an excellent test-case for ‘stress testing’ the custom component! I imagine Lukas would love to hear how it performs.

Take the win. :wink:

Wow! More than 250 zwave devices? And you have some zigbee devices on top of that? Probably some WIFI I imagine too? I would struggle to hit that if I zwaved every single thing I could possible think of in my house! What kinds of devices are you using? How do you squeeze all that into your frontend?

Ha, I’d much rather make sure the person who deserves the credit gets it :slight_smile:

1 Like

Could you share how you make it work? I was using this until it stop working a long time ago.

So my home is 5,000 sq ft. Basement, main floor and upstairs. I have a casita for the inlaws (just a small 500 sq ft. loft style home) and believe it or not I don’t use any wifi devices. My wifi and networking adventure is a blog unto itself.
So all my light switches, dimmers and appliances are on zwave plugs. I use zooz zwave power strips (the new model has power monitoring) and I also have two Sonnen Smart Batteries that have various zwave sensors. I have 3x zwave power consumption meters, my pool automation is all zigbee, I have occupancy sensors in each room (Aeotec 6 in 1) as well as zwave sensors for water, etc. I mostly use Aeotec devices and zooz devices and GE switches. some of my wall outlets are zwave also. I find that using appliance plugs for microwave, dishwasher, washing machine is good, and then i use the heavy duty 40 amp switches for my AC units, oven, dryer, water heater, etc. When you get zwave stuff cheap from work, it is easy to go crazy :slight_smile: but again, no wifi - my wifi networks are cluttered as is. I organize my display via floor, then room. And I have a personalized summary view (made in appdeamon ) for what matters most to each person. The wife likes to know if the alarm is set, if any windows are open, her eta to work and if the wash/dryer/diswasher are done. I like to see power data so i made a dashboard showing my various power consumption metrics from various devices. The Sonnen Smart Batteries i got a few years ago are what started me down this addicting home automation adventure.

@oriolism all i did was create a folder called “custom_componets” and put the remote_homeassistant.py file in there. I set the linux permissions to allow executing the script via ssh (I use chmod 777 just because I did not want to troubleshoot permissions).

THan I enabled legacy api authentication on the slave devices per here: https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password

Then i added this to my configuration.yaml

remote_homeassistant:
  instances:
  - host: 192.168.1.219
    port: 8123
    api_password: !secret http_password
    entity_prefix: "rpi1_"
    subscribe_events:
    - zwave.network_ready
    - zwave.node_event

Rebooted the slave first, then the master, and everything magically appeared :slight_smile:

1 Like

Thanks! I’ll try that later.

Thank you for the detailed reply! Those Sonnen batteries do look very cool. You definitely dove in with both feet - sounds like quite the setup!

Be careful with:

api_password:

http.api_password - Deprecated - Users who are still using api_password for authentication will need to move its configuration under auth_providers. Please see the updated documentation for further details. Those who don’t make this change will see an INFO level reminder in the Home Assistant logs until the fix is made for a time, but please note, api_password authentication will eventually be removed completely and we advise users to change to use one of the other authentication methods. If you manually specify auth providers in your configuration.yaml , you will need to migrate your API Password from the http section to the auth provider section to continue using it.

1 Like

Yep. Writing is on the wall for this custom component unless Lukas, or someone else, revises it in the near future.

Thanks for the heads up about the API password. I just decided to use trusted networks instead. /32 works for a single trusted ip.

Okay, adding support for access_token was an easy fix - that’s also possible now :slight_smile:

And thanks again for the feedback, it’s really appreciated. I’m happy to see the component still used (besides in my own installation of course).

3 Likes

The access_token you are referring is it a “Long-Lived Access Token” issued inside the profile page of HA?
I tried to set it up with these settings:

remote_homeassistant:
  instances:
  - host: 10.0.0.202
    port: 8124
    secure: true
    access_token: !secret ha_remote_access_token
    # api_password: !secret ha_remote_api_password
    entity_prefix: "slave_local_"

But, im getting “could not connect” errors.

Could not connect to ws://10.0.0.202:8124/api/websocket, retry in 10 seconds...

I tried both with secure true and false.
I also enabled websocket_api: on slave (don’t know if that’s relevant)
Any ideas?

1 Like

8124 is not the default Port for home assistant. Try changing the port to 8123 which is the default for home assistant.

My master instance works on 8123, so i set up the slave at 8124 (for now, that i have them inside the same network in order to configure duckdns things)
I access it via ip:8124 am i not supposed to use the same for the remote component?

I tried with 8123 just in case, still getting the same error.