Carte pour Thermostat Netatmo

Tu as bien travaillé, merci pour le partage. :+1:
Concernant l’interface graphique, la vanne apparait comme cela dans un navigateur internet ou bien elle a une autre apparence?

dans le navigateur internet de netatmo elle est de forme ronde
mais le ratio hauteur, largueur est différent que sur l’interface graphique

je ne sais pas comment faire propre

On pourrait envisager de modifier la carte pour coller à celle-ci, mais il faudrait une copie écran plus grande afin de garder une bonne qualité de finition.

j’ai fait ça, si sa intéresse quelqu’un ?
c’est plus nette, je finalise et je partagerais

1 « J'aime »

Eh bien voila, super boulot ! :wink:

voici mes images, à ajouter
thermostat_background

vanne_background

netatmo_plus

netatmo_moin

code carte thermostat
type: picture-elements
image: /local/netatmo/thermostat_background.png
elements:
  - type: image
    entity: climate.salon
    title: Up Consigne
    tap_action:
      action: call-service
      service: Script.netatmo_increment_consigne_salon
    hold_action:
      action: more-info
    image: /local/netatmo/netatmo_plus.png
    style:
      top: 52%
      left: 76.7%
      width: 6.5%
  - type: image
    entity: climate.salon
    title: Down Consigne
    tap_action:
      action: call-service
      service: Script.netatmo_decrement_consigne_salon
    hold_action:
      action: more-info
    image: /local/netatmo/netatmo_moin.png
    style:
      top: 52%
      left: 56.3%
      width: 6.5%
  - type: image
    entity: sensor.netatmo_hvac_action_salon
    title: Temoin Chauffe
    tap_action:
      action: none
    image: /local/netatmo/Netatmo_chauffe.png
    style:
      top: 60%
      left: 25%
      width: 7%
    state_filter:
      heating: brightness(100%) saturate(1)
      idle: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode_salon
    title: Temoin Manual
    tap_action:
      action: none
    image: /local/netatmo/Netatmo_manual.png
    style:
      top: 33%
      left: 38.6%
      width: 9%
    state_filter:
      manual: brightness(100%) saturate(1)
      Schedule: opacity(0%)
      away: opacity(0%)
      Frost Guard: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode_salon
    title: Mode de fonctionnement
    tap_action:
      action: none
    image: /local/netatmo/Absent.png
    style:
      top: 33%
      left: 38%
      width: 13%
    state_filter:
      away: brightness(100%) saturate(1)
      Schedule: opacity(0%)
      manual: opacity(0%)
      Frost Guard: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode_salon
    title: Mode de fonctionnement
    tap_action:
      action: none
    image: /local/netatmo/Hors Gel.png
    style:
      top: 33%
      left: 38%
      width: 15%
    state_filter:
      Frost Guard: brightness(100%) saturate(1)
      Schedule: opacity(0%)
      manual: opacity(0%)
      away: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode_salon
    title: Mode de fonctionnement
    tap_action:
      action: none
    image: /local/netatmo/Automatique.png
    style:
      top: 33%
      left: 38%
      width: 13%
    state_filter:
      Schedule: brightness(100%) saturate(1)
      away: opacity(0%)
      manual: opacity(0%)
      Frost Guard: opacity(0%)
  - type: state-label
    entity: sensor.netatmo_temperature_courante_salon
    unit_of_measurement: .
    title: Température Actuelle
    tap_action:
      action: null
    style:
      top: 50%
      left: 25%
      font-size: 2.3em
      color: rgb(68, 68, 68)
      font-weight: 600
  - type: state-label
    entity: sensor.netatmo_temperature_consigne_salon
    title: Température de consigne
    tap_action:
      action: null
    style:
      top: 28%
      left: 25%
      font-size: 1.2em
      color: white
      font-weight: 600
  - type: state-label
    entity: climate.salon
    attribute: friendly_name
    style:
      top: 25%
      left: 68%
      font-size: 1.6em
      color: rgb(68, 68, 68)
      font-weight: 400
  - type: state-label
    entity: sensor.thermostat_battery_percent
    title: '% Batterie'
    tap_action:
      action: none
    style:
      top: 79%
      left: 8.3%
      font-size: 0.7em
      color: rgb(68,68,68)
      font-weight: 600
  - type: state-icon
    entity: sensor.thermostat_battery_percent
    title: Niveau Batterie
    tap_action:
      action: more-info
    style:
      top: 86%
      left: 8%
      '--paper-item-icon-color': rgb(68,68,68)
  - type: image
    entity: climate.salon
    title: null
    tap_action:
      action: none
    image: /local/netatmo/bouton_fond-300x98.png
    style:
      top: 83.2%
      left: 71%
      width: 58%
  - type: image
    entity: climate.salon
    title: Passer en Mode Absent
    tap_action:
      action: call-service
      service: Script.netatmo_mode_absent
    image: /local/netatmo/Absent.png
    style:
      top: 83%
      left: 53%
      width: 12%
  - type: image
    entity: climate.salon
    title: Passer en Mode Hors Gel
    tap_action:
      action: call-service
      service: Script.netatmo_mode_hors_gel
    image: /local/netatmo/Hors Gel.png
    style:
      top: 83.2%
      left: 79.5%
      width: 14.5%
  - type: image
    entity: climate.salon
    title: Passer en Mode Automatique
    tap_action:
      action: call-service
      service: Script.netatmo_mode_schedule
    image: /local/netatmo/Automatique.png
    style:
      top: 83.2%
      left: 67%
      width: 10%
