HomeAssistant [en cours de rédaction]

Install dépendance : sudo aptitude install apparmor bluez cifs-utils curl dbus jq libglib2.0-bin lsb-release network-manager nfs-common systemd-journal-remote systemd-resolved udisks2 wget docker-ce

Arrêt du paquet ModemManager : sudo systemctl disable ModemManager sudo systemctl stop ModemManager

Install os-agent : télécharger la dernière version et l'installer avec dpkg https://github.com/home-assistant/os-agent/releases

Installation de HA supervized : wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb sudo dpkg -i homeassistant-supervised.deb

Choisir le hardware dans la popup qui apparaît :

Redémarrer : sudo reboot now

Vérifier l'état des conteneurs : sudo docker ps

Apache : sudo a2enmod proxy_wstunnel

fichier de conf :

<VirtualHost *:80>

      ServerName ha.rasp.fr
      Redirect / https://ha.rasp.fr/

</VirtualHost>

<VirtualHost *:443>

      ServerName ha.domaine.fr
      DocumentRoot /var/www/ha
      LogLevel warn
      CustomLog ${APACHE_LOG_DIR}/ha.access.log combined
      ErrorLog ${APACHE_LOG_DIR}/ha.error.log
      SSLEngine on
      SSLCertificateFile /etc/letsencrypt/live/domaine.fr/fullchain.pem
      SSLCertificateKeyFile /etc/letsencrypt/live/domaine.fr/privkey.pem
      ServerName ha.domaine.fr
      ProxyPreserveHost On
      ProxyRequests off
      ProxyPass /api/websocket ws://localhost:8123/api/websocket
      ProxyPassReverse /api/websocket ws://localhost:8123/api/websocket
      ProxyPass / http://localhost:8123/
      ProxyPassReverse / http://localhost:8123/
      RewriteEngine on
      RewriteCond %{HTTP:Upgrade} =websocket [NC]
      RewriteRule /(.*)  ws://localhost:8123/$1 [P,L]
      RewriteCond %{HTTP:Upgrade} !=websocket [NC]
      RewriteRule /(.*)  http://localhost:8123/$1 [P,L]

</VirtualHost>

sudo a2ensite ha.domaine.fr.conf

sudo systemctl reload apache2

Ajout de l'IP du reverse proxy : sudo nano /usr/share/hassio/homeassistant/configuration.yaml

Ajout :

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 127.0.0.1
    - ::1

Redémarrer homeassistant : sudo docker restart homeassistant