++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Home assistant
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. include:: idBlock.rst
:Création: 03/2025
.. include:: tdm.rst
====================================================================================================
Préparation en avance de phase
====================================================================================================
Sur Rpi
----------------------------------------------------------------------------------------------------
C'est une distri complète
port: 8123
http://homeassistant.local:8123/hassio/system
Port observer : 4357
====================================================================================================
Install sur petit PC
====================================================================================================
La technique est de booter sur une liveCD en mode essais Ubuntu et de restaurer l'image.
La première fois ça s'est bien passsé
La deuxième fois j'ai bien galéré : ventoy refusait de se monter, je dt mettre l'image dans mount1to et
faire une restau avec la commane dd if=/... of=/dev/sda
Conseil lors de la première co : faire avec un cable réseau
.. image:: images/haPremierCo.JPG
:width: 300 px
Il faut créer un compte : jojo rintintin
.. image:: images/haCrerCompte.JPG
:width: 300 px
IL N'Y A PAS DE LOGIN PAR DEFAUT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Adresse de connexion homeassistant.local:8123
Quels objets
----------------------------------------------------------------------------------------------------
Si on prend la vidéo de Homemation (cf . chapitre présentation)::
prise
bouton
inter
relais
cpteur ouverture de prepaHomeAssist
détecteur de présence
détecteur d'eau
détecteur de fumée
détecteur de CO2 ou CO
détecteur de gaz
Sirène et clavier
Si on reprend la vidéo de Abrege, des objets en Zeegbee et c
`Prise connectée`_
.. _`Prise connectée` : https://fr.aliexpress.com/item/1005005734493134.html?aff_fcid=714d638d879b4328889ae6fb9fb83d79-1742440536913-05829-_okmPSiR&tt=CPS_NORMAL&aff_fsk=_okmPSiR&aff_platform=shareComponent-detail&sk=_okmPSiR&aff_trace_key=714d638d879b4328889ae6fb9fb83d79-1742440536913-05829-_okmPSiR&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
`Capteur PIR`_
.. _`Capteur PIR` : https://fr.aliexpress.com/item/1005007370984412.html?aff_fcid=b136d44a5a2e4464879794e5a71cf65d-1742440667580-00768-_opIrCSr&tt=CPS_NORMAL&aff_fsk=_opIrCSr&aff_platform=shareComponent-detail&sk=_opIrCSr&aff_trace_key=b136d44a5a2e4464879794e5a71cf65d-1742440667580-00768-_opIrCSr&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
Capteur de présence
Capteur ouverture de porte
`Capteur Temp/Hum`_
.. _`Capteur Temp/Hum` : https://fr.aliexpress.com/item/1005006877804846.html?aff_fcid=a1beba185b6e479a8d140368e3cb03ef-1742440841376-04695-_oBjeCo7&tt=CPS_NORMAL&aff_fsk=_oBjeCo7&aff_platform=shareComponent-detail&sk=_oBjeCo7&aff_trace_key=a1beba185b6e479a8d140368e3cb03ef-1742440841376-04695-_oBjeCo7&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
`Capteur Temp/Hum (Aqara)`_
.. _`Capteur Temp/Hum (Aqara)` : https://fr.aliexpress.com/item/1005006794094479.html?aff_fcid=760b448a9ef449248d612c5b55716a3f-1742440870733-00463-_onMMrGB&tt=CPS_NORMAL&aff_fsk=_onMMrGB&aff_platform=shareComponent-detail&sk=_onMMrGB&aff_trace_key=760b448a9ef449248d612c5b55716a3f-1742440870733-00463-_onMMrGB&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
`Capteur Plante`_
.. _`Capteur Plante` : https://fr.aliexpress.com/item/1005007443398328.html
`Remote Infrarouge`_
.. _`Remote Infrarouge` : https://fr.aliexpress.com/item/1005005763594856.html?aff_fcid=ad61ba2798f14ab9907523b32698d1e6-1742440952678-01577-_oEAqbbd&tt=CPS_NORMAL&aff_fsk=_oEAqbbd&aff_platform=shareComponent-detail&sk=_oEAqbbd&aff_trace_key=ad61ba2798f14ab9907523b32698d1e6-1742440952678-01577-_oEAqbbd&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
`Bouton poussoir (Aqara)`_
.. _`Bouton poussoir (Aqara)` : https://fr.aliexpress.com/item/4001021237879.html?aff_fcid=403be34238184f45bb87ae5a06efb2cd-1742440988197-00782-_o2cabb5&tt=CPS_NORMAL&aff_fsk=_o2cabb5&aff_platform=shareComponent-detail&sk=_o2cabb5&aff_trace_key=403be34238184f45bb87ae5a06efb2cd-1742440988197-00782-_o2cabb5&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
`Interrupteur x4`_
.. _`Interrupteur x4` : https://fr.aliexpress.com/item/1005004986809020.html?aff_fcid=def9ea58929448ee8ef87b9faa62744a-1742441013733-00859-_oDuO9tZ&tt=CPS_NORMAL&aff_fsk=_oDuO9tZ&aff_platform=shareComponent-detail&sk=_oDuO9tZ&aff_trace_key=def9ea58929448ee8ef87b9faa62744a-1742441013733-00859-_oDuO9tZ&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
`Ampoule`_ 2 modèle 1 wifi et l'autre zeegbee
.. _`Ampoule` : https://fr.aliexpress.com/item/1005006724896566.html?aff_fcid=233e15571375476ba1ccef07a92c35d9-1742441037759-00449-_o2CKg0L&tt=CPS_NORMAL&aff_fsk=_o2CKg0L&aff_platform=shareComponent-detail&sk=_o2CKg0L&aff_trace_key=233e15571375476ba1ccef07a92c35d9-1742441037759-00449-_o2CKg0L&terminal_id=81536c240d764e3984840f8083a1a70b&afSmartRedirect=y
Ampoule (Philips HUE)
Les switchbot plus : https://www.lesalexiens.fr/actualites/switchbot-etend-compatibilite-home-assistant/
====================================================================================================
Automatisation
====================================================================================================
.. raw:: html
====================================================================================================
Zigbee Compatibility list
====================================================================================================
https://zigbee.blakadder.com/
====================================================================================================
Tamsota sur SONOFF MINI R4
====================================================================================================
https://notenoughtech.com/home-automation/sonoff-minir4-extreme-released-and-flashed-with-tasmota/
====================================================================================================
Tasmota basic R2
====================================================================================================
https://www.tutos.eu/6215
https://medium.com/@jordanrounds/sonoff-basic-r2-tasmota-aa6f9d4e033f
====================================================================================================
Air Quality For Home Assistant
====================================================================================================
`AIR-1 Air Quality For Home Assistant - with CO2 sensor`_ le prix !
.. _`AIR-1 Air Quality For Home Assistant - with CO2 sensor` : https://opencircuit.shop/product/air-1-air-quality-home-assistant-co2-sensor
.. image:: images/airQualityForHa_ducommerce.JPG
:width: 600 px
`The Smart Home Sensors I NEVER knew I needed!`_
.. _`The Smart Home Sensors I NEVER knew I needed!` : https://www.youtube.com/watch?v=pAT1TCYY73c
.. raw:: html
10 références différentes sous la vidéo et plus particulièrement 6 mesurent le CO2.
- aranet4: https://amzn.to/4fv50HJ **199€**
- AirGradient indoor (my favorite): https://www.airgradient.com/indoor/?r... **195usd** !
- Apollo MTR-1: https://apolloautomation.com/products... (ci-dessus)
- Airlytix ES1: https://lectronz.com/products/airlyti... 174€ celui que je voulais faire prendre au Bricolab mais en rupture
- Airthings View Plus: https://amzn.to/4d95QIT
- Ecobee Premium (thermostat monitors for CO2): https://amzn.to/3YtVJcU
- IKEA VINDSTYRKA: https://www.ikea.com/us/en/p/vindstyr...
- Amazon air quality: https://amzn.to/3LS1Lge
- Eve Room: https://amzn.to/4fu8WIO
- AirGradient outdoor: https://www.airgradient.com/outdoor/?...
====================================================================================================
TPLINK
====================================================================================================
https://www.home-assistant.io/integrations/tplink/
====================================================================================================
ESP32-CAM
====================================================================================================
`ESP32 CAM - Capteur image OV2640 - Généralités (CMOS, Matrice Bayer, RGB, YUV, résolution, fps...)`_
et la suivante :
`ESP32 CAM - Utilisation et Réglages de la caméra - Serveur WEB`_
.. _`ESP32 CAM - Utilisation et Réglages de la caméra - Serveur WEB` : https://www.youtube.com/watch?v=o6QtKzEDXSY
Mettre TASMOTA : cf. Frères Poulain
`Caméra sans fil WIFI à 5€ incroyable ! DIY Vidéosurveillance Raspberry Pi [Chmaude77 - EP03]`_
.. _`Caméra sans fil WIFI à 5€ incroyable ! DIY Vidéosurveillance Raspberry Pi [Chmaude77 - EP03]` : https://www.youtube.com/watch?v=YIt121zebMM&list=PLuyMGpc2xoZsA1I3FZja4zWzV-m3GZmfA&index=7
.. raw:: html
Excellent !
.. admonition:: **SITE DE RESSOURCES**
:class: SEEALSO
`ESP32-CAM Video Streaming Web Server (works with Home Assistant)`_
.. _`ESP32-CAM Video Streaming Web Server (works with Home Assistant)` : https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/
.. _`ESP32 CAM - Capteur image OV2640 - Généralités (CMOS, Matrice Bayer, RGB, YUV, résolution, fps...)` : https://www.youtube.com/watch?v=Qbs_haLx3PE&list=PLKV-I2qagq6-B-XQLhqnvTle8ndIO135k&index=12
====================================================================================================
Pus généralement un cam ip avec Raspberry pi
====================================================================================================
**A REVOIR**
----------------------------------------------------------------------------------------------------
https://www.home-assistant.io/integrations/camera
https://www.youtube.com/watch?v=j9Z0KBuwEGI
avec motioneye, mes tentatives:
----------------------------------------------------------------------------------------------------
- motioneyeOS : KO : ne se connecte pas au wifi et cel s'explique
- depuis le `github de base`_ avec python3.7 : ✅
.. _`github de base` : https://github.com/motioneye-project/motioneye
Essai réalisé avec::
Linux lab1 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
host: lab1.local
Raspberry pi 4
**Motioneye port : 8765**
Test fonctionnement camera en local dans le pi::
vcgencmd get_camera
libcamera-still -o test.jpg
sudo v4l2-ctl --list-devices
2 cameras usb fonctionnelles dont Arducam module 3 avec interface usb-c:
`Module de caméra USB 60 fps 0,3 mp - Module de webcam grand angle VGA - Objectif 480P 3,6 mm`_
.. figure:: images/71prDvIktGS._AC_SL1500_.jpg
:width: 300 px
:figwidth: 100%
:target: https://www.amazon.fr/Module-cam%C3%A9ra-USB-fps-iint%C3%A9gr%C3%A9e/dp/B0B6N7XDKX/ref=sr_1_17?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&sr=8-17
:align: center
*lien externe*
`12MP IMX708 USB UVC Fixed-Focus Camera Module 3`_
.. figure:: images/arducam12mpusbc.JPG
:width: 300 px
:figwidth: 100%
:target: https://www.arducam.com/product/12mp-imx708-usb-uvc-fixed-focus-camera-module-3/
:align: center
*lien externe*
.. _`12MP IMX708 USB UVC Fixed-Focus Camera Module 3` : https://www.arducam.com/product/12mp-imx708-usb-uvc-fixed-focus-camera-module-3/
.. _`Module de caméra USB 60 fps 0,3 mp - Module de webcam grand angle VGA - Objectif 480P 3,6 mm` :
mais pour la cam : `RPi Camera 3 compatibility`_
.. _`RPi Camera 3 compatibility` : https://github.com/motioneye-project/motioneye/issues/2683
Last commande::
libcamera-vid --help
libcamera-vid -t 10s -o test.mp4 : n'a pas marché
.. admonition:: **SITE OFFICIEL**
:class: SEEALSO
`About the Camera Modules`_
.. _`About the Camera Modules` : https://www.raspberrypi.com/documentation/accessories/camera.html#about-the-camera-modules
Démarrer meye::
sudo meyectl startserver -b -c /etc/motioneye/motioneye.conf
Vérifier motioneye::
sudo systemctl status motioneye
It works : il faut choisir Local MMAL device et surtout
.. image:: images/meye_MMAL_2025-04-09_233603.jpg
:width: 300 px
Dans le config.txt juste::
start_x=1
# camera_auto_detect=0
# dtoverlay=ov5647
vcgencmd get_camera doit retorner::
supported=1 detected=1, libcamera interfaces=0
Testé avec la cam officielle pi v1.3 et la v2.1 + camera IR Aliexpress
.. image:: images/camAlimExpressIR2025-04-09_235847.jpg
:width: 300 px
Mais toujours pas la v3, mêm si vcgebcmd donne toujours le même résultat
Pas mieux avec l'ARDUCAM 12MP
Avec un pi0W
----------------------------------------------------------------------------------------------------
Fonctionne avec cam v1.3
Attention cable adaptation arducam uc-376 connexions vers le bas sur le pi
frame rate faible !! même en 320x240
Petite subtilité, il faut pas aller chercher la MMAl dans le même menu déroulant ! Mais dans les v4L2
Conclusions
----------------------------------------------------------------------------------------------------
Fonctionnel mais avec le pi zero faut pas trop rêver ! Faire un essais avec un pi3
====================================================================================================
Camera dans Home assistant
====================================================================================================
`Caméras dans Home Assistant : Le Guide Complet`_ de la chaine GammaTroniques
.. _`Caméras dans Home Assistant : Le Guide Complet` : https://www.youtube.com/watch?v=mVX3qoaAHNE
.. raw:: html
====================================================================================================
Matériel Shelly
====================================================================================================
Apparament ne font que des modules WiFi ou BT pas de zigbee ou autre en vue sur AMAZON
====================================================================================================
MOES
====================================================================================================
Zigbee light sensor : compatible ou pas : pas dans la liste en tout cas
.. raw:: html
====================================================================================================
Videos en vrac
====================================================================================================
====================================================================================================
Wifi bridge
====================================================================================================
`Raspberry Pi WiFi Ethernet Bridge`_ on ne sait jamais cela peut servir
.. _`Raspberry Pi WiFi Ethernet Bridge` : https://www.willhaley.com/blog/raspberry-pi-wifi-ethernet-bridge/
====================================================================================================
Air quality ultim sensor
====================================================================================================
A développer car ceux du commercent n'ont pas tout:
- Temp
- Hum
- CO2
- CO
- PM2.5
- PM
- VOC
- Ozone
Cf. également dans notesPerso Embryons de projet même si il n'y a pas grand switchbot-etend-compatibilite-home-assistant
Constitution d'un dossier projets pour colecte des données:
`Hack the IKEA Air Quality Sensor: 7-in-1- Full ESPHome Tutorial`_
.. _`Hack the IKEA Air Quality Sensor: 7-in-1- Full ESPHome Tutorial` : https://www.youtube.com/watch?v=YmqtMTO5NVc
.. raw:: html
.. raw:: html
====================================================================================================
ESPHome
====================================================================================================
.. admonition:: **SITE OFFICIEL**
:class: SEEALSO
`ESPHome`_
.. _`ESPHome` : https://esphome.io/
.. admonition:: **SITE DE RESSOURCES OFFICIEL**
:class: SEEALSO
`Ready-Made Projects`_
.. _`Ready-Made Projects` : https://esphome.io/projects/index.html
.. admonition:: **SITE DE RESSOURCES OFFICIEL**
:class: SEEALSO
`DIY Examples`_
.. _`DIY Examples` : https://esphome.io/guides/diy.html
====================================================================================================
Integration d'un Zigbee DIY
====================================================================================================
Tout d'abord ESP32-C6 support dans plateformio et dans l'IDE Arduino
Dans cette vidéo de la chaîne GammaTroniques
.. raw:: html
cf. aussi dans note perso ESP32
====================================================================================================
Mes possessions
====================================================================================================
Interrupteur Mural
----------------------------------------------------------------------------------------------------
`MOES Interrupteur Mural Intelligent`_ AMAZON 2 à 28€
.. _`MOES Interrupteur Mural Intelligent` : https://www.amazon.fr/dp/B096W232HT
.. image:: images/moesInterrupteurZigbee.JPG
:width: 300 px
Prises TpLink
----------------------------------------------------------------------------------------------------
`Tapo Prise Connectée WiFi`_ AMAZON 2 x 14.33€
.. _`Tapo Prise Connectée WiFi` : https://www.amazon.fr/dp/B09J1497Y4
Lampes
----------------------------------------------------------------------------------------------------
`Tuya E27 Zigbee ampoule LED WiFi lampe à LED`_ Aliexpress 2x 4.79€
.. _`Tuya E27 Zigbee ampoule LED WiFi lampe à LED` : https://fr.aliexpress.com/item/1005006724896566.html?spm=a2g0o.order_list.order_list_main.18.2d535e5bDveIt4&gatewayAdapt=glo2fra
.. image:: images/tuyaAmpiule18WZigbeeAlie.JPG
:width: 300 px
Boutons
----------------------------------------------------------------------------------------------------
Bouton sans marque
.. image:: images/boutonZigbeeAliexpressSansMarque.JPG
:width: 300 px
https://fr.aliexpress.com/item/1005006878553188.html?spm=a2g0o.order_list.order_list_main.12.4b915e5bvwTIjr&gatewayAdapt=glo2fra
Bouton WiFi Tuya
----------------------------------------------------------------------------------------------------
`UrbanNest Tuya WiFi Bouton Interrupteur`_ à 14.69€ fonctionne avec des piles AAA non fournies.
.. _`UrbanNest Tuya WiFi Bouton Interrupteur` : https://www.amazon.fr/dp/B0D13S2773
L'intégration Tuya dans HA n'est pas terrible. Il faut obligatoirement passer par l'application SmartLife
C'est du mode Cloud
Articles:
`Interrupteur wifi tuya`_
.. _`Interrupteur wifi tuya` : https://forum.hacf.fr/t/interrupteur-wifi-tuya/2803
`Home Assistant & Tuya zéro cloud`_ parait complexe...
.. _`Home Assistant & Tuya zéro cloud` : https://www.canaletto.fr/post/home-assistant-and-tuya-zero-cloud
Zigbee
----------------------------------------------------------------------------------------------------
Sonoff Zigbee::
2 boutons SONOFF SNZB-01P 2x10.29€
1 capteur de présence 12.89€
.. image:: images/sonoffZigbeeAliexpress01.JPG
:width: 300 px
====================================================================================================
Weblinks
====================================================================================================
.. target-notes::