먹는게 남는거다!

Home Assistant + Docker + Raspberry Pi 설치

장난감

Home Assistant 설치에 앞서 Docker가 설치되어 있지 않을 경우 Docker를 설치하셔야 합니다.

 

1. Home Assistant 설치

Home Assistant를 설치하는 여러 방법이 있지만 Docker를 이용할 경우 root 계정으로 작업하는 것이 편합니다.

su

 

아래의 명령어로 Home Assistant를 설치합니다.

/home/pi/homeassistant 는 Home Assistant 설정 폴더 경로로 원하시는 경로를 입력하시면 되고

Asia/Seoul 는 Time Zone입니다. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)

이 역시 원하시는 시간대로 정하시면 됩니다.

docker run --init -d --name="home-assistant" -e "TZ=Asia/Seoul" -v /home/pi/homeassistant:/config --net=host homeassistant/raspberrypi3-homeassistant:stable

 

참고: https://www.home-assistant.io/docs/installation/docker/

 

Installation on Docker

Instructions to install Home Assistant on a Docker.

www.home-assistant.io

 

2. HTTPS 통신을 위한 SSL 인증서 설치

Let's Encrypt 설치를 다룬 글이 많이 있지만 아래 블로그 포스트를 따라하는 것이 가장 확실합니다.

천천히 따라하면 30분도 걸리지 않을 정도로 간단합니다.

 

참고: https://www.splitbrain.org/blog/2017-08/10-homeassistant_duckdns_letsencrypt

 

HASS, DuckDNS and Let's Encrypt [splitbrain.org]

2 years ago I blogged about… When you want to make a local HomeAssistant (a home automation software I mentioned before) available from the Internet, you probably want to secure it with SSL. There's an official tutorial on how to do that, but it has a few

www.splitbrain.org

한가지 주의할 점은 우리는 본문과 달리 Docker에 Home Assistant를 설치한 상황이라 Home Assistant가 인식하는 본인의 절대 경로가 다르다는 것입니다.

때문에 Reconfigure HomeAssistant 섹션에서 언급한 pem 파일들의 경로를 본문과 달리 아래와 같이 설정해야 합니다.

 

[ fullchain. pem ]

변경 전: /home/homeassistant/dehydrated/certs/myhome.duckdns.org/fullchain.pem

변경 후: ./dehydrated/certs/myhome.duckdns.org/fullchain.pem

 

[ privkey.pem ]

변경 전: /home/homeassistant/dehydrated/certs/myhome.duckdns.org/privkey.pem

변경 후: ./dehydrated/certs/myhome.duckdns.org/privkey.pem

 

3. Tip

1) UPNP 안 보이기

discovery:
  ignore:
    - igd