bridge: install.sh, un comando per installare tutto

Clona il repository, crea l'ambiente, chiede le credenziali (password senza eco,
mai nella cronologia), verifica di riuscire a leggere l'impianto, installa e
avvia il servizio, e stampa indirizzo e token da mettere nell'app.

Non serve root e non tocca niente fuori dalla home. I percorsi sono variabili
(AIRA_INSTALL_DIR, AIRA_CONFIG_DIR, AIRA_PORT) con valori predefiniti sensati,
cosi' lo script funziona per chiunque: i valori predefiniti dei programmi esistenti
non sono stati cambiati, per non toccare installazioni in corso.

Provato per davvero: clonazione, ambiente Python con pyairahome/grpc/cryptography,
lettura del token, e il file del servizio passato a systemd-analyze verify. Il ramo
che usa systemctl --user non e' verificabile da qui (nessun bus utente): da provare
su una macchina con sessione systemd.

README: installazione in un comando, con la procedura manuale come ripiego.
setup_creds.py: messaggi in inglese, per il pubblico del forum.
This commit is contained in:
Carlo Baratto committed 2026-10-12 15:04:48 +02:00
1 parent e9527f66bb
commit 02d467f46c
3 files changed
+227 -15

No files matched your search

+36 -5
View File
@@ -17,24 +17,55 @@ Tested against an Aira Home heat pump (Europe). Python 3.9+.
## Install
One command. It clones this repository into `~/harbour-aira`, creates a private
Python environment, asks for your Aira email and password (typed without echo),
checks that it can read your plant, and installs itself as a service that starts
by itself at boot.
```bash
curl -fsSL https://git.hackatoniclife.com/kaneda/harbour-aira/raw/branch/main/bridge/install.sh | bash
```
It never needs root and it changes nothing outside your home directory. When it
finishes, it prints two things to copy into the app: the address and the token.
On a Raspberry Pi the slow part is installing the Python libraries, a few
minutes; everything else is seconds.
To update later, run the same command again.
### If something goes wrong
Everything is a normal user service, so you can look at it:
```bash
systemctl --user status harbour-aira-bridge
journalctl --user -u harbour-aira-bridge -f
systemctl --user restart harbour-aira-bridge
```
If your machine has no systemd user session, the script says so and prints the
command to start the bridge by hand.
### Doing it manually
If you would rather see every step, the install is short:
```bash
git clone https://git.hackatoniclife.com/kaneda/harbour-aira.git
cd harbour-aira/bridge
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
.venv/bin/python -m pip install -r requirements.txt
# where credentials and bridge configuration will live
export AIRA_CONFIG_DIR="$HOME/.config/aira"
mkdir -p "$AIRA_CONFIG_DIR"
# your Aira email + password: typed without echo, saved in a file readable
# only by your user (600). Nothing is printed, nothing is logged.
python setup_creds.py
.venv/bin/python setup_creds.py
# sanity check: logs in and prints your plant state (read-only)
python aira_probe.py
.venv/bin/python aira_probe.py
```
If `aira_probe.py` prints your temperatures and modes, the hard part is done.