• Stars
    star
    884
  • Rank 51,281 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Links multiple home-assistant instances together

License

hacs Project Maintenance

App icon

Remote Home-Assistant

Component to link multiple Home-Assistant instances together.

This component will set up the following platforms.

Platform Description
remote_homeassistant Link multiple Home-Assistant instances together .

The main instance connects to the Websocket APIs of the remote instances (already enabled out of box), the connection options are specified via the host, port, and secure configuration parameters. If the remote instance requires an access token to connect (created on the Profile page), it can be set via the access_token parameter. To ignore SSL warnings in secure mode, set the verify_ssl parameter to false.

After the connection is completed, the remote states get populated into the master instance. The entity ids can optionally be prefixed via the entity_prefix parameter.

The component keeps track which objects originate from which instance. Whenever a service is called on an object, the call gets forwarded to the particular remote instance.

When the connection to the remote instance is lost, all previously published states are removed again from the local state registry.

A possible use case for this is to be able to use different Z-Wave networks, on different Z-Wave sticks (with the second one possible running on another computer in a different location).

Installation

This component must be installed on both the main and remote instance of Home Assistant

If you use HACS:

  1. Click install.

Otherwise:

  1. To use this plugin, copy the remote_homeassistant folder into your custom_components folder.

Remote instance

On the remote instance you also need to add this to configuration.yaml:

remote_homeassistant:
  instances:

This is not needed on the main instance.

Configuration (main instance)

Web (Config flow)

  1. Add a new Remote Home-Assistant integration

  1. Specify the connection details to the remote instance

You can generate an access token in the by logging into your remote instance, clicking on your user profile icon, and then selecting "Create Token" under "Long-Lived Access Tokens".

Check "Secure" if you want to connect via a secure (https/wss) connection

  1. After the instance is added, you can configure additional Options by clicking the "Options" button.

  1. You can configure an optional prefix that gets prepended to all remote entities (if unsure, leave this blank).

Click "Submit" to proceed to the next step.

  1. You can also define filters, that include/exclude specified entities or domains from the remote instance.


or via..

YAML

To integrate remote_homeassistant into Home Assistant, add the following section to your configuration.yaml file:

Simple example:

# Example configuration.yaml entry
remote_homeassistant:
  instances:
  - host: raspberrypi.local

Full example:

# Example configuration.yaml entry
remote_homeassistant:
  instances:
  - host: localhost
    port: 8124
  - host: localhost
    port: 8125
    secure: true
    verify_ssl: false
    access_token: !secret access_token
    entity_prefix: "instance02_"
    include:
      domains:
      - sensor
      - switch
      - group
      entities:
      - zwave.controller
      - zwave.desk_light
    exclude:
      domains:
      - persistent_notification
      entities:
      - group.all_switches
    filter:
    - entity_id: sensor.faulty_pc_energy
      above: 100
    - unit_of_measurement: W
      below: 0
      above: 1000
    - entity_id: sensor.faulty_*_power
      unit_of_measurement: W
      below: 500
    subscribe_events:
    - state_changed
    - service_registered
    - zwave.network_ready
    - zwave.node_event
    load_components:
    - zwave
host:
  host: Hostname or IP address of remote instance.
  required: true
  type: string
port:
  description: Port of remote instance.
  required: false
  type: int
