Connecting instances together, recurssive hell
I have two locations and I want to be able to trigger an automation when moving between them that turns lights on/off or AC on/off depending on which direction. I've tried now to cross connect the two instances with remote_homeassistant and it eventually breaks one of the instances with tens of thousands of entities with recurssive prefixes despite setting all domains to exclude. I only want 1 script shared on both sides. Is this a supported use case or a big no-no?
My .storage/core.entity_registry went from 580 lines to 15k and some things grind to a halt. Such as voice assistant expose list. You cannot remove all of the entities using the UI. I had to edit the file to remove the entries to restore that instance.
For example:
{"config_entry_id":null,"entity_id":"cover.home_home_home_home_home_home_home_home_home_home_home_nook_shade","id":"xxxxxx","orphaned_timestamp":1719811682.3736324,"platform":"remote_homeassistant","unique_id":"xxxxxx_cover.home_home_home_home_home_home_home_home_home_home_home_nook_shade"},
{"config_entry_id":null,"entity_id":"cover.home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_nook_shade","id":"xxxxxx","orphaned_timestamp":1719811737.5438871,"platform":"remote_homeassistant","unique_id":"xxxxxx_cover.home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_nook_shade"},
{"aliases":[],"area_id":null,"categories":{},"capabilities":null,"config_entry_id":null,"device_class":null,"device_id":null,"disabled_by":null,"entity_category":null,"entity_id":"cover.home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_4453","hidden_by":null,"icon":null,"id":"xxxxxx","has_entity_name":false,"labels":[],"name":null,"options":{"cloud.alexa":{"should_expose":false}},"original_device_class":null,"original_icon":null,"original_name":null,"platform":"remote_homeassistant","supported_features":0,"translation_key":null,"unique_id":"xxxxxx_cover.home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_home_nook_shade","previous_unique_id":null,"unit_of_measurement":null},
@samuelkadolph I would use Remote HA to transfer entities you're interested in and run scripts and automations locally...
If you would like to post your Remote HA config YAML and any scripts or automations referenced in it, a solution may come.
I'm thinking this is just a flaw that no one has run into yet. Importing some entities or the script wouldn't make a difference. After digging into the code a bit I made a yaml config (was using UI before) that by default no domains or entities are included and that solved the issue for me. Working configs:
hass2
remote_homeassistant:
instances:
- host: hass1
port: 443
secure: true
verify_ssl: false
access_token: XXX
include:
domains: ["none"]
entities: ["light.does_not_exist"]
service_prefix: hass1_
services:
- script.travel_arriving
hass1
remote_homeassistant:
instances:
- host: hass2
port: 443
secure: true
verify_ssl: false
access_token: XXX
entity_prefix: hass2_
include:
domains: ["none"]
entities: ["light.does_not_exist"]
service_prefix: hass2_
services:
- script.travel_arriving
To test the recursive entity I created a counter helper because I am not using any. Using this config you end up with a very quick growing recursive entity list of counter.hass1_hass2_hass1_hass2_hass1_hass2_hass1_hass2_hass1_hass2_hass1_hass2_abc.
hass2
remote_homeassistant:
instances:
- host: hass1
port: 443
secure: true
verify_ssl: false
access_token: XXX
include:
domains: ["none", "counter"]
entities: ["light.does_not_exist"]
service_prefix: hass1_
services:
- script.travel_arriving
hass1
remote_homeassistant:
instances:
- host: hass2
port: 443
secure: true
verify_ssl: false
access_token: XXX
entity_prefix: hass2_
include:
domains: ["none", "counter"]
entities: ["light.does_not_exist"]
service_prefix: hass2_
services:
- script.travel_arriving
There either needs to be a way to detect the entity recursion and stop it, prevent cross connecting instances like this with an error, or an option to disable entity includes by default.
Also this really hoses your hass core.entitiy_registry and requires manual editing to remove the entities and borks the voice assistant UI.
Came here to say that I'm facing similar issues when adding my remote HA instance into my main server. It ends up breaking a lot of my entities and services. Some of my speaker groups become inoperable and assist satellites services stop work altogether. I tried going through and excluding everything except for the entity I want, but there's still something that's wreaking havoc.
I think one solution might be to have everything be excluded by default and have the user set up a whitelist in the initial setup. I feel like most people who are using this are only looking to bring in a couple of devices from their remote server to set up automation to monitor them on their main server.
I think the best solution would be for remote_homeassistant to not export entities that its integration created. There might be some people using it for daisy chaining instances so it could be an option. Like #347 suggests perhaps you can enable/disable integrations being exported.