Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
projects:internetofthings:homeassistant [2017/08/30 13:34] – scipio | projects:internetofthings:homeassistant [2022/07/08 10:19] (current) – daniel | ||
---|---|---|---|
Line 27: | Line 27: | ||
<code bash> | <code bash> | ||
- | apt install python3 python3-venv | + | sudo apt install python3 python3-venv |
- | python3 -m venv ~/lib | + | python3 -m venv ~/venv |
- | . ~/lib/ | + | . ~/venv/ |
- | echo " | + | echo " |
- | pip install -U pip | + | pip install -U pip wheel |
pip install homeassistant | pip install homeassistant | ||
</ | </ | ||
service | service | ||
- | <file txt / | + | <file txt / |
[Unit] | [Unit] | ||
- | Description=Home Assistant | + | Description=homeassistant |
After=network.target | After=network.target | ||
Line 44: | Line 44: | ||
Type=simple | Type=simple | ||
User=pi | User=pi | ||
- | ExecStart=/ | + | ExecStart=/ |
[Install] | [Install] | ||
Line 50: | Line 50: | ||
</ | </ | ||
- | ==== z-wave ==== | + | enable service |
- | + | ||
- | <file txt / | + | |
- | SUBSYSTEM==" | + | |
- | </ | + | |
<code bash> | <code bash> | ||
- | sudo apt install cython3 libudev-dev python3-sphinx python3-setuptools | + | systemctl daemon-reload |
+ | systemctl enable hass | ||
</ | </ | ||
- | <code bash> | ||
- | . ~/ | ||
- | pip install cython | ||
- | </ | ||
- | as normal user (no root) | + | configuration example |
<code bash> | <code bash> | ||
- | . ~/ | + | sudo apt install git mc |
- | cd ~/ | + | git clone https:// |
- | git clone --depth 1 https:// | + | |
- | cd python-openzwave | + | |
- | make build | + | |
- | make install | + | |
</ | </ | ||
- | <code bash> | ||
- | sudo apt install libmicrohttpd-dev | ||
- | cd ~/ | ||
- | git clone --depth 1 https:// | ||
- | cd open-zwave-control-panel/ | ||
- | # patch Makefile: see below | ||
- | ln -s ~/ | ||
- | make | ||
- | </ | ||
- | patch Makefile | + | ==== z-wave ==== |
+ | |||
+ | Installazione ZWave su raspberry pi | ||
< | < | ||
- | --- Makefile.orig 2017-01-05 08: | ||
- | +++ Makefile 2017-01-05 08: | ||
- | @@ -21,7 +21,7 @@ | ||
- | | ||
- | | ||
- | |||
- | -OPENZWAVE := ../ | ||
- | +OPENZWAVE := ../ | ||
- | | ||
- | |||
- | | ||
- | @@ -34,15 +34,15 @@ | ||
- | |||
- | # for Linux uncomment out next three lines | ||
- | | ||
- | -#LIBUSB := -ludev | ||
- | -#LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) -lresolv | ||
- | +LIBUSB := -ludev | ||
- | +LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) -lresolv | ||
- | |||
- | # for Mac OS X comment out above 2 lines and uncomment next 5 lines | ||
- | #ARCH := -arch i386 -arch x86_64 | ||
- | # | ||
- | # | ||
- | -LIBUSB := -framework IOKit -framework CoreFoundation | ||
- | -LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) $(ARCH) -lresolv | ||
- | +#LIBUSB := -framework IOKit -framework CoreFoundation | ||
- | +#LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) $(ARCH) -lresolv | ||
- | |||
- | %.o : %.cpp | ||
- | | ||
- | </ | ||
- | === z-wave panel control === | + | opzionale, rimuovere docker se si hanno installazioni vecchie: |
+ | sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli | ||
+ | sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce | ||
- | <code bash> | + | |
- | sudo systemctl | + | sudo apt update |
- | cd ~/open-zwave-control-panel | + | sudo apt install raspberrypi-kernel raspberrypi-kernel-headers |
- | ./ | + | sudo apt install ca-certificates curl gnupg lsb-release |
+ | |||
+ | sudo mkdir -p / | ||
+ | |||
+ | curl -fsSL https:// | ||
+ | |||
+ | echo "deb [arch=$(dpkg --print-architecture) signed-by=/ | ||
+ | |||
+ | sudo apt-get update | ||
+ | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin | ||
+ | (se ci sono errori dpkg, riprovare dopo un reboot) | ||
+ | |||
+ | sudo systemctl | ||
+ | sudo systemctl start docker | ||
+ | |||
+ | ls / | ||
+ | copiare il nome della chiavetta usb (es usb-0658_0200-if00) | ||
+ | |||
+ | mkdir zwave | ||
+ | cd zwave | ||
+ | wget https:// | ||
+ | nano docker-compose.yml | ||
+ | incollare il nome della chiavetta al posto di " | ||
+ | salvare | ||
+ | |||
+ | sudo docker compose up -d | ||
</ | </ | ||
- | open http://pi:8888 and initialize / | + | Visitare |
- | <code bash> | + | Andare sulle settings dal menu laterale |
- | CTRL+C | + | |
- | sudo systemctl start home-assistant | + | **Sezione Zwave** |
+ | |||
+ | serial port: lasciare /dev/zwave (la mappatura viene fatta dal docker compose) | ||
+ | |||
+ | generare tutte e 4 le chiavi, S2 e S0, premendo sui pulsanti con le frecce circolari | ||
+ | |||
+ | **Sezione general** | ||
+ | |||
+ | enable log | ||
+ | |||
+ | scorrere in basso | ||
+ | |||
+ | abilitare " | ||
+ | |||
+ | **Sezione Home Assistant** | ||
+ | |||
+ | Abilitare WS server | ||
+ | |||
+ | **Salvare** | ||
+ | |||
+ | Dall' | ||
+ | |||
+ | Inserire come url: | ||
+ | < | ||
+ | ws:// | ||
</ | </ | ||
+ | Ora homeassistant è pronto per cercare nuovi dispositivi zwave, dalla schermata di configurazione dell' | ||
+ | ==== configurazioni z-wave vecchie ==== | ||
+ | |||
+ | TKB Home TZ10.XX / TZ10.36 termostato [[reference|< | ||
+ | |||
+ | <file txt / | ||
+ | SUBSYSTEM==" | ||
+ | </ | ||
+ | |||
+ | Add to ~/ | ||
+ | near < | ||
+ | < | ||
+ | <Product type=" | ||
+ | </ | ||
+ | |||
+ | wenzhou/ | ||
+ | < | ||
+ | <?xml version=" | ||
+ | <Product xmlns=' | ||
+ | < | ||
+ | < | ||
+ | <!-- This thermostat' | ||
+ | < | ||
+ | <Value type=" | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
===== reverse proxy ===== | ===== reverse proxy ===== | ||
Line 369: | Line 398: | ||
<code bash> | <code bash> | ||
sudo apt install incron | sudo apt install incron | ||
+ | </ | ||
+ | |||
+ | <code bash> | ||
+ | echo hass > / | ||
</ | </ | ||
Line 375: | Line 408: | ||
/ | / | ||
</ | </ | ||
+ | |||
+ | ===== grafana ===== | ||
+ | |||
+ | < | ||
+ | digraph G { | ||
+ | |||
+ | graph [rankdir = " | ||
+ | node [fontsize = " | ||
+ | edge [weight=1.0 | ||
+ | |||
+ | hass -> influxdb -> grafana -> browser | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | Add influxdb datasource{{ : | ||
+ | |||
+ | |||
+ | ===== alexa ===== | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | Modificare https:// | ||
+ | |||
+ | haaska.py gira come servizio sui lambda server amazon. Anziché leggere la configurazione (ad esempio bearer_token) da file, | ||
+ | prevedere una chiamata ad un web service esterno (ad esempio https:// | ||
+ | |||
+ | Sniffare i metodi: | ||
+ | * def get(self, endpoint): | ||
+ | * def post(self, endpoint, data, wait=False): |