Master HA instance with multiple slaves

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:

2 Likes

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.

Can you ssh into the master and run curl to the slave is and port?

I can ssh into the master but, can you explain in more detail what you mean after that? :slight_smile:

Sure! Curl is just a command line tool to check web socket connectivity. Here is a guide with some examples. https://linuxize.com/post/curl-command-examples/#what-is-curl
Curl should already be installed. So after you ssh into the master, just Run the command curl ipaddress:port. And see what you get :slight_smile:

Using this topic with some problems. I have installed the custom component at my master HA. At the slave I entered my user profile and created a “Long-Lived Access Tokens”.

This is my config at the master HA:
remote_homeassistant:
instances:

  • host: 10.8.0.6
    port: 8123
    secure: false
    access_token: Long-Lived Access Tokens
    entity_prefix: “garage_pi_”

Looks like something is wrong with the token i created at the slave HA or how I write it in the configuration, I tired with " " or ’ ’ or nothing but the same error.
Got the following from master HA:
ERROR (MainThread) [custom_components.remote_homeassistant] Auth invalid, check your access token or API password

And this in the slave:
WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.24.103

EDIT: Something wrong with copying of API key, created new one and it worked perfect

ssh’ed into my master hass.io:

core-ssh:~# curl 10.0.0.202:8124
curl: (52) Empty reply from server

core-ssh:~# curl 10.0.0.202
curl: (7) Failed to connect to 10.0.0.202 port 80: Connection refused


Is that ok?