Bonjour et ou Bonsoir,
Depuis que je me penche sur HA (quelques semaines seulement) je recherche à récupérer les données de mon compteur Legrand 412000.
J’ai rapidement découvert plusieurs sujet dont celui-ci How to decode special JSON ? Ex => "conso_hc" : 006699756, - #34 by Neuvidor - Configuration - Home Assistant Community qui donne un package complet qui à première vue permet de créer pas mal de sensors (ou entité) intéressants (consos instantanées, calcul de consos, de coûts,…).
Grâce à ce post Ecocompteur Legrand V1 avec TEMPO Problème command_line depuis MAJ et donc à @Florent80 qui m’a indiqué que mettre comme code YAML et ou les mettre et à @Nothing et à @cob94440 qui m’ont aidé à corriger quelques erreur qui mon permis de récupérer les puissances instantanées et l’index de conso de mon compteur.
Voici le code de mon package que j’aimerais utiliser en intégralité.
#---
############################################################
## ##
## 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 %}
# {{ ( 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') | 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') | round(2) }}
#####################################
## ##
## SENSORS COUTS ##
## FACTURATION ELECTRICITE ##
## ##
#####################################
# Sensor Input Text Abonnement
- name: "Legrand Prix Abo"
unit_of_measurement: "€"
state: >
{{ states('input_text.legrand_prix_abo') | round(2) }}
icon: mdi:currency-eur
# Sensor Input Text Prix kwh Base
- name: "Legrand Prix kWh Base"
unit_of_measurement: "€"
state: >
{{ states('input_text.legrand_prix_kwh_base') | round(2) }}
icon: mdi:currency-eur
# 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') | 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') | 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') | 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') | 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') | 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') | 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 %}
{% set base = states('sensor.electricite_prix_kwh_base') | float %}
{{(a + base) | round(2) }}
icon: mdi:currency-eur
# Calcul Coût Quotidien
# - name: Electricité Coût Quotdien
# unit_of_measurement: '€'
# state: >
# {% set a = states('sensor.electricite_prix_abo') | float %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{((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 %}
{% set base = states('sensor.electricite_prix_kwh_base') | float %}
{{ ((a * 7) + base) | round(2) }}
icon: mdi:currency-eur
# 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 %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{ ((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 %}
{% set base = states('sensor.electricite_prix_kwh_base') | float %}
{{ (a + 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 %}
# {% set base = states('sensor.electricite_prix_kwh_base') | float %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{ (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 %}
{% set o = states('sensor.legrand_yearly_energy_offpeak') | float %}
{% set a = states('sensor.electricite_prix_abo') | float %}
{% set base = states('sensor.electricite_prix_kwh_base') | float %}
{{ ((a * 12) + 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 %}
# {% set o = states('sensor.legrand_yearly_energy_offpeak') | float %}
# {% set a = states('sensor.electricite_prix_abo') | float %}
# {% set base = states('sensor.electricite_prix_kwh_base') | float %}
# {% set hp_b = states('sensor.electricite_prix_kwh_hp_b') | float %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{ ((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 %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{ ((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 %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{ ((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 %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{ ((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 %}
# {% set hc_b = states('sensor.electricite_prix_kwh_hc_b') | float %}
# {% set hp_w = states('sensor.electricite_prix_kwh_hp_w') | float %}
# {% set hc_w = states('sensor.electricite_prix_kwh_hc_w') | float %}
# {% set hc_r = states('sensor.electricite_prix_kwh_hp_r') | float %}
# {% set hp_r = states('sensor.electricite_prix_kwh_hc_r') | float %}
# {{ ((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
J’ai lu la doc sur les templates, packages et autres ainsi que parcourus de nombreux posts mais sans succès pour résoudre mes problème
Hormis avoir vu qu’il fallait faire attention au nombre d’espace avant les lignes et que le # permettait de passer en texte simple, je n’ai pas compris le reste
Voici donc Mon problème
Comment faire pour que les données proposées dans les différents calculs et stat du package remontes correctement dans HA ?
Et voici les erreurs que j’ai actuellement
Logger: homeassistant.helpers.event
Source: helpers/template.py:569
First occurred: 00:59:26 (6 occurrences)
Last logged: 00:59:26
Error while processing template: Template<template=({{ states('input_text.legrand_prix_kwh_base') | round(2) }}) renders=2>
Error while processing template: Template<template=({% set a = states('sensor.energy_daily_cost') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{(a + base) | round(2) }}) renders=2>
Error while processing template: Template<template=({% set a = states('sensor.energy_daily_cost') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ ((a * 7) + base) | round(2) }}) renders=2>
Error while processing template: Template<template=({% set a = states('sensor.electricite_prix_abo') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ (a + base) | round(2) }}) renders=2>
Error while processing template: Template<template=({% set p = states('sensor.legrand_yearly_energy_peak') | float %} {% set o = states('sensor.legrand_yearly_energy_offpeak') | float %} {% set a = states('sensor.electricite_prix_abo') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ ((a * 12) + base) | round(2) }}) renders=2>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1644, in forgiving_round
value = round(float(value), precision)
^^^^^^^^^^^^
ValueError: could not convert string to float: 'unknown'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 567, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2305, in _render_with_context
return template.render(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1649, in forgiving_round
raise_no_default("round", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1625, in raise_no_default
raise ValueError(
ValueError: Template error: round got invalid input 'unknown' when rendering template '{{ states('input_text.legrand_prix_abo') | round(2) }}' but no default was specified
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 693, in async_render_to_info
render_info._result = self.async_render(
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 569, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: round got invalid input 'unknown' when rendering template '{{ states('input_text.legrand_prix_abo') | round(2) }}' but no default was specified
Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:194
Integration: Template (documentation, issues)
First occurred: 00:59:26 (6 occurrences)
Last logged: 00:59:26
TemplateError('ValueError: Template error: round got invalid input 'unknown' when rendering template '{{ states('input_text.legrand_prix_kwh_base') | round(2) }}' but no default was specified') while processing template 'Template<template=({{ states('input_text.legrand_prix_kwh_base') | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.legrand_prix_kwh_base'
TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{% set a = states('sensor.energy_daily_cost') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{(a + base) | round(2) }}' but no default was specified') while processing template 'Template<template=({% set a = states('sensor.energy_daily_cost') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{(a + base) | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.cout_quotidien'
TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{% set a = states('sensor.energy_daily_cost') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ ((a * 7) + base) | round(2) }}' but no default was specified') while processing template 'Template<template=({% set a = states('sensor.energy_daily_cost') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ ((a * 7) + base) | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.cout_hebdomadaire'
TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{% set a = states('sensor.electricite_prix_abo') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ (a + base) | round(2) }}' but no default was specified') while processing template 'Template<template=({% set a = states('sensor.electricite_prix_abo') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ (a + base) | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.cout_mensuel'
TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{% set p = states('sensor.legrand_yearly_energy_peak') | float %} {% set o = states('sensor.legrand_yearly_energy_offpeak') | float %} {% set a = states('sensor.electricite_prix_abo') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ ((a * 12) + base) | round(2) }}' but no default was specified') while processing template 'Template<template=({% set p = states('sensor.legrand_yearly_energy_peak') | float %} {% set o = states('sensor.legrand_yearly_energy_offpeak') | float %} {% set a = states('sensor.electricite_prix_abo') | float %} {% set base = states('sensor.electricite_prix_kwh_base') | float %} {{ ((a * 12) + base) | round(2) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.cout_annuel'
Je suis désolé, mais même à la lecture je ne comprends pas où sont les erreurs
Je vous remercie par avance
Ma configuration
System Information
| version | core-2024.1.5 |
|---|---|
| installation_type | Home Assistant OS |
| dev | false |
| hassio | true |
| docker | true |
| user | root |
| virtualenv | false |
| python_version | 3.11.6 |
| os_name | Linux |
| os_version | 6.1.71-haos |
| arch | aarch64 |
| timezone | Europe/Paris |
| config_dir | /config |
Home Assistant Community Store
| GitHub API | ok |
|---|---|
| GitHub Content | ok |
| GitHub Web | ok |
| GitHub API Calls Remaining | 4844 |
| Installed Version | 1.33.0 |
| Stage | running |
| Available Repositories | 1378 |
| Downloaded Repositories | 23 |
Home Assistant Cloud
| logged_in | false |
|---|---|
| can_reach_cert_server | ok |
| can_reach_cloud_auth | ok |
| can_reach_cloud | ok |
Home Assistant Supervisor
| host_os | Home Assistant OS 11.4 |
|---|---|
| update_channel | stable |
| supervisor_version | supervisor-2023.12.1 |
| agent_version | 1.6.0 |
| docker_version | 24.0.7 |
| disk_total | 20.0 GB |
| disk_used | 7.1 GB |
| healthy | true |
| supported | true |
| board | generic-aarch64 |
| supervisor_api | ok |
| version_api | ok |
| installed_addons | Samba share (12.2.0), Advanced SSH & Web Terminal (17.0.4), tydom2mqtt (3.4.2), File editor (5.7.0), Fusion (2024.1.5), Mosquitto broker (6.4.0), SwitchBot-Mqtt (1.0.8) |
Dashboards
| dashboards | 2 |
|---|---|
| resources | 12 |
| views | 5 |
| mode | storage |
Recorder
| oldest_recorder_run | 10 janvier 2024 à 07:38 |
|---|---|
| current_recorder_run | 21 janvier 2024 à 00:24 |
| estimated_db_size | 50.22 MiB |
| database_engine | sqlite |
| database_version | 3.41.2 |