secure:
  description: Use TLS (wss://) to connect to the remote instance.
  required: false
  type: bool
verify_ssl:
  description: Enables / disables verification of the SSL certificate of the remote instance.
  required: false
  type: bool
  default: true
access_token:
  description: Access token of the remote instance, if set.
  required: false
  type: string
entity_prefix:
  description: Prefix for all entities of the remote instance.
  required: false
  type: string
include:
  description: Configures what should be included from the remote instance. Values set by the exclude lists will take precedence.
  required: false
  default: include everything
  type: mapping of
    entities:
      description: The list of entity ids to be included from the remote instance
      type: list
    domains:
      description: The list of domains to be included from the remote instance
      type: list
exclude:
  description: Configures what should be excluded from the remote instance
  required: false
  default: exclude nothing
  type: mapping of
    entities:
      description: The list of entity ids to be excluded from the remote instance
      type: list
    domains:
      description: The list of domains to be excluded from the remote instance
      type: list
filter:
  description: Filters out states above or below a certain threshold, e.g. outliers reported by faulty sensors
  required: false
  type: list of
    entity_id:
      description: which entities the filter should match, supports wildcards
      required: false
      type: string
    unit_of_measurement
      description: which units of measurement the filter should match
      required: false
      type: string
    above:
      description: states above this threshold will be ignored
      required: false
      type: float
    below:
      description: states below this threshold will be ignored
      required: false
      type: float
subscribe_events:
  description: Further list of events, which should be forwarded from the remote instance. If you override this, you probably will want to add state_changed!!
  required: false
  type: list
  default: 
  - state_changed
  - service_registered
load_components:
  description: Load components of specified domains only present on the remote instance, e.g. to register services that would otherwise not be available.
  required: false
  type: list
service_prefix: garage_
  description: Prefix used for proxy services. Must be unique for all instances.
  required: false
  type: str
  default: remote_
services:
  description: Name of services to set up proxy services for.
  required: false
  type: list

Special notes

Missing Components

If you have remote domains (e.g. switch), that are not loaded on the main instance you need to list them under load_components, otherwise you'll get a Call service failed error.

E.g. on the master:

remote_homeassistant:
  instances:
  - host: 10.0.0.2
    load_components:
    - zwave

to enable all zwave services. This can also be configured via options under Configuration->Integrations.

Proxy Services

Some components do not use entities to handle service calls, but handle the service calls themselves. One such example is hdmi_cec. This becomes a problem as it is not possible to forward the service calls properly. To work around this limitation, it's possible to set up a proxy service.

A proxy service is registered like a new service on the master instance, but it mirrors a service on the remote instance. When the proxy service is called on the master, the mirrored service is called on the remote instance. Any error is propagated back to the master. To distinguish proxy services from regular services, a service prefix must be provided.

Example: If a proxy service is set up for hdmi_cec.volume with service prefix remote_, a new service called hdmi_cec.remote_volume will be registered on the master instance. When called, the actual call will be forwarded to hdmi_cec.volume on the remote instance. The YAML config would look like this:

remote_homeassistant:
  instances:
  - host: 10.0.0.
    service_prefix: remote_
    services:
      - hdmi_cec.volume

This can also be set up via Options for the integration under Configuration -> Integrations.


See also the discussion on home-assistant/core#13876 and home-assistant/architecture#246 for this component

More Repositories

1

ble_monitor

BLE monitor for passive BLE sensors
Python
1,875
star
2

pyscript

Pyscript adds rich Python scripting to HASS
Python
851
star
3

nordpool

This component allows you to pull in the energy prices into Home-Assistant.
Python
443
star
4

custom_updater

[DEPRECATED]πŸ“¦ A component which allows you to track and update custom cards/components and python_scripts
Python
166
star
5

grocy

Custom Grocy integration for Home Assistant
Python
156
star
6

feedparser

πŸ“° RSS Feed Integration
Python
134
star
7

sensor.unifigateway

High level health status of UniFi Security Gateway devices via UniFi Controller
Python
127
star
8

weatheralerts

A sensor that gives you weather alerts from alerts.weather.gov.
Python
125
star
9

climate.programmable_thermostat

Programmable thermostat that let you have a smart thermostat on budget.
Python
113
star
10

places

Component to integrate with OpenStreetMap Reverse Geocode (places)
Python
110
star
11

media_player.braviatv_psk

Sony Bravia TV (Pre-Shared Key) component for Home Assistant
Python
106
star
12

sensor.rpi_power

A Custom component for Home-Assistant that checks if your Raspberry Pi power supply is giving enough voltage from the kernel.
Python
103
star
13

sensor.airthings_wave

hassio support for Airthings Wave BLE environmental radon sensor.
Python
100
star
14

sensor.plex_recently_added

▢️ Plex component to feed Upcoming Media Card.
Python
82
star
15

authenticated

A platform which allows you to get information about sucessfull logins to Home Assistant.
Python
82
star
16

breaking_changes

Component to show potential breaking_changes in the current published version based on your loaded components
Python
81
star
17

zaptec

zaptec charger custom component for home assistant
Python
63
star
18

sensor.trakt

πŸ“Ί Trakt Integration for Upcoming Media Card
Python
60
star
19

sensor.radarr_upcoming_media

🎬 Radarr component to feed Upcoming Media Card.
Python
57
star
20

youtube

A platform which give you info about the newest video on a channel
Python
55
star
21

sensor.sonarr_upcoming_media

πŸ“Ί Sonarr component to feed Upcoming Media Card.
Python
53
star
22

healthchecksio

Update and display the status of your healthchecks.io checks.
Python
51
star
23

sensor.avanza_stock

Custom component to get stock data from Avanza for Home Assistant
Python
46
star
24

sensor.ssh

SSH Generic Sensor
Python
43
star
25

sensor.untappd

🍻 Untappd Integration
Python
36
star
26

readme

Use Jinja and data from Home Assistant to generate your README.md file
Python
33
star
27

information

πŸ“œ Information about this organization
31
star
28

sensor.stadtreinigung_hamburg

Stadtreinigung Hamburg - get garbage collection dates in Hamburg - custom component for Home Assistant
Python
25
star
29

sensor.yandex_maps

A platform which give you the time it will take to drive.
Python
25
star
30

combined

A camera platform that give you a combined feed of your defined camera entities.
Python
24
star
31

wienerlinien

A sensor that give you information about next departure from spesified stop.
Python
21
star
32

templatesensor

Add template sensors from the UI.
Python
19
star
33

uilogs

DEPRECATED: Custom panel that show colorful logs for Home Assistant (core), and the supervisor (if you have it).
TypeScript
18
star
34

sensor.nintendo_wishlist

A sensor that monitors a Nintendo Switch wish list for when games are on sale.
Python
17
star
35

sensor.personalcapital

πŸ’΅ Personal Capital Integration for Bank Account Monitoring
Python
15
star
36

switch.hadockermon

A switch platform that interact with ha-dockermon.
Python
14
star
37

unsplash

A camera platform that give you random images from Unsplash presented as a camera feed.
Python
13
star
38

gpodder

🎧 gPodder Integration for Podcast Feed Monitoring
Python
13
star
39

sensor.owlintuition

A set of sensors to integrate the OWL Intuition devices network
Python
11
star
40

sensor.file_restore

Improved file sensor component that let you read the whole last line content.
Python
11
star
41

usps_mail

A component that give you to info about incoming letters and packages from USPS.
Python
9
star
42

sensor.custom_aftership

A component which allows you to get information about pending parcels.
Python
8
star
43

sensor.tautulli

A platform which allows you to get information from Tautulli.
Python
8
star
44

sensor.avfallsor

Simple sensor for avfallsor
Python
8
star
45

brewdog

🍻 Display information about random beers from Brewdog as a sensor in Home Assistant, you can use this in a push notification next time you visit a bar.
Python
7
star
46

sensor.kodi_recently_added

Kodi component to feed the Upcoming Media Card for Home Assistant.
Python
7
star
47

config_check

Run the CLI config_check from a service call.
Python
7
star
48

ups

The ups platform allows one to track deliveries by the UPS
Python
6
star
49

fedex

The fedex platform allows one to track deliveries by FedEx
Python
5
star
50

sensor.launchlibrary

Get info about next space launches
Python
4
star
51

climate.e_thermostaat

E-Thermostaat (ICY) component for Home Assistant
Python
3
star
52

custom_components

[archived] Use this instead: https://github.com/custom-components/custom_updater
Python
3
star
53

camera.multisource

A camera platform that generate a camera feed from multiple sources.
Python
2
star
54

srp_energy

The srp_energy integration shows information from Srp hourly energy usage report for their customers
Python
2
star
55

hassbian_config

A custom component which allows you to controll some hassbian-config functions from Home Assistant.
Python
2
star
56

sensor.ruter

A sensor platform that gives you information about next departures.
Python
2
star
57

lists

Python
2
star
58

sensor.wifi-scanner

A Wi-Fi scanner sensor
Python
2
star
59

sensor.versions

Deprecated.
Python
2
star
60

sensor.custom_cards

This sensor is no longer needed
Python
1
star
61

sytadin

The sytadin sensor platform allows you to monitor traffic details from Sytadin
Python
1
star
62

sickchill

Taps into Sickchill Api so you can perform basic commands
Python
1
star
63

complimentr

Component to integrate with complimentr.
Python
1
star
64

binary_sensor.hadockermon

A custom binary_sensor platform which allows you get sensor data from ha-dockermon.
Python
1
star