Auto-update blog content from Obsidian: 2025-06-27 07:24:19
All checks were successful
Blog Deployment / Check-Rebuild (push) Successful in 5s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 9s
Blog Deployment / Test-Staging (push) Successful in 3s
Blog Deployment / Merge (push) Successful in 6s
Blog Deployment / Deploy-Production (push) Successful in 9s
Blog Deployment / Test-Production (push) Successful in 3s
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Successful in 2s

This commit is contained in:
Gitea Actions
2025-06-27 07:24:19 +00:00
parent a7fc4cae7b
commit bfb1dbf1d3
5 changed files with 103 additions and 12 deletions

View File

@@ -1,11 +1,15 @@
--- ---
slug: ac-automation-home-assistant-node-red slug: ac-automation-home-assistant-node-red
title: home-assistant-node-red-ac-automation title: Full AC Automation with Home Assistant and Node-RED
description: description: How I automate my AC with Home Assistant and Node-RED to react to temperature, humidity and all daily events.
date: date: 2025-06-27
draft: true draft: true
tags: tags:
- home-automation
- home-assistant
- node-red
categories: categories:
- automation
--- ---
## Intro ## Intro
@@ -662,8 +666,36 @@ The second node is another `call service node` which will start the lock timer o
#### 17. Manual Intervention #### 17. Manual Intervention
Sometime, for some reason, we want to use the AC manually. When we do, we don't want the workflow to change our manual setting, at least for some time. Sometime, for some reason, we want to use the AC manually. When we do, we don't want the workflow to change our manual setting, at least for some time. Node-RED is using its own user in Home Assistant, so when an AC unit change state without this user, this was manually done.
The first node is a `trigger state node`, which will send a message when any AC unit is changing state: The first node is a `trigger state node`, which will send a message when any AC unit is changing state:
![Pasted_image_20250626221149.png](img/Pasted_image_20250626221149.png) ![Pasted_image_20250626221149.png](img/Pasted_image_20250626221149.png)
The second is a `function node` which willassociate the unit with its timer:
```js
const association = {
"climate.clim_salon": "timer.minuteur_clim_salon",
"climate.clim_chambre": "timer.minuteur_clim_chambre",
"climate.clim_couloir": "timer.minuteur_clim_couloir"
};
msg.payload = association[msg.topic];
return msg;
```
The third is a `switch node` that will let through the message when the user_id is not the Node-RED user's one:
![Node-RED switch node not specific user_id](img/node-red-switch-node-user-id.png)
The fourth is another `switch node` which checks if there are any `user_id`:
![Node-RED switch node check user_id not null](img/node-red-switch-node-check-user-id.png)
Lastly, the final node is a `call service node` using `start` service on the unit's timer with its default duration (60 minutes):
![Node-RED call service node start timer with default duration](img/node-red-call-service-node-start-unit-timer.png)
## TL;DR
With this setup, my AC system is fully automated, from cooling in summer to warming in winter, while keeping in check the humidity level.
This required quite a lot of thinking, tweaking and testing, but finally I'm now very happy with the results, that's why I'm sharing it with you, to give you some ideas about what you can do in home automation.
If you think I could have done things differently, please reach out to me to discuss about it, do not hesitate to share your ideas as well!

View File

@@ -1,11 +1,15 @@
--- ---
slug: ac-automation-home-assistant-node-red slug: ac-automation-home-assistant-node-red
title: home-assistant-node-red-ac-automation title: " Automatisation complète de la clim avec Home Assistant et Node-RED"
description: description: Comment jautomatise ma clim avec Home Assistant et Node-RED pour réagir à la température, lhumidité et à tous les évènements quotidiens.
date: date: 2025-06-27
draft: true draft: true
tags: tags:
- home-automation
- home-assistant
- node-red
categories: categories:
- automation
--- ---
## Intro ## Intro
@@ -644,7 +648,62 @@ Le premier nœud est un autre `call service node` utilisant le service `set_temp
Encore une fois, ce nœud est suivi dun `delay node` de 5 secondes. Encore une fois, ce nœud est suivi dun `delay node` de 5 secondes.
#### 15. #### 15. Vérification
#### 16.
#### 17. Laction `check` est utilisée presque tout le temps. Elle consiste uniquement à vérifier et comparer la vitesse de ventilation souhaitée, et à la modifier si nécessaire.
Le premier nœud est un `switch node` qui vérifie si la valeur `speed` est définie :
![Node-RED switch node to test if speed is defined](img/node-red-switch-node-fan-speed.png)
Le deuxième est un autre `switch node` qui compare la valeur `speed` avec la vitesse actuelle :
![Node-Red switch node to compare speed](img/node-red-switch-node-compare-speed.png)
Enfin, le dernier nœud est un `call service node` utilisant le service `set_fan_mode` pour définir la vitesse du ventilateur :
![Node-RED call service node with set_fan_mode](img/node-red-call-service-node-set-fan-mode.png)
#### 16. Arrêt
Lorsque laction est `stop`, lunité de climatisation est simplement arrêtée.
Le premier nœud est un `call service node` utilisant le service `turn_off` :
![Node-RED call service node with turn_off service](img/node-red-call-service-node-turn-off.png)
Le deuxième nœud est un autre `call service node` qui va démarrer le minuteur de verrouillage de cette unité pour 45 secondes.
#### 17. Intervention Manuelle
Parfois, pour une raison ou une autre, on souhaite utiliser la climatisation manuellement. Dans ce cas, on ne veut pas que le flux Node-RED vienne écraser notre réglage manuel, du moins pendant un certain temps.
Node-RED utilise son propre utilisateur dans Home Assistant, donc si une unité change détat sans cet utilisateur, cest quune intervention manuelle a eu lieu.
Le premier nœud est un `trigger state node`, qui envoie un message dès quune unité AC change détat :
![Pasted_image_20250626221149.png](img/Pasted_image_20250626221149.png)
Le deuxième est un `function node` qui associe lunité avec son minuteur :
```js
const association = {
"climate.clim_salon": "timer.minuteur_clim_salon",
"climate.clim_chambre": "timer.minuteur_clim_chambre",
"climate.clim_couloir": "timer.minuteur_clim_couloir"
};
msg.payload = association[msg.topic];
return msg;
```
Le troisième est un `switch node` qui laisse passer le message uniquement si le `user_id` **nest pas** celui de Node-RED :
![Node-RED switch node not specific user_id](img/node-red-switch-node-user-id.png)
Le quatrième est un autre `switch node` qui vérifie que le champ `user_id` **est bien défini** :
![Node-RED switch node check user_id not null](img/node-red-switch-node-check-user-id.png)
Enfin, le dernier nœud est un `call service node` utilisant le service `start` sur le minuteur de lunité, avec sa durée par défaut (60 minutes) :
![Node-RED call service node start timer with default duration](img/node-red-call-service-node-start-unit-timer.png)
## TL;DR
Avec cette configuration, mon système de climatisation est entièrement automatisé, du refroidissement en été au chauffage en hiver, tout en gardant un œil sur le taux dhumidité.
Cela ma demandé pas mal de réflexion, dajustements et de tests, mais au final je suis vraiment satisfait du résultat. Cest pourquoi je le partage ici, pour vous donner des idées sur ce quon peut faire en domotique.
Si vous pensez que certaines choses pourraient être faites autrement, nhésitez pas à me contacter pour en discuter ou me proposer de nouvelles idées!

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB