Jump to content

SENSBLUE ATLAS/Home Assistant: Difference between revisions

No edit summary
No edit summary
Line 594: Line 594:
install-atlas-ha.sh
install-atlas-ha.sh
atlas-ha-backup.tar.gz
atlas-ha-backup.tar.gz
</syntaxhighlight>Example with '''scp''' from PC:
</syntaxhighlight>Example with '''scp''' from PC:<syntaxhighlight lang="bash">
scp install-atlas-ha.sh atlas-ha-backup.tar.gz pi@<atlas-ip>:/home/pi/
</syntaxhighlight>On ATLAS:<syntaxhighlight lang="bash">
cd /home/pi
chmod +x install-atlas-ha.sh
</syntaxhighlight>
 
==== 16.4 Run installation ====
<syntaxhighlight lang="bash">
sudo ./install-atlas-ha.sh atlas-ha-backup.tar.gz
</syntaxhighlight>If the backup has a different name, replace in the command:<syntaxhighlight lang="bash">
sudo ./install-atlas-ha.sh <backup-name>.tar.gz
</syntaxhighlight>
 
==== 16.5 Expected backup structure ====
The backup should contain the necessary structure so that, after extraction in <code>/opt/atlas-ha</code>, at least the following exists:
 
/opt/atlas-ha/
 
├── docker-compose.yml
 
└── ha-config/
 
    ├── configuration.yaml
 
    ├── mqtt.yaml
 
    ├── automations.yaml
 
    ├── scripts.yaml
 
    └── scenes.yaml
 
If the backup does not contain <code>docker-compose.yml</code>, the command <code>sudo docker compose up -d</code> will not be able to start Home Assistant.
 
==== 16.6 Validation after the script ====
Check if the container is active:<syntaxhighlight lang="bash">
sudo docker ps
</syntaxhighlight>View logs:<syntaxhighlight lang="bash">
sudo docker logs -f homeassistant
</syntaxhighlight>Check HTTP response:<syntaxhighlight lang="bash">
curl -s -o /dev/null -w "%{http_code}
" http://localhost:8123
</syntaxhighlight>'''Expected result:'''
{| class="wikitable"
!Code
!Meaning
|-
|200
|Home Assistant accessible
|-
|302
|Home Assistant accessible, with redirection
|-
|000 connection refused
|May be normal in the first 1-2 minutes; wait and retry
|}
Access in browser:
 
http://&#x3C;atlas-ip&#x3E;:8123
 
=== 17. Uninstall / revert ===
Stop and remove the container:<syntaxhighlight lang="bash">
cd /opt/atlas-ha
sudo docker compose down
</syntaxhighlight>Remove the image:<syntaxhighlight lang="bash">
sudo docker image rm ghcr.io/home-assistant/home-assistant:stable
</syntaxhighlight>Optionally, also remove the configuration:<syntaxhighlight lang="bash">
sudo rm -rf /opt/atlas-ha
</syntaxhighlight>The native ATLAS stack, including Node-RED, Grafana, InfluxDB, and Mosquitto, is not removed by these steps.
 
=== 18. Summary ===
{| class="wikitable"
!Step
!Command / Action
|-
|Create folder
|sudo mkdir -p /opt/atlas-ha
|-
|Create compose
|docker-compose.yml with network_mode: host
|-
|Start
|sudo docker compose up -d
|-
|Access
|[http://&#x3C;ip-do-atlas&#x3E;:8123 http://<atlas-ip>:8123]
|-
|Configure MQTT
|Broker 127.0.0.1:1883
|-
|Create entities
|configuration.yaml + mqtt.yaml
|-
|Restart
|sudo docker compose restart
|-
|Logs
|sudo docker logs -f homeassistant
|-
|Backup
|'''tar''' from the '''ha-config''' folder
|-
|Revert
|sudo docker compose down
|}
 
=== 19. Final checklist ===
 
* Docker installed and functional
* homeassistant container in Up state
* Port 8123 accessible
* MQTT configured in Home Assistant
* configuration.yaml file created with <code>mqtt: !include mqtt.yaml</code>
* mqtt.yaml file created
* AI1..AI4 entities created
* DI1..DI4 entities created
* DO1..DO4 entities created
* Node-RED still accessible on 1880
* Mosquitto still accessible on 1883
* Grafana still accessible on 3000
* InfluxDB still accessible on 8086
* Backup of the ha-config folder considered
 
atlas-ha-install-v1.tar.gz