Home Assistant 설정

Home Assistant 설정

환경: 22.12월 기준 최신 버전

그동안 IoT 생활을 위해 SmartThings 플랫폼을 사용했다. 하지만 12/31일 Groovy 종료를 앞두고, Groovy driver를 사용하고 있던 IoT 디바이스를 최신 Edge 드라이버로 변경하는 작업을 하고 있었다. 변경하면서 살펴보니 아직 많은 디바이스에 대해 Edge 드라이버가 없거나, 있어도 기능적으로 많이 부족하였다. 커뮤니티에는 Workaround 방식으로 어찌 저찌하는 방법이 있었기에 따라서 해봤지만, 아직 기능적인 부분에서 마음에 안 들었다.

그와중에 로컬의 빠른 반응성과 많은 호환성을 자랑하는 오픈 소스인 Home Assistant (HA)로 이주하려고 조금씩 테스트를 하였고, 잘 동작하였기에, 결국 모든 IoT 디바이스를 HA로 완전 이주하였다.

HA의 장점은 로컬로 동작하고, 오픈소스이고, 많은 디바이스 지원과 사용 목적에 따라 커스터마이스가 가능하다... 이다. 단점으로는 직접 관리해야하고 업데이트 시 잘 깨질 수 있다... 인데, 직접 관리는 나한테는 단점은 아니고, 업데이트로 인한 문제는 아직 경험하지 못했다.

설치에 관한 내용은 나중에 여유되면 따로 작성하고, 여기서는 설정에 대해 작성한다.

설정

configuration.yml에 커스텀 설정을 추가한다. 참고로 configuration.yml을 수정하였다면 반영을 위해 꼭 재부팅이 필요하다.

configuration.yml에 다음 4가지 세팅을 추가하였고, 설정 내용은 다음과 같다.

  • TTS
  • SmartThings
  • Google Assistant
  • System monitor
# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
# Default
#tts:
#  - platform: google_translate
#    language: 'ko'

# MS Edge
tts:
  - platform: edge_tts
    language: ko-KR-SunHiNeural
    volume: 200.0

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.0.0.0/8
    - 192.168.0.0/16

# Smartthings 연결
homeassistant:
  name: "Home Assistant"
  unit_system: metric
  time_zone: Asia/Seoul
  external_url: "https://ha.rhchoi.com"
  internal_url: "http://192.168.1.210:8123"

# Example configuration.yaml entry
google_assistant:
  project_id: home-assistant-e5221
  service_account: !include home-assistant-e5221-service_account.json
  report_state: true
  expose_by_default: true
  exposed_domains:
    - switch
    - light
    - cover
    - script
    - scene
  entity_config:
    switch.plug_5138:
      expose: false

# Example configuration.yaml entry with all entry types (delete/comment out as necessary)
sensor:
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /config
      - type: disk_use
      - type: disk_free
      - type: memory_use_percent
      - type: memory_use
      - type: memory_free
      - type: swap_use_percent
      - type: swap_use
      - type: swap_free
      - type: load_1m
      - type: load_5m
      - type: load_15m
      - type: network_in
        arg: eth0
      - type: network_out
        arg: eth0
      - type: throughput_network_in
        arg: eth0
      - type: throughput_network_out
        arg: eth0
      - type: packets_in
        arg: eth0
      - type: packets_out
        arg: eth0
      - type: ipv4_address
        arg: eth0
      - type: ipv6_address
        arg: eth0
      - type: processor_use
      - type: processor_temperature
      - type: last_boot

TTS 설치

custom_components에 다음과 같이 edge_tts를 git clone하고 재부팅한다.

cd /config
git clone https://github.com/hasscc/hass-edge-tts.git
mkdir -p custom_components
cd custom_components
ln -s ../hass-edge-tts/custom_components/edge_tts

이케아 버튼 페어링 방법

버튼을 5번 누른다.

커튼/블라인드 페어링 방법

현재 사용하고 있는 투야 커튼과 제미스마트 블라인드 페어링 방법을 나중을 위해 작성한다.

커튼/블라인드에서 열림은 100으로 표기된다.

페어링은 다음과 같이 누른다.

  • 투야 커튼: "꾹꾹꾹 꾸우욱~"
  • 블라인드: "꾹꾹꾹"

참고로 제미스마트 블라인드 리밋 설정은 다음과 같다.