mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-05-02 09:17:35 +00:00

* ✅ Various markdown, spelling, and grammar fixes * ✅ Various markdown, spelling, and grammar fixes * ✅ Various markdown, spelling, and grammar fixes
1.4 KiB
1.4 KiB
layout | title | description | date | sidebar | comments | sharing | footer |
---|---|---|---|---|---|---|---|
page | Multiple Instances | Quick primer on how multiple instances work together. | 2016-04-16 14:24 -07:00 | true | false | true | true |
{% linkable_title This has been deprecated and is no longer supported. %}
Home Assistant supports running multiple synchronized instances using a master-slave model. Whenever events.fire
or states.set
is called on the slave it will forward it to the master. The master will replicate all events and changed states to its slaves.
Overview of the Home Assistant architecture for multiple devices.
A slave instance can be started with the following code and has the same support for components as a master instance.
import homeassistant.remote as remote
import homeassistant.bootstrap as bootstrap
# Location of the Master API: host, password, port.
# Password and port are optional.
remote_api = remote.API("127.0.0.1", "password", 8124)
# Initialize slave
hass = remote.HomeAssistant(remote_api)
# To add an interface to the slave on localhost:8123
bootstrap.setup_component(hass, 'frontend')
hass.start()
hass.block_till_stopped()
Because each slave maintains its own Service Registry it is possible to have multiple slaves respond to one service call.