Master HA instance with multiple slaves

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?

Will try to repicate your steps exactly, see what happens in my case.
BTW, Do you have duckdns add-on installed on both machines?
Do you have websocket_api: in your configuration.yaml?

edit:
I was able to connect by disabling all the duckdns related stuff (addon and code in conf)
Will try from remote locations with all that stuff enabled and see again.

Hi, thanks for sharing this wonderful feature. That’s exactly what I was looking for. However, I insert the .py file in custom components but it doesn’t work. It must be completed? and I also compiled in the Master machine config.yaml file with
remote_homeassistant:
instances:

  • host: 192.168.178.61
    port: 8123
    api_password: *********

but it doesn’t work. It must be completed?
You could explain the procedure better. I’m new to HA

Good day
Happy to help but I am not sure what bits are missing so I will walk through the setup again.
Under the HomeAssistant folder on the “Master” I created the custom_components directory (just like what is required for any custom cards and such)
I added the file from github called remote_homeassistant.py

In my configuration.yaml I have the following code - the key is to make sure are subscribing to the events or else nothing will be sent back to the master.

remote_homeassistant:
  instances:
  - host: 192.168.1.219
    port: 8123
    access_token: !secret access_token
    #entity_prefix: "rpi1_"
    subscribe_events:
    - state_changed
    - service_registered
    - zwave.network_ready
    - zwave.node_event
  - host: 192.168.2.219
    port: 8123
    access_token: !secret access_token2
    #entity_prefix: "rpi1_"
    subscribe_events:
    - state_changed
    - service_registered
    - zwave.network_ready
    - zwave.node_event

Hope that helps!

2 Likes

Hi, thanks for your reply. Now it work, but, I can only get it to work if I disable ssl certificates for https access with duckdns. Also I can only log in with api_password, with access_token it’s not possible. I am currently running the 0.85.0 versions on both servers.

I believe Access Tokens are newer. If you want to use access tokens, consider upgrading to a newer release. Good luck!

Hi, congratulations on your work. It is truly exceptional. One problem, my HA server and my slave are configured in https with duckdns but it doesn’t work. To make it work I have to deactivate the ssl certificates. Is it possible to solve this problem?

Are both servers in the same LAN?
My experience was that in order to set them up inside the same lan i had to disable the duckdns/https related stuff.
Probably because my router does not support NAT loopback or because of the conflicts on the ssl certificates and the different local ip address.

When i moved my second server to another location and set up duckdns there, everything worked fine.

You are in the same lan. however when I disable https I can connect in the same LAN also with myduckdns.org:8123
However tomorrow I will try from another lan.
Thank’s!

Works in an another lan?

Anybody try this between docker containers? I’m trying to get this working (after bashing my head into the desk many many times with MQTT lights) and i keep getting a websocket error. I’m putting this in the config for the instance running zwave:

remote_homeassistant:
  instances:
  - host: homeassistant_beta (which is the name of the container, can't use ip address)
    port: 5316
    access_token: "XXXXXXX"
    entity_prefix: "zwave_"

Instance does not have ssl set up or anything.

Just a thought but did you specify the Home Assistant container should use network_mode: host (all ports are automatically mapped one to one)? If you’re not using this mode then you need to explicitly indicate the mapping for port 5316.

The container is set to use port 5316. I can run curl homeassistant_beta:5316 and get a bunch of text back so it appears to be working/able to connect.

Edit: I have reduced my http: config to the bare minimum i can think of:

http:
  server_port: !secret hass_port
  base_url: homeassistant_beta

Any idea on why i get “Integration not found: remote_homeassistant”. I have put remote_homeassistant in custom compontents folder.

You mean custom_components? Just check your spelling.

Somehow it just started working. Entities was picked up from secondary instance. My entities is not updating states on my main HA however.

how should I set up “subscribe_events”? I want to subscribe to states changes for my device trackers.