You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Containers/Home-Assistant.md
+76-21Lines changed: 76 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,10 +222,19 @@ $ cd ~/IOTstack
222
222
$ docker-compose up -d
223
223
```
224
224
225
-
## Adding https access to your Home Assistant
225
+
## HTTPS with a valid certificate
226
226
227
-
Some HA integration (e.g google assistant) require your HA to be accessible
228
-
through https. This tells you how to use a [linuxserver swag container](https://docs.linuxserver.io/general/swag) ([Docker hub docs](https://hub.docker.com/r/linuxserver/swag)) to automatically generate a SSL-certificate and setup a reverse proxy.
227
+
Some HA integrations (e.g google assistant) require your HA API to be
228
+
accessible via https with a valid certificate. You can configure HA to do this:
docs](https://hub.docker.com/r/linuxserver/swag)) will automatically generate a
236
+
SSL-certificate, update the SSL certificate before it expires and act as a
237
+
reverse proxy.
229
238
230
239
1. First test your HA is working correctly: `http://raspberrypi.local:8123/` (assuming
231
240
your RPi hostname is raspberrypi)
@@ -253,31 +262,77 @@ your RPi hostname is raspberrypi)
253
262
- 443:443
254
263
restart: unless-stopped
255
264
```
256
-
5. Start the swag container (creates the file to be edited in the next step): `cd ~/IOTstack && docker-compose up -d` and check it started OK `docker-compose logs -f swag`
257
-
6. Rename the file volumes/swag/config/nginx/proxy-confs/homeassistant.subdomain.conf.sample to remove .sample from the filename.
258
-
7. Enable reverse proxy to `raspberrypi.local` and fix homeassistant container name:
265
+
Replace the bracketed values. Do NOT use any "-characters to enclose the values.
266
+
267
+
5. Start the swag container, this creates the file to be edited in the next step:
268
+
```
269
+
cd ~/IOTstack && docker-compose up -d
270
+
```
271
+
272
+
Check it starts up OK: `docker-compose logs -f swag`. It will take a minute or two before it finally logs "Server ready".
273
+
274
+
6. Enable reverse proxy for `raspberrypi.local`. `homassistant.*` is already by default. and fix homeassistant container name ("upstream_app"):
8. Add `use_x_forwarded_for` and `trusted_proxies` to your homeassistant [http config](https://www.home-assistant.io/integrations/http). For a default install the result will be:
303
+
9. Add `use_x_forwarded_for` and `trusted_proxies` to your homeassistant [http
304
+
config](https://www.home-assistant.io/integrations/http). The configuration
305
+
file is at `volumes/home_assistant/configuration.yaml` For a default install
9. Refresh the stack: `cd ~/IOTstack && docker-compose stop && docker-compose up -d`
278
-
10. Test homeassistant is still working correctly: `http://raspberrypi.local:8123/` (assuming your RPi hostname is raspberrypi)
279
-
11. Test the reverse proxy is working correctly: `https://raspberrypi.local/` (note: https)
280
-
12. And finally test your router forwards correctly by accessing it from outside your LAN(e.g. using a mobile phone): `https://homeassistant.<yourdomain>.duckdns.org/`
330
+
(output should end in `if (!window.latestJS) { }</script></body></html>`)
331
+
332
+
13. And finally test your router forwards correctly by accessing it from
333
+
outside your LAN(e.g. using a mobile phone):
334
+
`https://homeassistant.<yourdomain>.duckdns.org/` Now the certificate
0 commit comments