code carte vanne
type: picture-elements
image: /local/netatmo/vanne_background.png
elements:
  - type: image
    entity: climate.chambre_parentale
    title: Up Consigne
    tap_action:
      action: call-service
      service: Script.netatmo_increment_consigne_chp
    hold_action:
      action: more-info
    image: /local/netatmo/netatmo_plus.png
    style:
      top: 52%
      left: 76.7%
      width: 6.5%
  - type: image
    entity: climate.chambre_parentale
    title: Down Consigne
    tap_action:
      action: call-service
      service: Script.netatmo_decrement_consigne_chp
    hold_action:
      action: more-info
    image: /local/netatmo/netatmo_moin.png
    style:
      top: 52%
      left: 56.3%
      width: 6.5%
  - type: image
    entity: sensor.netatmo_hvac_action_chp
    title: Temoin Chauffe
    tap_action:
      action: none
    image: /local/netatmo/Netatmo_chauffe.png
    style:
      top: 60%
      left: 25%
      width: 7%
    state_filter:
      heating: brightness(100%) saturate(1)
      idle: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode_chp
    title: Temoin Manual
    tap_action:
      action: none
    image: /local/netatmo/Netatmo_manual.png
    style:
      top: 33%
      left: 38.6%
      width: 9%
    state_filter:
      manual: brightness(100%) saturate(1)
      Schedule: opacity(0%)
      away: opacity(0%)
      Frost Guard: opacity(0%)
  - type: state-label
    entity: sensor.netatmo_temperature_courante_chp
    unit_of_measurement: .
    title: Température Actuelle
    tap_action:
      action: null
    style:
      top: 49%
      left: 25%
      font-size: 2.3em
      color: rgb(68, 68, 68)
      font-weight: 600
  - type: state-label
    entity: sensor.netatmo_temperature_consigne_chp
    title: Température de consigne
    tap_action:
      action: null
    style:
      top: 28%
      left: 25%
      font-size: 1.2em
      color: white
      font-weight: 600
  - type: state-label
    entity: climate.chambre_parentale
    attribute: friendly_name
    style:
      top: 25%
      left: 68%
      font-size: 1.6em
      color: rgb(68, 68, 68)
      font-weight: 400
  - type: state-label
    entity: sensor.vanne_chambre_parentale_battery_percent
    title: '% Batterie'
    tap_action:
      action: none
    style:
      top: 79%
      left: 8.3%
      font-size: 0.7em
      color: rgb(68,68,68)
      font-weight: 600
  - type: state-icon
    entity: sensor.vanne_chambre_parentale_battery_percent
    title: Niveau Batterie
    tap_action:
      action: more-info
    style:
      top: 86%
      left: 8%
      '--paper-item-icon-color': rgb(68,68,68)
2 « J'aime »

Parfait !
je suis certain que cela servira à d’autres utilisateurs Netatmo. :+1:

