Bonjour
j’avais le projet de connecter mon poêle a granules Chazelles à ma domotique home assistant.
Je dispose d’un module wifi winnet connecté au poêle, c’est la même technique que les poêles Ravelli (entre autres). Et je me suis fortement appuyé sur les posts de @Aubusson avec la même démarche, en particulier sniffer les échanges entre l’application sur mon PC et le serveur fourni par le module wifi.
Voir le sujet https://forum.hacf.fr/t/piloter-son-poele-ravelli/15244/14
Voila le résultat: Je reproduit dans HA les données et les commandes de l’application native android (Chazelles connector, ou Ravelli smart Wi-Fi ou Winnet Connector)
#####################################
######### Intégration poele à granules Chazelles
#####################################
######### Requete de lecture des données du poele
#####################################
sensor:
- platform: rest
resource: http://192.168.1.xxx/ajax/get-registers
method: POST
name: poele_variables2
unique_id: poele_variables2
scan_interval: 15 #15s
payload: key=020&category=2
json_attributes:
- ram
- eep
- localWeb
- bk
- authLevel
- model
- allowRemoteControl
- ccode
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.1.xxx
Origin: http://192.168.1.xxx
Referer: http://192.168.1.xxx/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
##############################
##### variables temporaires
##############################
input_number:
temp_reglage_temperature:
name: temp_reglage_temperature
min: 10
max: 40
temp_reglage_puissance:
name: temp_reglage_puissance
min: 1
max: 5
##############################
###### Extraction des données primaires
##############################
template:
sensor:
- name: "statut poele"
unique_id: 'statut_poele'
state: >
{% set names = {
0: "Arrêt",
1: "Allumage",
2: "Prechauffage",
3: "Chauffage en cours",
4: "Modulation",
6: "Nettoyage final",
7: "Refroidissement en cours",
8: "Alarme",
9: "Mémoire alarme"
} %}
{% set status = names[state_attr('sensor.poele_variables2','ram')[3][2]] %}
{{status}}
icon: >
{% if is_state("sensor.statut_poele", "Arrêt") %}
mdi:fireplace-off
{% else %}
mdi:fireplace
{% endif %}
attributes:
poele_id2: "{{state_attr('sensor.poele_variables2','ram')[3][2]}}"
- name: "poele_reglage_temperature"
unique_id: poele_reglage_temperature
device_class: temperature
unit_of_measurement: '°C'
state: "{{state_attr('sensor.poele_variables2','eep')[0][2] }}"
- name: "poele_reglage_puissance"
unique_id: poele_reglage_puissance
state: "{{state_attr('sensor.poele_variables2','eep')[1][2] }}"
- name: "poele_sonde_temperature"
unique_id: poele_sonde_temperature
device_class: temperature
unit_of_measurement: '°C'
state: "{{state_attr('sensor.poele_variables2','ram')[0][2] |float / 2 | float }}"
- name: "poele_puissance_actuelle"
unique_id: poele_puissance_actuelle
state: "{{state_attr('sensor.poele_variables2','ram')[5][2] }}"
- name: "poele_temperature_combustion"
unique_id: poele_temperature_combustion
device_class: temperature
unit_of_measurement: '°C'
state: "{{ (( state_attr('sensor.poele_variables2','ram')[1][2] | float
+ state_attr('sensor.poele_variables2','ram')[2][2] | float )
+ 10 ) | int }}"
- name: "poele_vitesse_extracteur_gaz"
unique_id: poele_vitesse_extracteur_gaz
unit_of_measurement: 'rpm'
state: "{{ (( state_attr('sensor.poele_variables2','ram')[6][2] | float * 10 ) | float + 250 ) | int }}"
#####################################
####### commandes vers le poele
#####################################
rest_command:
allumer_ou_eteindre_poele:
url: http://192.168.1.xxx/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.1.xxx
Origin: http://192.168.1.xxx
Referer: http://192.168.1.xxx/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.1.xxx/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: 35 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.1.xxx
Origin: http://192.168.1.xxx
Referer: http://192.168.1.xxx/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=125&value={{states('input_number.temp_reglage_temperature') | int }}
maj_consigne_puissance_poele:
url: http://192.168.1.xxx/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: 34 #correspond au nombre de caractères dans le payload !
Content-Type: 'application/json; charset=UTF-8'
Cookie: winet_lang=fr
Host: 192.168.1.xxx
Origin: http://192.168.1.xxx
Referer: http://192.168.1.xxx/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=127&value={{states('input_number.temp_reglage_puissance')| int }}
#################################
####### les scripts pour MAJ des valeurs de consigne
#################################
increment_puissance:
alias: 'Poele_increment_puissance:'
sequence:
- condition: numeric_state
entity_id: sensor.poele_reglage_puissance
below: 5
- service: input_number.set_value
data:
entity_id: input_number.temp_reglage_puissance
value: '{{ ( states(''sensor.poele_reglage_puissance'') | float + 1 ) | round
(0) }}'
- service: rest_command.maj_consigne_puissance_poele
data: {}
- service: homeassistant.update_entity
data: {}
target:
entity_id: sensor.poele_variables2
mode: single
decrement_puissance:
alias: 'Poele_decrement_puissance:'
sequence:
- condition: numeric_state
entity_id: sensor.poele_reglage_puissance
above: 1
- service: input_number.set_value
data:
entity_id: input_number.temp_reglage_puissance
value: '{{ ( states(''sensor.poele_reglage_puissance'') | float - 1 ) | round
(0) }}'
- service: rest_command.maj_consigne_puissance_poele
data: {}
- service: homeassistant.update_entity
data: {}
target:
entity_id: sensor.poele_variables2
mode: single
poele_decrement_temperature:
alias: Poele_decrement_température
sequence:
- condition: numeric_state
entity_id: sensor.poele_reglage_temperature
above: 10
- service: input_number.set_value
data:
entity_id: input_number.temp_reglage_temperature
value: '{{ ( states(''sensor.poele_reglage_temperature'') | float - 1 ) | round
(0) }}'
- service: rest_command.maj_consigne_temperature_poele
data: {}
- service: homeassistant.update_entity
data: {}
target:
entity_id: sensor.poele_variables2
mode: single
poele_increment_temperature:
alias: Poele_increment_temperature
sequence:
- condition: numeric_state
entity_id: sensor.poele_reglage_temperature
below: 40
- service: input_number.set_value
data:
entity_id: input_number.temp_reglage_temperature
value: '{{ ( states(''sensor.poele_reglage_temperature'') | float + 1 ) | round
(0) }}'
- service: rest_command.maj_consigne_temperature_poele
data: {}
- service: homeassistant.update_entity
data: {}
target:
entity_id: sensor.poele_variables2
mode: single
#################################
####### les cartes lovelace (pour reproduire le site origine
#################################
type: vertical-stack
cards:
- type: markdown
content: <center>Poêle véranda
card_size: 20px
card_mod:
style: |
ha-card {
font-size: 25px;
color: black;
font-weight: bold ;
background-color: rgb(235, 222, 219) ;
}
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.statut_poele
show_header_toggle: false
state_color: true
show_state: true
show_icon: false
name: Statut actuel
tape_action: none
card_mod:
style: |
ha-card {
font-size: 18px;
font-weight: bold ;
color: black ;
height: 110px ;
background-color: rgb(235, 222, 219) ;
}
- type: custom:button-card
show_name: true
show_icon: true
card_mod:
style: |
ha-card {
color: black ;
height: 110px ;
background-color: rgb(233, 191, 182) ;
}
icon: mdi:close-octagon
color: black
name: attendre
entity: sensor.statut_poele
state:
- operator: template
value: '[[[ return entity.attributes.poele_id2 == ''0'' ]]]'
color: red
icon: mdi:fire
name: Allumage
- operator: template
value: |-
[[[ return (entity.attributes.poele_id2 == '3' ||
entity.attributes.poele_id2 == '4') ]]]
color: green
icon: mdi:fireplace
name: Arrêt
tape_action: none
hold_action:
action: call-service
service: |
[[[
if ( entity.attributes.poele_id2 == '0' ||
entity.attributes.poele_id2 == '3' ||
entity.attributes.poele_id2 == '4' )
return 'rest_command.allumer_ou_eteindre_poele';
else
return 'none';
]]]
- type: entities
entities:
- entity: sensor.poele_sonde_temperature
name: T° ambiante
- entity: sensor.poele_temperature_combustion
name: T° gaz combustion
- entity: sensor.poele_puissance_actuelle
name: Puissance actuelle
icon: mdi:flash
- entity: sensor.poele_vitesse_extracteur_gaz
name: Vitesse extracteur gaz
icon: mdi:fan
card_mod:
style: |
ha-card {
font-size: 18px;
color: black ;
background-color: rgb(235, 222, 219) ;
}
- type: markdown
content: <center>Réglage température de consigne
card_mod:
style: |
ha-card {
font-size: 20px;
color: black ;
font-weight: bold ;
background-color: rgb(235, 222, 219) ;
}
- type: horizontal-stack
cards:
- show_name: false
show_icon: true
type: button
card_mod:
style: |
ha-card {
color: black ;
background-color: rgb(233, 191, 182) ;
}
tap_action:
action: call-service
service: script.poele_decrement_temperature
data: {}
target: {}
entity: sensor.poele_reglage_temperature
icon: mdi:minus-box
icon_height: 40px
- show_name: false
show_icon: false
type: custom:button-card
card_mod:
style: |
ha-card {
font-size: 18px;
color: black ;
background-color: rgb(235, 222, 219) ;
font-weight: bold ;
height: 55px ;
}
tap_action:
action: none
entity: sensor.poele_reglage_temperature
show_state: true
icon_height: 30px
- show_name: false
show_icon: true
type: button
card_mod:
style: |
ha-card {
color: black ;
background-color: rgb(233, 191, 182) ;
}
tap_action:
action: call-service
service: script.poele_increment_temperature
data: {}
target: {}
entity: sensor.poele_reglage_temperature
icon: mdi:plus-box
icon_height: 40px
- type: markdown
card_size: 20 px
content: <center>Réglage puissance de consigne
card_mod:
style: |
ha-card {
color: black ;
font-size: 20px;
font-weight: bold ;
background-color: rgb(235, 222, 219) ;
}
- type: horizontal-stack
cards:
- show_name: false
show_icon: true
type: button
card_mod:
style: |
ha-card {
color: black ;
background-color: rgb(233, 191, 182) ;
}
tap_action:
action: call-service
service: script.decrement_puissance
data: {}
target: {}
entity: sensor.poele_reglage_puissance
icon: mdi:minus-box
icon_height: 40px
- show_name: false
show_icon: false
type: custom:button-card
card_mod:
style: |
ha-card {
font-size: 25px ;
color: black ;
background-color: rgb(235, 222, 219) ;
height: 55px ;
}
tap_action:
action: none
entity: sensor.poele_reglage_puissance
show_state: true
- show_name: false
show_icon: true
type: button
card_mod:
style: |
ha-card {
color: black ;
background-color: rgb(233, 191, 182) ;
}
tap_action:
action: call-service
service: script.increment_puissance
data: {}
target: {}
entity: sensor.poele_reglage_puissance
icon: mdi:plus-box
icon_height: 40px
#####################################
####### et voila
#####################################
Merci de vos remarques et améliorations