-
Notifications
You must be signed in to change notification settings - Fork 0
/
home_automation.yaml
executable file
·189 lines (177 loc) · 5.17 KB
/
home_automation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# Based on https://iotechonline.com/home-assistant-install-with-docker-compose/?cn-reloaded=1
version: '3.8'
services:
homeassistant:
container_name: hass.io
image: "homeassistant/home-assistant:2024.6.4"
volumes:
- /ssd/home-assistant:/config
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
privileged: true
ports:
- "8123:8123"
- "6668:6668"
- "6666:6666/udp"
- "6667:6667/udp"
depends_on:
mosquitto:
condition: service_started
mariadb:
condition: service_healthy
influxdb:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8123/"]
start_period: 5s
interval: 30s
retries: 5
timeout: 5s
# without mariadb, SQLite for now - https://www.home-assistant.io/docs/backend/database/
mariadb:
image: linuxserver/mariadb:10.11.8
container_name: mariadb
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
MYSQL_DATABASE: ha_db
MYSQL_USER: homeassistant
MYSQL_PASSWORD: "${HA_MYSQL_PASSWORD}"
PUID: 1000
PGID: 1000
TZ: "Europe/Warsaw"
volumes:
- /ssd/mariadb:/config
- /ssd/backups/mariadb:/backups
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "--silent"]
start_period: 10s
interval: 30s
retries: 5
timeout: 5s
influxdb:
image: influxdb:2.7.6
container_name: influxdb
restart: unless-stopped
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=influxdb-admin
- DOCKER_INFLUXDB_INIT_PASSWORD=XXXX
- DOCKER_INFLUXDB_INIT_ORG=db
- DOCKER_INFLUXDB_INIT_BUCKET=home-automation
volumes:
- /ssd/influxdb/data:/var/lib/influxdb2
- /ssd/influxdb/config:/etc/influxdb2
- /ssd/backups/influxdb:/backups
ports:
- 8086:8086
healthcheck:
test: [ "CMD", "curl", "-sI", "http://127.0.0.1:8086/ping" ]
interval: 30s
timeout: 5s
retries: 24
start_period: 10s
grafana:
image: "grafana/grafana:10.4.4"
container_name: grafana
restart: unless-stopped
user: "${PUID}:${PGID}"
depends_on:
influxdb:
condition: service_healthy
homeassistant:
condition: service_healthy
volumes:
- "/ssd/grafana/data:/var/lib/grafana"
ports:
- 3000:3000
nodered:
container_name: node-red
image: nodered/node-red:3.1.11-18
ports:
- "1880:1880"
volumes:
- /ssd/nodered:/data
depends_on:
homeassistant:
condition: service_healthy
mosquitto:
condition: service_started
environment:
TZ: "Europe/Warsaw"
restart: unless-stopped
mosquitto:
image: eclipse-mosquitto:2.0.18
container_name: mosquitto
restart: unless-stopped
ports:
- "1883:1883"
- "1884:1884"
volumes:
- "/ssd/HomeAutomation/mosquitto/config:/mosquitto/config"
- "/ssd/mosquitto/data:/mosquitto/data"
- "/ssd/mosquitto/log:/mosquitto/log"
environment:
- TZ=Europe/Warsaw
user: "${PUID}:${PGID}"
# hass-configurator:
# image: "causticlab/hass-configurator-docker:arm"
# container_name: hass-configurator
# restart: unless-stopped
# ports:
# - "3218:3218/tcp"
# depends_on:
# - homeassistant
# volumes:
# - "/ssd/HOME_AUTOMATION/configurator-config:/config"
# - "/ssd/HOME_AUTOMATION/hass-config:/hass-config"
# user: "${PUID}:${PGID}"
# portainer:
# ports:
# - "9000:9000"
# container_name: portainer
# restart: unless-stopped
# volumes:
# - "/var/run/docker.sock:/var/run/docker.sock"
# - "./portainer/portainer_data:/data"
# image: portainer/portainer-ce
# UNVERIFIED IF zigbee2mqtt has good settings
# check https://www.zigbee2mqtt.io/guide/installation/02_docker.html#docker-compose
zigbee2mqtt:
container_name: zigbee2mqtt
image: koenkk/zigbee2mqtt:1.31.0
restart: unless-stopped
volumes:
- /run/udev:/run/udev:ro
- "/ssd/zigbee2mqtt/data:/app/data"
ports:
- 8200:8200
environment:
- TZ=Europe/Warsaw
devices:
- /dev/ttyACM0:/dev/ttyACM0
# know bug in Debian 11 with udev 247.3-7 so cannot use by-id https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1035094
# - /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2651605-if00:/dev/ttyACM0
# 20230529 disabling as it's not used and it slows down raspberry pi 3B :(
# vscode:
# container_name: vscode
# image: codercom/code-server:4.11.0-debian
# volumes:
# - /ssd/home-assistant:/home/coder/project
# - /ssd/vscode:/home/coder/.local/share/code-server
# user: root
# ports:
# - "8083:8080"
# environment:
# PASSWORD: "${VSCODE_PASSWORD}"
# restart: unless-stopped
cloudflared:
image: cloudflare/cloudflared:2024.6.1
container_name: cloudflared
restart: unless-stopped
volumes:
- /ssd/cloudflared/date:/home/nonroot/.cloudflared/
command: tunnel --no-autoupdate run --token ${CLOUDFLARED_DOMAIN_TUNNEL_TOKEN}