Bonjour à tous,

Merci Fabien_Jouet, cela m’a été très utile.

Voici le résultat :

Juste un petit détails mais serait-il possible d’intégrer dans la carte Thermostat la possibilité de choisir le type de planning?

1 « J'aime »

Salut,

L’API ne permet pas de changer de planning,mais seulement d’afficher le planning en cours. Peut être que cela sera possible dans une future évolution de l’intégration.

Salut,

Merci pour ton retour telenaze.

thermostat_background_2

salut tu peux ajouter sa en plus

  - type: state-icon
    entity: select.netatmo_maison
    title: Planning
    icon: mdi:calendar
    style:
      top: 85%
      left: 25%
      '--paper-item-icon-color': rgb(68,68,68)

j’ai testé et le changement de planning est bien pris en compte

En fait cela ne permet pas de changer de planning, mais juste de voir le planning en cours.
@ Fabien_Jouet Tu confirmes ?

Le changement s’effectue chez moi @telenaze, mais celà semble capricieux

Je suis surpris parce-qu’un state-icon ne fait que remonter un état.
Comment tu fait pour envoyer la commande de changement au thermostat ?

Merci @Fabien_Jouet .

@telenaze, je te confirme pouvoir faire le changement de planning via la carte. Dans l’application Netatmo, il y a bien changement de planning mais le retour sur HA ne se fait pas correctement. J’ai pourtant attendu 1 h, mais pour HA, il n’y a jamais eu changement de planning.

Je dois passer à coté de quelque chose.
Voici comment je fais, mais comment on valide le changement de planning ?
Carte Netatmo Planning

Je viens de rebooter hassio et maintenant cela fonctionne :grinning:
Donc il faut juste changer de planning et fermer la fenêtre.

Un super travail :index_pointing_at_the_viewer: :clap: :clap: :clap:

Par contre je fais un piètre utilisateur :frowning:

J’ai une carte qui semble correct
image

Mais quand je clique sur + ou - il se passe un temps énorme voir cela ne change pas du tout la consigne même sur la carte thermostat classique
image

J’ai rechargé et relancer HA et la mise à jour du thermostat se réalise plus vite avec la second carte !

Je sais pas si cela vous fait la même chose chez vous ?

Sinon j’ai un second problème qui se situe sur les 3 boutons du bas.
Quand je clique dessus il ne veut pas du tout lancer le service !

Je ne vois pas pourquoi pour le coup, je dois louper un truc mais quoi !
Merci de votre aide

Voici le script

Le code des scripts
netatmo_mode_absent:
  alias: netatmo_mode_absent
  sequence:
  - service: climate.set_preset_mode
    target:
# Remplacer "netatmo_entree"  par le nom de votre thermostat
      entity_id: climate.netatmo_smart_thermostat
    data:
      preset_mode: away
  - service: python_script.set_state
    data_template:
      entity_id: sensor.netatmo_preset_mode
      state: away
  mode: single
  
netatmo_mode_hors_gel:
  alias: netatmo_mode_hors_gel
  sequence:
  - service: climate.set_preset_mode
    target:
# Remplacer "netatmo_entree"  par le nom de votre thermostat
      entity_id: climate.netatmo_smart_thermostat
    data:
      preset_mode: Frost Guard
  - service: python_script.set_state
    data_template:
      entity_id: sensor.netatmo_preset_mode
      state: Frost Guard
  mode: single
  
netatmo_mode_schedule:
  alias: netatmo_mode_schedule
  sequence:
  - service: climate.set_preset_mode
    target:
# Remplacer "netatmo_entree"  par le nom de votre thermostat
      entity_id: climate.netatmo_smart_thermostat
    data:
      preset_mode: Schedule
  - service: python_script.set_state
    data_template:
      entity_id: sensor.netatmo_preset_mode
      state: Schedule
  mode: single

Les sensors

Le code des sensors


- platform: template
  netatmo_temperature_courante:
    friendly_name: Température Maison
    device_class: temperature
    value_template: "{{ state_attr('climate.netatmo_smart_thermostat', 'current_temperature') }}"
      
- platform: template
  netatmo_temperature_consigne:
    friendly_name: température consigne Maison
    device_class: temperature
    value_template: "{{ state_attr('climate.netatmo_smart_thermostat', 'temperature') }}"

