diff --git a/ansible/roles/home-assistant/files/configuration.yml b/ansible/roles/home-assistant/files/configuration.yml index 74b9afd..81e1297 100644 --- a/ansible/roles/home-assistant/files/configuration.yml +++ b/ansible/roles/home-assistant/files/configuration.yml @@ -21,3 +21,6 @@ influxdb: light: - platform: flux_led automatic_add: true + +recorder: + db_url: postgres://home-assistant:home-assistant@127.0.0.1:45432/home-assistant diff --git a/ansible/roles/home-assistant/files/docker-compose.yml b/ansible/roles/home-assistant/files/docker-compose.yml index 142e6d1..410215b 100644 --- a/ansible/roles/home-assistant/files/docker-compose.yml +++ b/ansible/roles/home-assistant/files/docker-compose.yml @@ -11,6 +11,7 @@ services: restart: unless-stopped depends_on: - influxdb + - db labels: - traefik.enable=true - traefik.http.routers.homeassistant.rule=Host(`homeassistant.jakehoward.tech`) @@ -40,6 +41,17 @@ services: volumes: - ./esphome:/config + db: + image: postgres:12-alpine + restart: unless-stopped + ports: + - 127.0.0.1:45432:5432 + volumes: + - /mnt/tank/dbs/postgres/home-assistant:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=home-assistant + - POSTGRES_USER=home-assistant + networks: grafana: external: true