Louie NRT Story

[HomeAssistant] Introduce 본문

스마트홈

[HomeAssistant] Introduce

hyeok0724.kim@gmail.com 2020. 2. 28. 11:26
반응형

Writed Date: 28 FEB 20

Index

1. Home-Assistant(HA) Introduce

2. Install Home-Assistant(HA)

3. Home-Assistant(HA) Architecture

4. Home-Assistant(HA) Core Architecture

5. Components Architecture

6. Entity Architecture

7. Hass.io Architecture

 

1. Home-Assistant(HA) Introduce

- Pascal Vizeli가 ResinOS와 Docker 기반으로 만든 Hass.io 만듬
- 개발 시작하고 20년이 되면서 7년 째를 맞이함
- 기존의 HA에서 기본적으로 IoTs를 지원하였으며, 서드파티 어플리케이션을 통하여 HA에 통합 되고 있음
- 사용자들이 자동화를 위해 많은 시간을 시스템과 어플리케이션 유지보수에 투자하는 문제를 해결하고자 함
- 사용자가 더 이상 라즈베리파이의 컴퓨팅 문제에 대한 걱정하지 않도록 함
- 로컬을 우선시 하며 사용자의 사생활을 존중함
- Hass.io는 HA를 설치 및 업데이트 하며, Home Assistant UI를 관리하고 스냅샷한 구성정보를 저장하거나 불러올 수 있음.
- Hass.io add-ons를 통해 쉽게 확장 가능
- 추가 기능을 설치하기 위해서는 내장된 Add-ons 스토어를 둘러보고 사용가능한 어플리케이션을 설치, 구성 및 업데이트 할 수 있도록 함
- 구글 어시스턴트로 전환 하거나 Samba 또는 Windows 네트워크를 통해 구성정보에 접근할 수 있도록 만들고 싶다면 클릭 몇 번이면 가능
- 사전에 구글 어시스턴트, Let's Encrypt, 그리고 Duck DNS은 이미 설치되어 있음
- 내부 추가설치 외에도 사용자 만의 Add-ons Repository를 만들거나 공유 할 수 있음
- Hass.io는 Apache 2.0 라이센스에 따라 오픈소스로 올렸음

- Hass.io의 UI는 Paulus Schoutsen에 의해 서버사이드 Nodejs로 만들어 졌음
- Resin.io 의 지원으로 ResinOS를 빌드하고 시작할 수 있었음
- Python 이 운영되는 어디서든 HA는 실행할 수 있음
- RaspberryPi 1, 2, 3과 Intel NUC를 지원함. 고급사용자들은 Linux 서버에서 Hass.io를 설치 할 수 있음
- Docker 컨테이너를 사용하기 때문에 PC 패키지 또는 스크립트는 불가능함 . 하지만 HA와 상호작용하는 Local Add-on을 만들면 가능함
- Hass.io 스냅샷이든 모든 장비에 복원 가능함

 

2. Install Home-Assistant(HA)

1) 설치 장비에 맞는 Image를 다운로드 함

2) HA 설치

- BalenaEtcher를 이용하여 SD카드에 다운로드한 이미지를 저장함

- 라즈베리파이를 사용한다면, 공간이 부족한 상태에서 동작하는 것을 피하기 위해 최소 32GB SD카드를 권장
-
가상 머신 플랫폼의 경우에는 가상머신에 최소 32GB 디스크를 제공
-
어플리케이션 이미지를 가상머신 소프트웨어에 불러온다. 64-bit 리눅스 및 UEFI 부팅

3) Wifi 또는 고정 IP 설정

- FAT32파티션을 구성된 USBCONFIGnetwork/my-network 파일 생성함

- SD카드의 Hassio-boot에서 CONFIG/network/my-network 파일을 생성함

4) 이미지가 설치된 SD카드를 장치에 연결함

5) 디바이스 또는 가상머신의 전원을 켜고 첫번째 부팅 때 최신 버전의 HA를 다운로드 하는데 대략 20분정도 소요됨

6) http://homeassistant.local:8123 에 접속 할 수 있음

- 만약 사용중인 라우터가 mDNS를 지원한다면, 하지만 아니라면 아래를 따라함

7) HACLI 툴을 이용하여 접근할 수 있도록 해야함

- Config 파일에 있는 설정 정보를 변경하기 전에 Samba add-on SSH add-on 모두 설치 해야함.

- 사이드바에 있는 Supervisor를 선택하고 add-on 스토어를 선택하여 설치

 

3. Home-Assistant(HA) Architecture

1) Home Control

- Response for collecting information and controlling devices.

2) Home Automation

- Trigger commands based on user configurations.

3) Smart Home

- Trigger commands based on previous behavior.

 

4. Home-Assistant(HA) Core Architecture

 

1) Event Bus

- Facilitate the firing and listening of events

2) State Machine

- Keep Track of the states of things and fires a “state_changed” event when a state has been changed

3) Service Registry

- Listens on the event bus for “call_service” events and allows other code to register services.

4) Timer

- Send a “time_changed” event every 1 second on the event bus

 

e.g. When One Switch device turns “Off”, the device status file is deleted. But other Switch device’s status file is created by automatic Logic
e.g. If Hello Switch device status file is removed to Trash, other Switch device’s status file is created by automatic Logic

5. Components Architecture

1) Each component is responsible for a specific domain within HA

2) Components can listen for or trigger events, offer services, and maintain states.

3) HA components interact with an IoTs and respond to events that happen within HA. Read on to learn about each type

4) These components track devices within a specific domain and consist of a core and specific logic and make their

5) information available via the State Machine and Event Bus.

6) The components provide the home automation logic or involve services that do common tasks.

- e.g, “device_sun_light_trigger” components tracks the state of devices and the sun to make sure that the lights are turned on when it gets dark.

 

7) The platform logic for components uses third-party Python libraries to communicate with the devices.

 

6. Entity Architecture

1) Configuration

- Configuration is provided by “configuration.yaml” file or by a Config Entry.

2) Entity Component

- Distributing the configuration to the platforms, forwarding config entries, Collect entities for service calls and optionally maintain a group of all entities.

3) Entity Platform

- Entity Platform query the “Entity Registry” to be added entity IDs.

4) Entity Registry

- Track entities and allows users to store extra settings for an entity

5) Platform

- Platform uses configuration to query the external device or services and add entities to the entity platform.

7. Hass.io Architecture

1) Host Control(HC)

- running on the host machine that allows the supervisor to control certain aspects of the host OS.

2) Host

- It based on HassOS which is based on BuildRoot. Any Linux machine can be turned into a Hass.io

3) Supervisor

- Offer an API to manage the host and running the Docker containers

4) Configuration Panel

- This is insede the supervisor but is accessible via the Home Assistant user interface.

 

Reference:

https://www.home-assistant.io/

 

Home Assistant

Open source home automation that puts local control and privacy first.

www.home-assistant.io

https://developers.home-assistant.io/

불러오는 중입니다...

https://youtu.be/Cfasc9EgbMU

 

반응형

'스마트홈' 카테고리의 다른 글

[HomeAssistant] Install Hass.io  (0) 2020.03.01
[HomeAssistant] Install ESPHome  (0) 2020.03.01
[제품분해] 탄소 발열매트  (0) 2019.12.27
[Nuvoton] M058 - UART Interrupt  (0) 2019.05.15
[Firmware] M058 - Timer Interrupt  (0) 2019.05.03
Comments