Updated architecture page

This commit is contained in:
Paulus Schoutsen 2014-12-26 22:28:58 -08:00
parent 919d3b5458
commit 56ca41acc6
3 changed files with 17 additions and 4 deletions

View File

@ -23,7 +23,7 @@ Before we dive into the Home Assistant architecture, it is important to get a cl
Overview of the home automation landscape. Overview of the home automation landscape.
</p> </p>
The core of Home Assistant is responsible for the Home Control part and is made up: The Home Assistant core is responsible for Home Control. It has four parts to make this possible:
* The **Event Bus** facilitates the firing and listening of events. This is the beating heart of Home Assistant. * The **Event Bus** facilitates the firing and listening of events. This is the beating heart of Home Assistant.
* The **State Machine** keeps track of the states of things. Fires a `state_changed` event when a state has been changed. * The **State Machine** keeps track of the states of things. Fires a `state_changed` event when a state has been changed.
@ -34,7 +34,7 @@ The core of Home Assistant is responsible for the Home Control part and is made
<a href='{{ root_url }}/images/architecture/ha_architecture.png'> <a href='{{ root_url }}/images/architecture/ha_architecture.png'>
<img src='{{ root_url }}/images/architecture/ha_architecture.png' /> <img src='{{ root_url }}/images/architecture/ha_architecture.png' />
</a> </a>
Overview of the Home Assistant architecture Overview of the Home Assistant core architecture
</p> </p>
Home Assistant can be extended by **components**. Each component is responsible for a specific domain within Home Assistant. Components can listen for- or trigger events, offer services and maintain states. Components are written in Python and can do all the goodness that Python has to offer. Out of the box, Home Assistant offers a bunch of [built-in components]({{site_root}}/components/). Home Assistant can be extended by **components**. Each component is responsible for a specific domain within Home Assistant. Components can listen for- or trigger events, offer services and maintain states. Components are written in Python and can do all the goodness that Python has to offer. Out of the box, Home Assistant offers a bunch of [built-in components]({{site_root}}/components/).
@ -43,7 +43,7 @@ We can differentiate between two different types of
components within Home Assistant. components within Home Assistant.
#### Components that interact with an Internet of Things domain #### Components that interact with an Internet of Things domain
These components will track devices within a specific domain and make this information available via the State Machine and the Event Bus. The component will also register services in the Service Registry to expose control of the devices. Each of these components exist of a core part and small pieces of platform specific logic. These components will track devices within a specific domain and exist of a core part and platform specific logic. These components make their information available via the State Machine and the Event Bus. The component will also register services in the Service Registry to expose control of the devices.
For example, one of the built-in components is the `switch` component. This component is responsible for interaction with different types of switches. For example, one of the built-in components is the `switch` component. This component is responsible for interaction with different types of switches.
@ -72,9 +72,22 @@ For example the `device_sun_light_trigger` component tracks the state of devices
Another example of a home automation component can be found in [`/config/custom_components/example.py`](https://github.com/balloob/home-assistant/blob/master/config/custom_components/example.py). Another example of a home automation component can be found in [`/config/custom_components/example.py`](https://github.com/balloob/home-assistant/blob/master/config/custom_components/example.py).
### The full picture
When we put all the different pieces of Home Assistant together we see that we match pretty close to the initial sketched home automation overview. The smart home AI is not implemented yet and therefor ommitted from the following picture.
<p class='img'>
<a href='{{ root_url }}/images/architecture/ha_full_architecture.png'>
<img src='{{ root_url }}/images/architecture/ha_full_architecture.png' />
</a>
Overview of the full Home Assistant architecture with a couple of loaded components and platforms.
</p>
Component's platform logic uses 3rd party Python libraries to communicate with the devices. This is done so that we can leverage great device libraries that are out there in the Python community.
## Multiple connected instances ## Multiple connected instances
Home Assistant supports running multiple synchronzied instances using a master-slave model. Slaves forward all local fired events and set states to the master instance which will then replicate it to each slave. Home Assistant supports running multiple synchronzied instances using a master-slave model. Whenever `events.fire` or `states.set` is called on the salve it will forward it to the master. The master will replicate all events and changed states to its slaves.
<p class='img'> <p class='img'>
<a href='{{ root_url }}/images/architecture/architecture-remote.png'> <a href='{{ root_url }}/images/architecture/architecture-remote.png'>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB