diff --git a/homeassistant/.gitignore b/homeassistant/.gitignore new file mode 100644 index 0000000..7920bfa --- /dev/null +++ b/homeassistant/.gitignore @@ -0,0 +1,2 @@ +configuration.yaml +docker-compose.yml diff --git a/homeassistant/README.md b/homeassistant/README.md new file mode 100644 index 0000000..a6f92b9 --- /dev/null +++ b/homeassistant/README.md @@ -0,0 +1,39 @@ +# Home Assistant +Home automation software. + +## Installation + +### Docker +1. Run the container to set up the local filesystem. +2. Modify the created config file, in `config/configuration.yaml` to allow the traefik proxy, or generally everything on the local network. NOTE: Traefik breaks homeassistant, needs to be over local network for now. +``` +# Configure HTTP settings +http: + use_x_forwarded_for: true + trusted_proxies: + - 192.168.96.0/24 +``` +Optionally, set the log level +``` +# Configure logging +logger: + default: debug + logs: + homeassistant.core: debug + homeassistant.components: info + homeassistant.components.mqtt: debug +``` +Note these snippets should go above the `automation` line. +`docker compose down && docker system prune -f && docker compose build && docker compose up -d && docker logs -f homeassistant` + +### Home Assistant Setup +1. Set up devices/smart lights according to manufacturer instructions to get them on the local network. +2. Settings > Devices & Services > Add Integration +3. For my WiZ light, the automatic scan did not find it. I had to manually use nmap to find it on the network and enter the IP. +``` +nmap -sn 192.168.1.xxx/24 (adjust for your local network) +``` + +## References +https://www.home-assistant.io/integrations/wiz/ + diff --git a/homeassistant/configuration.yaml.blanked b/homeassistant/configuration.yaml.blanked new file mode 100644 index 0000000..ce52884 --- /dev/null +++ b/homeassistant/configuration.yaml.blanked @@ -0,0 +1,25 @@ + +# Loads default set of integrations. Do not remove. +default_config: + +# Load frontend themes from the themes folder +frontend: + themes: !include_dir_merge_named themes + +# Configure HTTP settings +http: + use_x_forwarded_for: true + trusted_proxies: + - 192.168.x.xxx + +# Configure logging +logger: + default: info + logs: + homeassistant.core: debug + homeassistant.components: info + homeassistant.components.mqtt: debug + +automation: !include automations.yaml +script: !include scripts.yaml +scene: !include scenes.yaml diff --git a/homeassistant/docker-compose.yml.blanked b/homeassistant/docker-compose.yml.blanked new file mode 100644 index 0000000..1f3becd --- /dev/null +++ b/homeassistant/docker-compose.yml.blanked @@ -0,0 +1,24 @@ +networks: + traefik: + external: true + +services: + homeassistant: + image: lscr.io/linuxserver/homeassistant:latest + container_name: homeassistant + restart: unless-stopped + networks: + - traefik + environment: + - PUID=1000 + - PGID=1000 + - TZ=Etc/UTC + volumes: + - /path/to/config:/config + ports: + - 8123:8123 + labels: + - traefik.http.routers.homeassistant.rule=Host(`SITE_URL`) + - traefik.http.routers.homeassistant.tls=true + - traefik.http.routers.homeassistant.tls.certresolver=lets-encrypt + - traefik.http.services.homeassistant.loadbalancer.server.port=8123