- platform: template
  netatmo_niveau_batterie:
    friendly_name: Niveau Batterie Maison
    device_class: battery
    unit_of_measurement: "%"
    value_template: "{{ state_attr('climate.netatmo_smart_thermostat', 'battery_level') }}"

- platform: template
  netatmo_hvac_action:
    friendly_name: Hvac action Maison
    value_template: "{{ state_attr('climate.netatmo_smart_thermostat', 'hvac_action') }}"

- platform: template
  netatmo_hvac_modes:
    friendly_name: Hvac modes Maison
    value_template: "{{ state_attr('climate.netatmo_smart_thermostat', 'hvac_modes') }}"

- platform: template
  netatmo_preset_mode:
    friendly_name: Preset mode Maison
    value_template: "{{ state_attr('climate.netatmo_smart_thermostat', 'preset_mode') }}"


Script Python
inputEntity = data.get('entity_id')
if inputEntity is None:
    logger.warning("===== entity_id is required if you want to set something.")
else:    
    inputStateObject = hass.states.get(inputEntity)
    inputState = inputStateObject.state
    inputAttributesObject = inputStateObject.attributes.copy()

    for item in data:
        newAttribute = data.get(item)
        logger.debug("===== item = {0}; value = {1}".format(item,newAttribute))
        if item == 'entity_id':
            continue            # already handled
        elif item == 'state':
            inputState = newAttribute
        else:
            inputAttributesObject[item] = newAttribute
        
    hass.states.set(inputEntity, inputState, inputAttributesObject)

Salut jerome6994 merci pour les encouragements.
De ce que je vois ton Python script ne reflète pas celui que j’ai mis.
As tu bien recopié le texte sans aucun changement dans le fichier « set_state.py » ?
Je te mets ci-dessous le texte nettoyé de tous les lignes commentées.

Python script
inputEntity = data.get('entity_id')
if inputEntity is None:
    logger.warning("===== entity_id is required if you want to set something.")
else:    
    inputStateObject = hass.states.get(inputEntity)
    inputState = inputStateObject.state
    inputAttributesObject = inputStateObject.attributes.copy()

    for item in data:
        newAttribute = data.get(item)
        logger.debug("===== item = {0}; value = {1}".format(item,newAttribute))
        if item == 'entity_id':
            continue            # already handled
        elif item == 'state':
            inputState = newAttribute
        else:
            inputAttributesObject[item] = newAttribute
        
    hass.states.set(inputEntity, inputState, inputAttributesObject)
    

Bonsoir @telenaze

Merci pour ton retour rapide

J’ai repris mon message car l’intégration du script Python était pas très bien joli en mise en forme et j’avais pas fait attention.

Bref j’ai regardé et il semble que j’avais bien la même chose mais pas sécurité j’ai repris à nouveau ton code.
Nous sommes d’accord il y a rien à changer dedans même pas entity_id

Je n’ai pas mis le code de la carte au cas où :
mon code corrigé sur ma carte

