Alors voici ce que j’ai configuré pour exploiter mon poêle via HA et le module wifi (winet) de celui-ci qui a pour adresse IP 192.168.0.70 :
- Tout d’abord les REST sensors qui me permettent de récupérer les variables d’états du poêle (il me reste encore des paramètres à identifier) :
sensor:
- platform: rest
resource: http://192.168.0.70/ajax/get-registers
method: POST
name: poele_variables2
scan_interval: 300 #300s
payload: key=020&category=2
json_attributes:
- params
- alr
- localWeb
- cat
- authLevel
- signal
- model
- flame
- chrono
- name
- netatmo
verify_ssl: false
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 18 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
- platform: rest
resource: http://192.168.0.70/ajax/get-registers
method: POST
name: poele_variables4
scan_interval: 300 #300s
payload: key=020&category=4
verify_ssl: false
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 18 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
- platform: rest
resource: http://192.168.0.70/ajax/get-registers
method: POST
name: poele_variables6
scan_interval: 300 #300s
payload: key=020&category=6
verify_ssl: false
value_template: '{{ value_json["params"] }}' ## value template utilisé pour tronquer la reponse car plus de 255 caractères et ne garder que le contenus de params..., avoids the "State max length is 255 characters" error
json_attributes:
- params
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 18 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
- Ensuite, j’ai créé quelques template sensors supplémentaires pour extraire les variables les plus intéressantes :
template:
- sensor:
- name: "statut poele"
unique_id: poele_statut
state: >
{% set names = {
0: "OFF",
1: "En attente de redémarrage",
2: "Allumage",
3: "3???",
4: "Flamme presente",
5: "Travail",
6: "Nettoyage brasier",
7: "Nettoyage final",
8: "Eco stop",
9: "?9?",
10: "?10?"
} %} #il faut encore que j'identifie certains états du poêle en regardant ce qu’affiche l'application officielle mais je n'ai pas encore eu besoin de chauffer vraiment la maison pour le moment...
{% set status = names[state_attr('sensor.poele_variables2','params')[1][1]] %}
{{status}}
icon: >
{% if is_state("sensor.statut_poele", "OFF") %}
mdi:fireplace-off
{% else %}
mdi:fireplace
{% endif %}
attributes:
poele_id2: "{{state_attr('sensor.poele_variables2','params')[1][1]}}"
- name: "poele_reglage_temperature"
unique_id: poele_reglage_temperature
device_class: temperature
unit_of_measurement: '°C'
state: "{{state_attr('sensor.poele_variables2','params')[8][1] }}"
- name: "poele_sonde_telecommande"
unique_id: poele_sonde_telecommande
device_class: temperature
unit_of_measurement: '°C'
state: "{{state_attr('sensor.poele_variables2','params')[4][1] }}"
- name: "poele_reglage_puissance"
unique_id: poele_reglage_puissance
state: "{{state_attr('sensor.poele_variables2','params')[9][1] }}"
- name: "ventilation arriere poele"
unique_id: poele_ventilation_arriere_level
state: >
{% set names = {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "AUTO"
} %}
{% set level_ventil_arriere = names[state_attr('sensor.poele_variables6','params')[8][1]] %}
{{level_ventil_arriere}}
attributes:
poele_id187: "{{state_attr('sensor.poele_variables6','params')[8][1]}}"
- name: "ventilation avant poele"
unique_id: poele_ventilation_avant_level
state: >
{% set names = {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "AUTO"
} %}
{% set level_ventil_avant = names[state_attr('sensor.poele_variables6','params')[9][1]] %}
{{level_ventil_avant}}
attributes:
poele_id188: "{{state_attr('sensor.poele_variables6','params')[9][1]}}"
- et ci-dessous les commandes qui me permettent de piloter le poêle avec des REST command ( j’utilise des input_number pour changer les consignes) :
rest_command:
allumer_ou_eteindre_poele:
url: http://192.168.0.70/ajax/get-registers
method: POST
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 7 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
payload: key=022
maj_consigne_temperature_poele:
url: http://192.168.0.70/ajax/set-register
method: POST
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 47 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
payload: key=002&memory=1®Id=50&value={{states('input_number.consigne_temperature_poele')| int }}&result=false
maj_consigne_puissance_poele:
url: http://192.168.0.70/ajax/set-register
method: POST
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 46 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
payload: key=002&memory=1®Id=51&value={{states('input_number.consigne_puissance_poele')| int }}&result=false
maj_consigne_ventilation_avant_poele:
url: http://192.168.0.70/ajax/set-register
method: POST
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 47 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
payload: key=002&memory=1®Id=188&value={{ states('input_number.consigne_ventilation_avant_poele')| int }}&result=false
maj_consigne_ventilation_arriere_poele:
url: http://192.168.0.70/ajax/set-register
method: POST
headers:
Accept: 'application/json, text/javascript, */*; q=0.01'
Accept-Encoding: 'gzip, deflate'
Accept-Language: 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
Connection: keep-alive
Content-Length: 47 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.0.70
Origin: http://192.168.0.70
Referer: http://192.168.0.70/management.html
User-Agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.43'
X-Requested-With: XMLHttpRequest
payload: key=002&memory=1®Id=187&value={{ states('input_number.consigne_ventilation_arriere_poele')| int }}&result=false
Voilà, en espérant que ça pourra aider. Je ne sais pas si tout sera générique pour tous les poêles/module wifi… Si besoin de plus d’explications/détails, n’hésitez pas.