# Comprendre et déchiffrer les erreurs d'un Package

**URL:** <https://forum.hacf.fr/t/comprendre-et-dechiffrer-les-erreurs-dun-package/35058>\
**Category:** Entraide Home Assistant\
**Tags:** aide\
**Created:** [Janvier 21, 2024, 12:14 UTC](https://forum.hacf.fr/t/comprendre-et-dechiffrer-les-erreurs-dun-package/35058 "2024-01-21T00:14:00Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Yoyouri](https://forum.hacf.fr/user_avatar/forum.hacf.fr/yoyouri/32/19995_2.png) [@Yoyouri](https://forum.hacf.fr/u/Yoyouri)\
**Post date:** [Janvier 23, 2024, 12:52 UTC](https://forum.hacf.fr/t/comprendre-et-dechiffrer-les-erreurs-dun-package/35058/11 "2024-01-23T00:52:23Z")

</div>

Merci pour ta rapidité, mais pareil avec tes modifications

```auto
Détails du journal (ERREUR)
Logger: homeassistant.config
Source: config.py:596
First occurred: 01:44:46 (6 occurrences)
Last logged: 01:44:46

Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 434: 'name' is an invalid option for 'template', check: name Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 435: 'unit_of_measurement' is an invalid option for 'template', check: unit_of_measurement Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 436: 'state' is an invalid option for 'template', check: state
Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 494: 'name' is an invalid option for 'template', check: name Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 495: 'unit_of_measurement' is an invalid option for 'template', check: unit_of_measurement Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 496: 'state' is an invalid option for 'template', check: state
Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 517: 'name' is an invalid option for 'template', check: name Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 518: 'unit_of_measurement' is an invalid option for 'template', check: unit_of_measurement Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 519: 'state' is an invalid option for 'template', check: state
Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 541: 'name' is an invalid option for 'template', check: name Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 542: 'unit_of_measurement' is an invalid option for 'template', check: unit_of_measurement Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 543: 'state' is an invalid option for 'template', check: state
Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 565: 'name' is an invalid option for 'template', check: name Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 566: 'unit_of_measurement' is an invalid option for 'template', check: unit_of_measurement Invalid config for 'template' at packages/package_legrand_ecocompteur.yaml, line 567: 'state' is an invalid option for 'template', check: state

```

Voici mon dernier `package_legrand_ecocompteur.yaml`

```auto
#---
   ############################################################
   ## ##
   ## PACKAGE LEGRAND ECO-COMPTEUR ##
   ## ##
   ############################################################
homeassistant:
   ############################################################
   ## ##
   ## CUSTOMIZE ##
   ## ##
   ############################################################

  customize:

    #################
    ## Node Anchors #
    #################
    package.node_anchors:
      customize: &customize
        package: 'package_legrand_ecocompteur'

    ##########################################
    ## Personnalisation Sensors Circuits #
    ##########################################

# Circuit 1 = label_entree1
    sensor.legrand_puissance_circuit_1:
      <<: *customize
      friendly_name: "Infos PC"
      icon: mdi:alpha-w-circle-outline

# Circuit 2 = label_entree2
    sensor.legrand_puissance_circuit_2:
      <<: *customize
      friendly_name: "Éclairage"
      icon: mdi:alpha-w-circle-outline

# Circuit 3 = label_entree3
    sensor.legrand_puissance_circuit_3:
      <<: *customize
      friendly_name: "Chauffage"
      icon: mdi:alpha-w-circle-outline

# Circuit 4 = label_entree4
    sensor.legrand_puissance_circuit_4:
      <<: *customize
      friendly_name: "Chaudière"
      icon: mdi:alpha-w-circle-outline

# Circuit 5 = label_entree5
# sensor.legrand_puissance_circuit_5:
# <<: *customize
# friendly_name: "Piscine"
# icon: mdi:alpha-w-circle-outline

    #################################################################
    ## Personnalisation Sensors Tableau Consommation Electrique #
    #################################################################

    sensor.legrand_base:
      <<: *customize
      friendly_name: "Legrand Tarif en Cours"
      icon: mdi:av-timer

# sensor.legrand_hchp:
# <<: *customize
# friendly_name: "Legrand Tarif en Cours"
# icon: mdi:av-timer

    sensor.legrand_intensite_souscrite:
      <<: *customize
      friendly_name: "Legrand Intensité Souscrite"
      icon: mdi:alpha-w-circle-outline

    sensor.legrand_puissance_souscrite:
      <<: *customize
      friendly_name: "Legrand Puissance Abonnement"
      icon: mdi:alpha-w-circle-outline

    ##########################################
    ## Personnalisation Sensors Circuits #
    ##########################################

    sensor.legrand_consommation_base:
      <<: *customize
      friendly_name: "Legrand Conso."
      icon: mdi:counter

# sensor.legrand_consommation_hp:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Pleines"
# icon: mdi:counter

# sensor.legrand_consommation_hc:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Creuses"
# icon: mdi:counter

# sensor.legrand_consommation_hp_b:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Pleines Bleu"
# icon: mdi:counter

# sensor.legrand_consommation_hc_b:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Creuses Bleu"
# icon: mdi:counter

# sensor.legrand_consommation_hp_w:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Pleines Blanc"
# icon: mdi:counter

# sensor.legrand_consommation_hc_w:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Creuses Blanc"
# icon: mdi:counter

# sensor.legrand_consommation_hp_r:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Pleines Rouge"
# icon: mdi:counter

# sensor.legrand_consommation_hc_r:
# <<: *customize
# friendly_name: "Legrand Conso. Heures Creuses Rouge"
# icon: mdi:counter

    sensor.legrand_tarif_en_cours:
      <<: *customize
      friendly_name: "Legrand Indicateur Tarif en Cours"
      icon: mdi:counter

    ###########################################
    ## Personnalisation Conso Electricité #
    ###########################################

    sensor.legrand_conso_totale:
      <<: *customize
      friendly_name: "Legrand Conso. Totale"
      icon: mdi:counter

# Personnalisation Electricité Utility Meter

    sensor.energy_daily_cost:
      <<: *customize
      friendly_name: "Legrand Conso. Electr. Quotid."
      icon: mdi:counter

    sensor.energy_weekly_cost:
      <<: *customize
      friendly_name: "Legrand Conso. Electr. Hebdo."
      icon: mdi:counter

    sensor.energy_monthly_cost:
      <<: *customize
      friendly_name: "Legrand Conso. Electr. Mensuelle"
      icon: mdi:counter

    sensor.energy_yearly_cost:
      <<: *customize
      friendly_name: "Legrand Conso. Electr. Annuelle"
      icon: mdi:counter

    ###################################
    ## Personnalisation Conso Eau #
    ###################################

# Compteur Eau
# sensor.legrand_consommation_totale_eau_m3:
# <<: *customize
# friendly_name: "Legrand Conso. Totale Eau"
# icon: mdi:water

# Personnalisation Eau Utility Meter

# sensor.water_daily_total:
# <<: *customize
# friendly_name: "Legrand Conso. Eau Quotid."
# icon: mdi:water

# sensor.water_weekly_total:
# <<: *customize
# friendly_name: "Legrand Conso. Eau Hebdo."
# icon: mdi:water

# sensor.water_monthly_total:
# <<: *customize
# friendly_name: "Legrand Conso. Eau Mensuelle"
# icon: mdi:water

# sensor.water_yearly_total:
# <<: *customize
# friendly_name: "Legrand Conso. Eau Annuelle"
# icon: mdi:water

   #####################################
   ## ##
   ## SENSORS PUISSANCES ##
   ## INSTANTANEES ##
   ## ##
   #####################################

sensor:

# ELECTRICITE

# Commande Récupération Valeur Puissances Instantanées Circuit 1
  - platform: rest
    resource: !secret Legrand_Source_Instantanes
    name: Legrand Puissance Circuit 1
    value_template: '{{ value_json.data1| round(0) }}'
    device_class: power
    unit_of_measurement: W

# Commande Récupération Valeur Puissances Instantanées Circuit 2

  - platform: rest
    resource: !secret Legrand_Source_Instantanes
    name: Legrand Puissance Circuit 2
    value_template: '{{ value_json.data2| round(0) }}'
    device_class: power
    unit_of_measurement: W

# Commande Récupération Valeur Puissances Instantanées Circuit 3
  - platform: rest
    resource: !secret Legrand_Source_Instantanes
    name: Legrand Puissance Circuit 3
    value_template: '{{ value_json.data3| round(0) }}'
    device_class: power
    unit_of_measurement: W

# Commande Récupération Valeur Puissances Instantanées Circuit 4
  - platform: rest
    resource: !secret Legrand_Source_Instantanes
    name: Legrand Puissance Circuit 4
    value_template: '{{ value_json.data4| round(0) }}'
    device_class: power
    unit_of_measurement: W

# Commande Récupération Valeur Puissances Instantanées Circuit 5
# - platform: rest
# resource: !secret Legrand_Source_Instantanes
# name: Legrand Puissance Circuit 5
# value_template: '{{ value_json.data5| round(0) }}'
# device_class: power
# unit_of_measurement: W

# EAU

# Commande Récupération Valeur Volume Conso Total Eau (m3) 
# - platform: rest
# resource: !secret Legrand_Source_Instantanes
# name: Legrand Consommation Totale Eau m3
# value_template: '{{ value_json.data6m3 }}'
# unit_of_measurement: m3

   #####################################
   ## ##
   ## SENSORS & TEMPLATES ##
   ## CONSOMMATIONS ELECTRIQUE ##
   ## ##
   #####################################

# Tarif en Cours Donnée Brute
# Valeurs : 0 = Base
# Valeurs : 2 = Pleine / 1 = Creuse
# Valeurs : 8 = Pleine bleu / 5 = Creuse bleu
# Valeurs : 9 = Pleine blanc / 6 = Creuse blanc
# Valeurs : 10 = Pleine rouge / 7 = Creuse rouge

# - platform: command_line
# name: "Legrand Tarif en Cours"
# command: !secret Legrand_Cmd_Tarif_Courant
# scan_interval: 10

# Transformation Tarif en Cours > Tranche Tarifaire
template:
      - sensor:
# entity_id: sensor.legrand_tarif_en_cours
# state: >
# {% if is_state('sensor.tarif_en_cours', '0') %}
# Base
# {% if is_state('sensor.legrand_tarif_en_cours', '10') %}
# Heure Pleine ROUGE
# {% if is_state('sensor.legrand_tarif_en_cours', '9') %}
# Heure Pleine BLANC
# {% if is_state('sensor.legrand_tarif_en_cours', '8') %}
# Heure Pleine BLEU
# {% if is_state('sensor.legrand_tarif_en_cours', '7') %}
# Heure Creuse ROUGE
# {% if is_state('sensor.legrand_tarif_en_cours', '6') %}
# Heure Creuse BLANC
# {% if is_state('sensor.legrand_tarif_en_cours', '5') %}
# Heure Creuse BLEU
# {% if is_state('sensor.legrand_tarif_en_cours', '2') %}
# Heure Pleine
# {% if is_state('sensor.legrand_tarif_en_cours', '1') %}
# Heure Creuse 
          

   #####################################
   ## ##
   ## RELEVES ##
   ## ABONNEMENT ##
   ## ##
   #####################################
# Intensité Souscrite
# - platform: command_line
# name: Legrand Intensité Souscrite
# command: !secret Legrand_Cmd_Intensite_Souscrite
# scan_interval: 60
# unit_of_measurement: A

# Puissance Souscrite
# - name: "Legrand Puissance Souscrite"
# unit_of_measurement: 'kVA'
# state: >
# {% set i = states('sensor.legrand_intensite_souscrite') | float(default=0) %} 
# {{ ( i / 5 ) | round(2) }}
# icon: mdi:gauge

# Conso. Base
# - platform: command_line
# name: Legrand Consommation Base
# command: !secret Legrand_Cmd_Conso_Base
# scan_interval: 10
# unit_of_measurement: kWh

# Conso. HC_b
# - platform: command_line
# name: Legrand Consommation HC_b
# command: !secret Legrand_Cmd_Conso_HC_b
# scan_interval: 10
# unit_of_measurement: kWh

# Conso. HP_b
# - platform: command_line
# name: Legrand Consommation HP_b
# command: !secret Legrand_Cmd_Conso_HP_b
# scan_interval: 10
# unit_of_measurement: kWh

# Conso. HC_w
# - platform: command_line
# name: Legrand Consommation HC_w
# command: !secret Legrand_Cmd_Conso_HC_w
# scan_interval: 10
# unit_of_measurement: kWh

# Conso. HP_w
# - platform: command_line
# name: Legrand Consommation HP_w
# command: !secret Legrand_Cmd_Conso_HP_w
# scan_interval: 10
# unit_of_measurement: kWh

# Conso. HC_r
# - platform: command_line
# name: Legrand Consommation HC_r
# command: !secret Legrand_Cmd_Conso_HC_r
# scan_interval: 10
# unit_of_measurement: kWh

# Conso. HP_r
# - platform: command_line
# name: Legrand Consommation HP_r
# command: !secret Legrand_Cmd_Conso_HP_r
# scan_interval: 10
# unit_of_measurement: kWh
    

   #####################################
   ## ##
   ## SENSORS CALCULS ##
   ## CONSOMMATION ##
   ## ##
   #####################################

# Calcul Consommation Totale (Base)

# - name: "Legrand Consommation Totale"
# unit_of_measurement: "kWh"
# state: >
# {{ float(states('sensor.legrand_consommation_base') | default(0 | round(2) }}

# Calcul Consommation Totale (HP_b + HC_b + HP_W + HC_w + HP_r + HC_r)
# - name: "Legrand Consommation Totale"
# unit_of_measurement: "kWh"
# state: >
# {{ float(states('sensor.legrand_consommation_hp_b') + #float(states.sensor.legrand_consommation_hc_b') + #float(states('sensor.legrand_consommation_hp_w') + #float(states('sensor.legrand_consommation_hc_w') + #float(states('sensor.legrand_consommation_hp_r') + #float(states('sensor.legrand_consommation_hc_r') | default(0 | round(2) }}

   #####################################
   ## ##
   ## SENSORS COUTS ##
   ## FACTURATION ELECTRICITE ##
   ## ##
   #####################################

# Sensor Input Text Abonnement
      - name: "Legrand Prix Abo"
        unit_of_measurement: "€"
        state: >-
          {{ states('input_text.legrand_prix_abo') | default(0) | round(2) }}

# Sensor Input Text Prix kwh Base
      - name: "Legrand Prix kWh Base"
        unit_of_measurement: "€"
        state: >-
          {{ states('input_text.legrand_prix_kwh_base') | default(0) | round(2) }}

# Sensor Input Text Prix kwh HP_b
# - name: "Legrand Prix kWh HP_b"
# unit_of_measurement: "€"
# state: >
# {{ states('input_text.legrand_prix_kwh_hp_b') | default(0 | round(2) }}
# icon_template: mdi:currency-eur

# Sensor Input Text Prix Kwh HC_b
# - name: "Legrand Prix kWh HC_b"
# unit_of_measurement: "€"
# state: >
# {{ states('input_text.legrand_prix_kwh_hc_b') | default(0 | round(2) }}
# icon_template: mdi:currency-eur

# Sensor Input Text Prix kwh HP_w
# - name: "Legrand Prix kWh HP_w"
# unit_of_measurement: "€"
# state: >
# {{ states('input_text.legrand_prix_kwh_hp_w') | default(0 | round(2) }}
# icon_template: mdi:currency-eur

# Sensor Input Text Prix Kwh HC_w
# - name: "Legrand Prix kWh HC_w"
# unit_of_measurement: "€"
# state: >
# {{ states('input_text.legrand_prix_kwh_hc_w') | default(0 | round(2) }}
# icon_template: mdi:currency-eur

# Sensor Input Text Prix kwh HP_r
# - name: "Legrand Prix kWh HP_r"
# unit_of_measurement: "€"
# state: >
# {{ states('input_text.legrand_prix_kwh_hp_r') | default(0 | round(2) }}
# icon_template: mdi:currency-eur

# Sensor Input Text Prix Kwh HC_r
# - name: "Legrand Prix kWh HC_r"
# unit_of_measurement: "€"
# state: >
# {{ states('input_text.legrand_prix_kwh_hc_r') | default(0 | round(2) }}
# icon_template: mdi:currency-eur

     ###########################################
     ## CALCULS CONSOMMATIONS TOTALES ##
     ###########################################

       #########################
       ## ELECTRICITE ##
       #########################

## CALCULS FACTURATION ELECTRICITE

# Calcul Coût Quotidien
      - name: "Coût Quotidien"
        unit_of_measurement: '€'
        state: >-
          {% set a = states('sensor.energy_daily_cost') | float(default=0) %}
          {% set base = states('sensor.electricite_prix_kwh_base') | float(default=0) %}
          {{(a + base) | round(2) }}

# Calcul Coût Quotidien
# - name: Electricité Coût Quotdien
# unit_of_measurement: '€'
# state: >
# {% set a = states('sensor.electricite_prix_abo') | float(default=0) %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{((hp_b + hp_w + hp_r) + (hc_b + hc_w + hc_r ))| round(2) }}
# icon_template: mdi:currency-eur

# Calcul Coût Hebdomadaire

      - name: "Coût Hebdomadaire"
        unit_of_measurement: '€'
        state: >-
          {% set a = states('sensor.energy_daily_cost') | float(default=0) %}
          {% set base = states('sensor.electricite_prix_kwh_base') | float(default=0) %}
          {{ ((a * 7) + base) | round(2) }}

# Calcul Coût Hebdomadaire
#
# - name: "Coût Hebdomadaire"
# unit_of_measurement: '€'
# state: >
# {% set a = states('sensor.energy_daily_cost') | float %}
# {% set base = states('sensor.electricite_prix_kwh_base') | float(default=0) %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{ ((a * 7) + base) | round(2) }}
# icon: mdi:currency-eur

# Calcul Coût Mensuel
      - name: "Coût Mensuel"
        unit_of_measurement: '€'
        state: >-
          {% set a = states('sensor.electricite_prix_abo') | float(default=0) %}
          {% set base = states('sensor.electricite_prix_kwh_base') | float(default=0) %}
          {{ (a + base) | round(2) }}

# Calcul Coût Mensuel
#
# - name: "Coût Mensuel"
# unit_of_measurement: '€'
# state: >
# {% set a = states('sensor.electricite_prix_abo') | float(default=0) %}
# {% set base = states('sensor.electricite_prix_kwh_base') | float(default=0) %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{ (a + base) | round(2) }}
# icon: mdi:currency-eur

# Calcul Coût Annuel
      - name: "Coût Annuel"
        unit_of_measurement: '€'
        state: >-
          {% set p = states('sensor.legrand_yearly_energy_peak') | float(default=0) %}
          {% set o = states('sensor.legrand_yearly_energy_offpeak') | float(default=0) %}
          {% set a = states('sensor.electricite_prix_abo') | float(default=0) %}
          {% set base = states('sensor.electricite_prix_kwh_base') | float(default=0) %}
          {{ ((a * 12) + base) | round(2) }}

# Calcul Coût Annuel
#
# - name: "Coût Annuel"
# unit_of_measurement: '€'
# state: >
# {% set p = states('sensor.legrand_yearly_energy_peak') | float(default=0) %}
# {% set o = states('sensor.legrand_yearly_energy_offpeak') | float(default=0) %}
# {% set a = states('sensor.electricite_prix_abo') | float(default=0) %}
# {% set base = states('sensor.electricite_prix_kwh_base') | float(default=0) %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{ ((a * 12) + base) | round(2) }}
# icon: mdi:currency-eur

# Calcul Consommation TOTALE Quotidienne ELECTRICITE
# - name: Electricité Consommation Quotidienne Totale
# unit_of_measurement: 'kWh'
# state: >
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{ ((hp_c + hp_w + hp_r) + (hc_b + hc_w + hc_r)) | round(2) }}
# icon_template: mdi:counter
#
# Calcul Consommation TOTALE Hebdo ELECTRICITE
# - name: Electricité Consommation Hebdo Totale
# unit_of_measurement: 'kWh'
# state: >
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{ ((hp_c + hp_w + hp_r) + (hc_b + hc_w + hc_r)) | round(2) }}
# icon_template: mdi:counter
#
# Calcul Consommation TOTALE Mensuelle ELECTRICITE
# - name: Electricité Consommation Mensuelle Totale
# unit_of_measurement: 'kWh'
# state: >
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{ ((hp_c + hp_w + hp_r) + (hc_b + hc_w + hc_r)) | round(2) }}
# icon_template: mdi:counter
#
# Calcul Consommation TOTALE Annuelle ELECTRICITE
# - name: Electricité Consommation Annuelle Totale
# unit_of_measurement: 'kWh'
# state: >
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float(default=0) %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float(default=0) %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float(default=0) %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float(default=0) %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float(default=0) %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float(default=0) %}
# {{ ((hp_c + hp_w + hp_r) + (hc_b + hc_w + hc_r)) | round(2) }}
# icon_template: mdi:counter

   #####################################
   ## ##
   ## UTILITY METER ##
   ## ##
   #####################################

#utility_meter:

       #########################
       ## ELECTRICITE ##
       #########################

#legrand_daily_energy:
# source: sensor.legrand_conso_totale
# cycle: daily
# tariffs:
# - peak
# - offpeak
#legrand_weekly_energy:
# source: sensor.legrand_conso_totale
# cycle: weekly
# tariffs:
# - peak
# - offpeak
#legrand_monthly_energy:
# source: sensor.legrand_conso_totale
# cycle: monthly
# tariffs:
# - peak
# - offpeak
#legrand_yearly_energy:
# source: sensor.legrand_conso_totale
# cycle: yearly
# tariffs:
# - peak
# - offpeak

```

Pour info j’avais mis à jour les `templates` suite au message de @cob94440 ci-après qui disait de passer à la nouvelle écriture mais du coup je ne sais plus quoi faire !

> [@Ecocompteur Legrand V1 avec TEMPO Problème command\_line depuis MAJ](https://forum.hacf.fr/t/ecocompteur-legrand-v1-avec-tempo-probleme-command-line-depuis-maj/34684/22):
>
> Tu écris tes templates ainsi : sensor: - platform: template sensors: legrand\_puissance\_souscrite: friendly\_name: "Legrand Puissance Souscrite" value\_template: \>- {% set i = states('sensor.legrand\_intensite\_souscrite') | float %} {{ ( i / 5 ) | round(2) }} unit\_of\_measurement: 'kVA' icon\_template: mdi:gauge Bientôt ça ne sera plus accepté. Maintenant c’est de la forme : template: - sensor: - name: "Legrand Puissance Sous…

---

_[View the full topic](https://forum.hacf.fr/t/comprendre-et-dechiffrer-les-erreurs-dun-package/35058)._