mon code corrigé sur la carte
type: picture-elements
image: /local/devices/Netatmo_background_409x762_2.png
elements:
  - type: image
    entity: climate.netatmo_smart_thermostat
    image: /local/devices/fioul.png
    title: null
    tap_action:
      action: none
    style:
      top: 10%
      left: 90%
      width: 10%
  - type: image
    entity: climate.netatmo_smart_thermostat
    title: Up Consigne
    tap_action:
      action: call-service
      service: Script.netatmo_increment_consigne
    hold_action:
      action: more-info
    image: /local/devices/Netatmo_up.png
    style:
      top: 52.6%
      left: 76.5%
      width: 6%
  - type: image
    entity: climate.netatmo_smart_thermostat
    title: Down Consigne
    tap_action:
      action: call-service
      service: Script.netatmo_decrement_consigne
    hold_action:
      action: more-info
    image: /local/devices/Netatmo_down.png
    style:
      top: 52.6%
      left: 56.5%
      width: 6%
  - type: image
    entity: sensor.netatmo_hvac_action
    title: Témoin Chauffe
    tap_action:
      action: none
    image: /local/devices/Netatmo_chauffe.png
    style:
      top: 58%
      left: 25.5%
      width: 7%
    state_filter:
      heating: brightness(100%) saturate(1)
      idle: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode
    title: Temoin Manual
    tap_action:
      action: none
    image: /local/devices/Netatmo_manual.png
    style:
      top: 30%
      left: 39%
      width: 9%
    state_filter:
      manual: brightness(100%) saturate(1)
      Schedule: opacity(0%)
      away: opacity(0%)
      Frost Guard: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode
    title: Mode de fonctionnement
    tap_action:
      action: none
    image: /local/devices/Absent.png
    style:
      top: 29.8%
      left: 38.6%
      width: 11%
    state_filter:
      away: brightness(100%) saturate(1)
      Schedule: opacity(0%)
      manual: opacity(0%)
      Frost Guard: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode
    title: Mode de fonctionnement
    tap_action:
      action: none
    image: /local/devices/Hors Gel.png
    style:
      top: 29.8%
      left: 38.6%
      width: 11%
    state_filter:
      Frost Guard: brightness(100%) saturate(1)
      Schedule: opacity(0%)
      manual: opacity(0%)
      away: opacity(0%)
  - type: image
    entity: sensor.netatmo_preset_mode
    title: Mode de fonctionnement
    tap_action:
      action: none
    image: /local/devices/Automatique.png
    style:
      top: 29.9%
      left: 39%
      width: 11%
    state_filter:
      Schedule: brightness(100%) saturate(1)
      away: opacity(0%)
      manual: opacity(0%)
      Frost Guard: opacity(0%)
  - type: state-label
    entity: sensor.netatmo_temperature_courante
    unit_of_measurement: .
    title: Température Actuelle
    tap_action:
      action: null
    style:
      top: 48%
      left: 25.5%
      font-size: 1.6em
      color: black
      font-weight: 600
  - type: state-label
    entity: sensor.netatmo_temperature_consigne
    title: Température de consigne
    tap_action:
      action: null
    style:
      top: 25%
      left: 25.5%
      font-size: 1em
      color: white
      font-weight: 600
  - type: state-label
    entity: climate.chambre_parents
    attribute: friendly_name
    style:
      top: 25%
      left: 66%
      font-size: 1.4em
      color: black
      font-weight: 400
  - type: state-label
    entity: sensor.chambre_parents_battery_percent
    title: '% Batterie'
    tap_action:
      action: none
    style:
      top: 79%
      left: 8.3%
      font-size: 0.7em
      color: grey
      font-weight: 600
  - type: state-icon
    entity: sensor.chambre_parents_battery_percent
    title: Niveau Batterie
    icon: mdi:battery-high
    tap_action:
      action: more-info
    style:
      top: 86%
      left: 8%
      '--paper-item-icon-color': grey
  - type: image
    entity: climate.netatmo_smart_thermostat
    title: null
    tap_action:
      action: none
    image: /local/devices/bouton_fond-300x98.png
    style:
      top: 83.2%
      left: 71%
      width: 58%
  - type: image
    entity: climate.netatmo_smart_thermostat
    title: Passer en Mode Absent
    tap_action:
      action: call-service
      service: Script.netatmo_mode_absent
    image: /local/devices/Absent.png
    style:
      top: 83%
      left: 53%
      width: 12%
  - type: image
    entity: climate.netatmo_smart_thermostat
    title: Passer en Mode Hors Gel
    tap_action:
      action: call-service
      service: Script.netatmo_mode_hors_gel
    image: /local/devices/Hors Gel.png
    style:
      top: 83.2%
      left: 79.5%
      width: 14.5%
  - type: image
    entity: climate.netatmo_smart_thermostat
    title: Passer en Mode Automatique
    tap_action:
      action: call-service
      service: Script.netatmo_mode_schedule
    image: /local/devices/Automatique.png
    style:
      top: 83.2%
      left: 67%
      width: 10%

oui tu ne change absolument rien.
Avant de mettre en cause de code de la carte sur l’appel d’un scripts il faut tester les scripts.
Donc teste les scripts des trois modes en les exécutant directement depuis "configuration/Scripts et si tu as toujours un message d’erreur, c’est que tu as commis une erreur sur python script.