Bonjour à tous, je suis abonné à l’offre TEMPO depuis plus d’un an maintenant et j’utlise l’écocompteur LEGRAND V1 afin de relever mes index.
J’ai eu la merveilleuse idée de mettre à jour HA ce weekend, chose que je n’avais pas faite depuis plusieurs mois.
Du coup maintenant j’ai des messages d’erreurs sur dashboard sur mes relevés d’index.
Mes sensors de puissances intantanés fonctionnent toujours
# 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
Mais mes sensors qui me lisent mes index non !
# 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
Je tourne en rond depuis ce weekend sans résultat, j’ai bien tenté avec le fichier command_line.YAML mais je ne dois pas faire ce qu’il faut.
Merci à vous
HA sur Nuc via Proxmox
Peut être commencer par lire la Doc du command Line et le change log de 2023.12 par exemple.
Merci pour ton intervention fort pertinente.
Comment peux-tu dire que je n’ai pas lu la doc du commande line ?
Tu peux même voir dans mon Messenger que je fais un command_line.yaml
Bref ça ne répond pas à mon problème
En tout cas quel accueil pour une première demande d’assistance…
Ça fait 1,5ans que je suis sur HA et je lis ce forum depuis autant de temps quand je galère et ça m’aide aujourd’hui je n’y arrive pas.
Slt !
OUPS
Je sais pas trop ou tu as écrit tes sensors pour le retour de command_line
Mais évidement comme dit @cob94440 pas méchamment !
Ta structure n’est pas bonne
si tu fais un dans configuration.yam l
command_line:
- sensor:
name:
command:
........
Sinon direct dans command_line.yaml avec un include! dans le config
command_line: !include command_line.yaml
- sensor:
name:
unique_id:
command:
----------
LA DOC !
1 « J'aime »
Regarde cette page et dis moi si tu vois ton erreur.
As tu lu que depuis la 2023.12 et des avertissement avant il me semble le command line allait être différent en yaml.
Je ne dis rien de méchant, juste déjà avant de passer les mises à jour il faut lire le changelog.
Attendre plusieurs mois c’est plutôt suicidaire.
Et aussi les avertissement sur ce forum comme pour les templates qui continuent a être écrit de l’ancienne façon.
Lorsque ce sera obsolète les gars auront oublié et seront perdus pour les modifier.
C’est dommage et ils perdent du temps lors des changements.
Encore une fois rien de méchant.
ILS nous préparent des trucs pas mal pour la version 2025.1
1 « J'aime »
Avec les indications de Doubledom ça fonctionne?
c’est justement mon problème, une fois que ça fonctionne correctement je n’y mets plus les doigts! du coup plusieurs mois après difficile de s’y remettre
concernant ma structure j’ai bien le config.yaml et un package LEGRAND avec tout ce qui concerne l’ecocompteur et maintenant le command_line.yaml depuis ce weekend mais quand j"y mets mes sensors comme indiqué dans mon message ça ne fonctionne pas et je tourne en rond.
Florent80:
- platform: command_line
ça :
- platform: command_line
il ne faut plus le mettre. Regarde la doc et l’exemple de doubledom ton fichier n’est pas bon.
un - sensor: à chaque commande
ok, j’ai mis en commentaire les sensors comportant cette syntaxe dans mon package LEGRAND.
J’ai fait le INCLUDE sur le config.yaml
command_line: !include command_line.yaml.
Concernant mon fichier command_line.yaml quand je veux le valider j’ai le message de clé dupliqué
La structure ressemble à ceci
# Conso HC_B
- sensor:
name: Legrand_HeureCreuse_b
unique_id: Legrand Consommation HC_b
command: !secret Legrand_Cmd_Conso_HC_b
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_b
- sensor:
name: Legrand_HeurePleine_b
unique_id: Legrand Consommation HP_b
command: !secret Legrand_Cmd_Conso_HP_b
scan_interval: 10
unit_of_measurement: kWh
Cela peut paraitre simple pour certains, désolé d’avance
Mets ton fichier complet stp
le comman_line.yaml
# Conso HC_B
- sensor:
name: Legrand_HeureCreuse_b
unique_id: Legrand Consommation HC_b
command: !secret Legrand_Cmd_Conso_HC_b
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_b
- sensor:
name: Legrand_HeurePleine_b
unique_id: Legrand Consommation HP_b
command: !secret Legrand_Cmd_Conso_HP_b
scan_interval: 10
unit_of_measurement: kWh
# Conso. HC_w
name: Legrand_HeureCreuse_w
unique_id: Legrand Consommation HC_W
command: !secret Legrand_Cmd_Conso_HC_w
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_w
name: Legrand Consommation HeurePleine_w
unique_id: Legrand Consommation HP_W
command: !secret Legrand_Cmd_Conso_HP_w
scan_interval: 10
unit_of_measurement: kWh
# Conso. HC_r
name: Legrand_HeureCreuse_r
unique_id: Legrand Consommation HC_r
command: !secret Legrand_Cmd_Conso_HC_r
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_r
name: Legrand Consommation HeurePleine_r
unique_id: Legrand Consommation HP_r
command: !secret Legrand_Cmd_Conso_HP_r
scan_interval: 10
unit_of_measurement: kWh
le config.yaml
# Loads default set of integrations. Do not remove.
homeassistant:
packages: !include_dir_named Packages/
default_config:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml
rest: !include rest.yaml
command_line: !include command_line.yaml
frontend:
themes: !include_dir_merge_named themes
# http:
#ssl_certificate: /ssl/fullchain.pem
#ssl_key: /ssl/privkey.pem
# Example configuration.yaml entry
il manque le début sur chaque sensor !avec
- sensor:
Résumé
# Conso HC_B
- sensor:
name: Legrand_HeureCreuse_b
unique_id: Legrand Consommation HC_b
command: !secret Legrand_Cmd_Conso_HC_b
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_b
- sensor:
name: Legrand_HeurePleine_b
unique_id: Legrand Consommation HP_b
command: !secret Legrand_Cmd_Conso_HP_b
scan_interval: 10
unit_of_measurement: kWh
# Conso. HC_w
- sensor:
name: Legrand_HeureCreuse_w
unique_id: Legrand Consommation HC_W
command: !secret Legrand_Cmd_Conso_HC_w
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_w
- sensor:
name: Legrand Consommation HeurePleine_w
unique_id: Legrand Consommation HP_W
command: !secret Legrand_Cmd_Conso_HP_w
scan_interval: 10
unit_of_measurement: kWh
# Conso. HC_r
- sensor:
name: Legrand_HeureCreuse_r
unique_id: Legrand Consommation HC_r
command: !secret Legrand_Cmd_Conso_HC_r
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_r
- sensor:
name: Legrand Consommation HeurePleine_r
unique_id: Legrand Consommation HP_r
command: !secret Legrand_Cmd_Conso_HP_r
scan_interval: 10
unit_of_measurement: kWh
Merci milles fois à vous pour votre aide cela fonctionne à nouveau
Comme quoi!, il faut pas grand chose pour faire planté le TRUC !
1 « J'aime »
Bonsoir
Ça fait plusieurs semaines que je cherche un code fonctionnel et aussi savoir où le mettre exactement mais je n’ai pas eu de réponse dans le sujet où j’avais posté
Pouvez-vous transmettre ci après l’intégralité des codes pour récupérer les info de ce compteur avec précision des fichiers où il faut les coller ?
Je vous remercie par avance
Dis moi ce que cherches à remonter !
@Florent80 met le fil en résolu sur la solution que je t’ai donné SVP
Salut, bien sûr au moins le prochain qui cherche aura l’intégralité au même endroit !
Donc dans mon configuration.yaml j’ai ceci:
# Loads default set of integrations. Do not remove.
homeassistant:
packages: !include_dir_named Packages/
default_config:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml
rest: !include rest.yaml
command_line: !include command_line.yaml
frontend:
themes: !include_dir_merge_named themes
# http:
#ssl_certificate: /ssl/fullchain.pem
#ssl_key: /ssl/privkey.pem
# Example configuration.yaml entry
Mon fichier command_line ressemble à ceci:
# Conso HC_B
- sensor:
name: Legrand_HeureCreuse_b
unique_id: Legrand Consommation HC_b
command: !secret Legrand_Cmd_Conso_HC_b
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_b
- sensor:
name: Legrand_HeurePleine_b
unique_id: Legrand Consommation HP_b
command: !secret Legrand_Cmd_Conso_HP_b
scan_interval: 10
unit_of_measurement: kWh
# Conso. HC_w
- sensor:
name: Legrand_HeureCreuse_w
unique_id: Legrand Consommation HC_W
command: !secret Legrand_Cmd_Conso_HC_w
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_w
- sensor:
name: Legrand_HeurePleine_w
unique_id: Legrand Consommation HP_W
command: !secret Legrand_Cmd_Conso_HP_w
scan_interval: 10
unit_of_measurement: kWh
# Conso. HC_r
- sensor:
name: Legrand_HeureCreuse_r
unique_id: Legrand Consommation HC_r
command: !secret Legrand_Cmd_Conso_HC_r
scan_interval: 10
unit_of_measurement: kWh
# Conso. HP_r
- sensor:
name: Legrand_HeurePleine_r
unique_id: Legrand Consommation HP_r
command: !secret Legrand_Cmd_Conso_HP_r
scan_interval: 10
unit_of_measurement: kWh
Et pour finir mon dossier Packages contient le fichier Package_Legrand.yaml avec ceci: (Beaucoup de code en commentaire que je n’utilise pas)
#---
############################################################
## ##
## 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: "Chauffage"
icon: mdi:alpha-w-circle-outline
# Circuit 2 = label_entree2
sensor.legrand_puissance_circuit_2:
<<: *customize
friendly_name: "Chauffe eau"
icon: mdi:alpha-w-circle-outline
# Circuit 3 = label_entree3
sensor.legrand_puissance_circuit_3:
<<: *customize
friendly_name: "Cuisine"
icon: mdi:alpha-w-circle-outline
# Circuit 4 = label_entree4
sensor.legrand_puissance_circuit_4:
<<: *customize
friendly_name: "Voiture électrique"
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_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_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
#####################################
## ##
## 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
#####################################
## ##
## SENSORS & TEMPLATES ##
## CONSOMMATIONS ELECTRIQUE ##
## ##
#####################################
# Tarif en Cours Donnée Brute
# 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
# - platform: template
# sensors:
# legrand_hchp:
# entity_id: sensor.legrand_tarif_en_cours
# value_template: >
# {% 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
#####################################
## ##
## 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
- 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
# 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 (HP_b + HC_b + HP_W + HC_w + HP_r + HC_r)
- platform: template
sensors:
legrand_conso_totale:
friendly_name: "Legrand Consommation Totale"
unit_of_measurement: "kWh"
value_template: >-
{{ float(states.sensor.legrand_consommation_hp_b.state) + float(states.sensor.legrand_consommation_hc_b.state) + float(states.sensor.legrand_consommation_hp_w.state) + float(states.sensor.legrand_consommation_hc_w.state) + float(states.sensor.legrand_consommation_hp_r.state) + float(states.sensor.legrand_consommation_hc_r.state) | round(2) }}
#####################################
## ##
## SENSORS COUTS ##
## FACTURATION ELECTRICITE ##
## ##
#####################################
# Sensor Input Text Abonnement
- platform: template
sensors:
electricite_prix_abo:
friendly_name: "Legrand Prix Abo"
unit_of_measurement: "€"
value_template: >
{{ states('input_text.legrand_prix_abo') | round(2) }}
icon_template: mdi:currency-eur
# Sensor Input Text Prix kwh HP_b
- platform: template
sensors:
electricite_prix_kwh_hp_b:
friendly_name: "Legrand Prix kWh HP_b"
unit_of_measurement: "€"
value_template: >
{{ states('input_text.legrand_prix_kwh_hp_b') | round(2) }}
icon_template: mdi:currency-eur
# Sensor Input Text Prix Kwh HC_b
- platform: template
sensors:
electricite_prix_kwh_hc_b:
friendly_name: "Legrand Prix kWh HC_b"
unit_of_measurement: "€"
value_template: >
{{ states('input_text.legrand_prix_kwh_hc_b') | round(2) }}
icon_template: mdi:currency-eur
# Sensor Input Text Prix kwh HP_w
- platform: template
sensors:
electricite_prix_kwh_hp_w:
friendly_name: "Legrand Prix kWh HP_w"
unit_of_measurement: "€"
value_template: >
{{ states('input_text.legrand_prix_kwh_hp_w') | round(2) }}
icon_template: mdi:currency-eur
# Sensor Input Text Prix Kwh HC_w
- platform: template
sensors:
electricite_prix_kwh_hc_w:
friendly_name: "Legrand Prix kWh HC_w"
unit_of_measurement: "€"
value_template: >
{{ states('input_text.legrand_prix_kwh_hc_w') | round(2) }}
icon_template: mdi:currency-eur
# Sensor Input Text Prix kwh HP_r
- platform: template
sensors:
electricite_prix_kwh_hp_r:
friendly_name: "Legrand Prix kWh HP_r"
unit_of_measurement: "€"
value_template: >
{{ states('input_text.legrand_prix_kwh_hp_r') | round(2) }}
icon_template: mdi:currency-eur
# Sensor Input Text Prix Kwh HC_r
- platform: template
sensors:
electricite_prix_kwh_hc_r:
friendly_name: "Legrand Prix kWh HC_r"
unit_of_measurement: "€"
value_template: >
{{ 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
- platform: template
sensors:
energy_daily_cost:
friendly_name: Electricité Coût Quotdien
value_template: >-
{% 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) }}
unit_of_measurement: '€'
icon_template: mdi:currency-eur
# Calcul Coût Hebdomadaire
energy_weekly_cost:
friendly_name: Electricité Coût Hebdo
value_template: >-
{% set a = states('sensor.energy_daily_cost') | 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 ) + ((hp_b + hp_w + hp_r) + (hc_b + hc_w + hc_r ))) | round(2) }}
unit_of_measurement: '€'
icon_template: mdi:currency-eur
# Calcul Coût Mensuel
energy_monthly_cost:
friendly_name: Electricité Coût Mensuel
value_template: >-
{% 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 %}
{{ (a + (hp_b + hp_w + hp_r) + (hc_b + hc_w + hc_r )) | round(2) }}
unit_of_measurement: '€'
icon_template: mdi:currency-eur
# Calcul Coût Annuel
energy_yearly_cost:
friendly_name: Electricité Coût Annuel
value_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 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) + (hp_b + hp_w + hp_r) + (hc_b + hc_w + hc_r )) | round(2) }}
unit_of_measurement: '€'
icon_template: mdi:currency-eur
# Calcul Consommation TOTALE Quotidienne ELECTRICITE
# - platform: template
# sensors:
# energy_daily_total:
# friendly_name: Electricité Consommation Quotidienne Totale
# value_template: >-
# {% 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) }}
# unit_of_measurement: 'kWh'
# icon_template: mdi:counter
#
# Calcul Consommation TOTALE Hebdo ELECTRICITE
# - platform: template
# sensors:
# energy_weekly_total:
# friendly_name: Electricité Consommation Hebdo Totale
# value_template: >-
# {% 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) }}
# unit_of_measurement: 'kWh'
# icon_template: mdi:counter
# Calcul Consommation TOTALE Mensuelle ELECTRICITE
# - platform: template
# sensors:
# energy_monthly_total:
# friendly_name: Electricité Consommation Mensuelle Totale
# value_template: >-
# {% 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) }}
# unit_of_measurement: 'kWh'
# icon_template: mdi:counter
# Calcul Consommation TOTALE Annuelle ELECTRICITE
# - platform: template
# sensors:
# energy_yearly_total:
# friendly_name: Electricité Consommation Annuelle Totale
# value_template: >-
# {% 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) }}
# unit_of_measurement: 'kWh'
# 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
Et dans Secrets.yaml
# Use this file to store secrets like usernames and passwords.
# Learn more at https://www.home-assistant.io/docs/configuration/secrets/
some_password: welcome
Legrand_Source_Data: http://192.168.1.18/data.json
Legrand_Source_Instantanes: http://192.168.1.18/inst.json
Legrand_Cmd_Tarif_Courant: curl -s 'http://192.168.1.18/data.json' | jq '.tarif_courant'
Legrand_Cmd_Intensite_Souscrite: curl -s 'http://192.168.1.18/data.json' | jq '.isousc'
Legrand_Cmd_Conso_HC_b: curl -s 'http://192.168.1.18/data.json' | jq '.conso_hc_b /1000 | floor'
Legrand_Cmd_Conso_HP_b: curl -s 'http://192.168.1.18/data.json' | jq '.conso_hp_b /1000 | floor'
Legrand_Cmd_Conso_HC_w: curl -s 'http://192.168.1.18/data.json' | jq '.conso_hc_w /1000 | floor'
Legrand_Cmd_Conso_HP_w: curl -s 'http://192.168.1.18/data.json' | jq '.conso_hp_w /1000 | floor'
Legrand_Cmd_Conso_HC_r: curl -s 'http://192.168.1.18/data.json' | jq '.conso_hc_r /1000 | floor'
Legrand_Cmd_Conso_HP_r: curl -s 'http://192.168.1.18/data.json' | jq '.conso_hp_r /1000 | floor'
J’éspère que ça t’aidera
Attention tes templates ne sont pas au nouveau format. Profites en pour mettre a jour sinon tu reviendras sans savoir quoi modifier quand le couperet va tomber mdr
1 « J'aime »