(25/03/2024, 12:05:59)Ives a écrit :(24/03/2024, 11:51:13)XeNo a écrit : J'arrive à calculer un tarif tempo en simulant tout (j'ai la saisie des tarifs et je récupère le tarif tempo chez edf)Je ne comprends pas comment du récupères les consommations des 6 plages horaires du TE331 sans utiliser NR ?
Et mes conso viennent des TE331 donc elles sont exposées sur HA.
Du coup, je ne comprends pas pourquoi il y a du Node Red ?
Pour disposer des 6 index TEMPO, le TE331 doit être configuré en mode 6 octets (énergie et information tarifaire) ; chaque octet étant émis sur le bus à intervalle de 5 secondes, il faut ensuite "trier".
Le DPT utilisé est le 235.001 dont le format est le suivant :
Si tu as trouvé une solution plus simple je suis preneur.
Salut Ives,
Ca y est, j'ai enfin réussi !
Donc perso je rappelle, je suis en tarification classique et j'aimerai projeter du Tempo. Déjà pour voir la différence réélle sur ma conso, et aussi parce que le board Energy ne sait pas gérer le multitarifs (ou du moins je n'ai pas vu à quel endroit encore)
- Configuration.yaml
Code :
homeassistant:
packages: !include_dir_named packages
input_number: !include input_number.yaml
rest: !include rest.yaml
- Le fichier input_number.yaml pour le calcul des coûts
Code :
####################################
# Input des tarifs Tempo
####################################
electricite_general_cout_actuel:
name: Cout Kwh en cours
mode: box
min: 0
max: 100
unit_of_measurement: "€/kWh"
icon: mdi:currency-eur
electricite_general_cout_kwh_bleu_hp:
name: Cout Kwh Bleu HP
mode: box
min: 0
max: 100
unit_of_measurement: "€/kWh"
icon: mdi:currency-eur
electricite_general_cout_kwh_bleu_hc:
name: Cout Kwh Bleu HC
mode: box
min: 0
max: 100
unit_of_measurement: "€/kWh"
icon: mdi:currency-eur
electricite_general_cout_kwh_blanc_hp:
name: Cout Kwh Blanc HP
mode: box
min: 0
max: 100
unit_of_measurement: "€/kWh"
icon: mdi:currency-eur
electricite_general_cout_kwh_blanc_hc:
name: Cout Kwh Blanc HC
mode: box
min: 0
max: 100
unit_of_measurement: "€/kWh"
icon: mdi:currency-eur
electricite_general_cout_kwh_rouge_hp:
name: Cout Kwh Rouge HP
mode: box
min: 0
max: 100
unit_of_measurement: "€/kWh"
icon: mdi:currency-eur
electricite_general_cout_kwh_rouge_hc:
name: Cout Kwh Rouge HC
mode: box
min: 0
max: 100
unit_of_measurement: "€/kWh"
icon: mdi:currency-eur
- Fichiers yaml dans packages
ici pour l'ECS :
Code :
################################################
### Energy_ecs.yaml ###
### Fichier d'integration des energies Tempo ###
### ###
### Mesure concernée = ECS ###
### Consommations et Couts ###
### - Journalier (6 Tarifs) ###
### - Hebdomadaire (6 Tarifs) ###
### - Mensuel (6 Tarifs) ###
### - Annuel (6 Tarifs) ###
### ###
################################################
############### SENSORS ###################
sensor:
- platform: template
sensors:
############### Total Energie Jour/Semaine/Mois/Année
###### Total journalier
energy_total_ecs_daily:
friendly_name: 'Energie totale journalière ECS consommée Tempo'
entity_id:
- sensor.energy_total_ecs_usage_daily_bleu_hp
- sensor.energy_total_ecs_usage_daily_bleu_hc
- sensor.energy_total_ecs_usage_daily_blanc_hp
- sensor.energy_total_ecs_usage_daily_blanc_hc
- sensor.energy_total_ecs_usage_daily_rouge_hp
- sensor.energy_total_ecs_usage_daily_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_daily_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_daily_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_daily_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_daily_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_daily_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_daily_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "kWh"
cout_total_ecs_daily:
friendly_name: 'Cout total journée ECS Tempo'
entity_id:
- sensor.energy_total_ecs_usage_daily_bleu_hp
- sensor.energy_total_ecs_usage_daily_bleu_hc
- sensor.energy_total_ecs_usage_daily_blanc_hp
- sensor.energy_total_ecs_usage_daily_blanc_hc
- sensor.energy_total_ecs_usage_daily_rouge_hp
- sensor.energy_total_ecs_usage_daily_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_daily_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_daily_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_daily_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_daily_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_daily_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_daily_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "€"
###### Total semaine
energy_total_ecs_weekly:
friendly_name: 'Energie totale semaine ECS consommée Tempo'
entity_id:
- sensor.energy_total_ecs_usage_weekly_bleu_hp
- sensor.energy_total_ecs_usage_weekly_bleu_hc
- sensor.energy_total_ecs_usage_weekly_blanc_hp
- sensor.energy_total_ecs_usage_weekly_blanc_hc
- sensor.energy_total_ecs_usage_weekly_rouge_hp
- sensor.energy_total_ecs_usage_weekly_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_weekly_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_weekly_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_weekly_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_weekly_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_weekly_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_weekly_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "kWh"
cout_total_ecs_weekly:
friendly_name: 'Cout total semaine ECS Tempo'
entity_id:
- sensor.energy_total_ecs_usage_weekly_bleu_hp
- sensor.energy_total_ecs_usage_weekly_bleu_hc
- sensor.energy_total_ecs_usage_weekly_blanc_hp
- sensor.energy_total_ecs_usage_weekly_blanc_hc
- sensor.energy_total_ecs_usage_weekly_rouge_hp
- sensor.energy_total_ecs_usage_weekly_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_weekly_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_weekly_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_weekly_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_weekly_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_weekly_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_weekly_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "€"
###### Total mensuel
energy_total_ecs_monthly:
friendly_name: 'Energie totale mensuelle ECS consommée Tempo'
entity_id:
- sensor.energy_total_ecs_usage_monthly_bleu_hp
- sensor.energy_total_ecs_usage_monthly_bleu_hc
- sensor.energy_total_ecs_usage_monthly_blanc_hp
- sensor.energy_total_ecs_usage_monthly_blanc_hc
- sensor.energy_total_ecs_usage_monthly_rouge_hp
- sensor.energy_total_ecs_usage_monthly_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_monthly_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_monthly_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_monthly_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_monthly_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_monthly_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_monthly_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "kWh"
cout_total_ecs_monthly:
friendly_name: 'Cout total mensuel ECS Tempo'
entity_id:
- sensor.energy_total_ecs_usage_monthly_bleu_hp
- sensor.energy_total_ecs_usage_monthly_bleu_hc
- sensor.energy_total_ecs_usage_monthly_blanc_hp
- sensor.energy_total_ecs_usage_monthly_blanc_hc
- sensor.energy_total_ecs_usage_monthly_rouge_hp
- sensor.energy_total_ecs_usage_monthly_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_monthly_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_monthly_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_monthly_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_monthly_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_monthly_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_monthly_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "€"
###### Total annuel
energy_total_ecs_yearly:
friendly_name: 'Energie totale annuelle ECS consommée Tempo'
entity_id:
- sensor.energy_total_ecs_usage_yearly_bleu_hp
- sensor.energy_total_ecs_usage_yearly_bleu_hc
- sensor.energy_total_ecs_usage_yearly_blanc_hp
- sensor.energy_total_ecs_usage_yearly_blanc_hc
- sensor.energy_total_ecs_usage_yearly_rouge_hp
- sensor.energy_total_ecs_usage_yearly_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_yearly_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_yearly_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_yearly_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_yearly_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_yearly_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_yearly_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "kWh"
cout_total_ecs_yearly:
friendly_name: 'Cout total annuel ECS Tempo'
entity_id:
- sensor.energy_total_ecs_usage_yearly_bleu_hp
- sensor.energy_total_ecs_usage_yearly_bleu_hc
- sensor.energy_total_ecs_usage_yearly_blanc_hp
- sensor.energy_total_ecs_usage_yearly_blanc_hc
- sensor.energy_total_ecs_usage_yearly_rouge_hp
- sensor.energy_total_ecs_usage_yearly_rouge_hc
value_template: "{{ (((states('sensor.energy_total_ecs_usage_yearly_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float) + (states('sensor.energy_total_ecs_usage_yearly_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float) + (states('sensor.energy_total_ecs_usage_yearly_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float) + (states('sensor.energy_total_ecs_usage_yearly_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float) + (states('sensor.energy_total_ecs_usage_yearly_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float) + (states('sensor.energy_total_ecs_usage_yearly_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float))/1000)|round(3) }}"
unit_of_measurement: "€"
############### Total Coûts par période Jour/Semaine/Mois/Année et par tarifs
############### TEMPO BLEU
###### Journalier
cout_total_ecs_daily_bleu_hp:
friendly_name: 'Coût journalier ECS Bleu HP'
entity_id:
- sensor.energy_total_ecs_usage_daily_bleu_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_daily_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_daily_bleu_hc:
friendly_name: 'Coût journalier ECS Bleu HC'
entity_id:
- sensor.energy_total_ecs_usage_daily_bleu_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_daily_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Hebdomadaire
cout_total_ecs_weekly_bleu_hp:
friendly_name: 'Coût hebdomadaire ECS Bleu HP'
entity_id:
- sensor.energy_total_ecs_usage_weekly_bleu_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_weekly_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_weekly_bleu_hc:
friendly_name: 'Coût hebdomadaire ECS Bleu HC'
entity_id:
- sensor.energy_total_ecs_usage_weekly_bleu_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_weekly_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Mensuel
cout_total_ecs_monthly_bleu_hp:
friendly_name: 'Coût mensuel ECS Bleu HP'
entity_id:
- sensor.energy_total_ecs_usage_monthly_bleu_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_monthly_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_monthly_bleu_hc:
friendly_name: 'Coût mensuel ECS Bleu HC'
entity_id:
- sensor.energy_total_ecs_usage_monthly_bleu_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_monthly_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Annuel
cout_total_ecs_yearly_bleu_hp:
friendly_name: 'Coût annuel ECS Bleu HP'
entity_id:
- sensor.energy_total_ecs_usage_yearly_bleu_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_yearly_bleu_hp')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_yearly_bleu_hc:
friendly_name: 'Coût annuel ECS Bleu HC'
entity_id:
- sensor.energy_total_ecs_usage_yearly_bleu_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_yearly_bleu_hc')|float)*(states('input_number.electricite_general_cout_kwh_bleu_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
############### TEMPO BLANC
###### Journalier
cout_total_ecs_daily_blanc_hp:
friendly_name: 'Coût journalier ECS Blanc HP'
entity_id:
- sensor.energy_total_ecs_usage_daily_blanc_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_daily_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_daily_blanc_hc:
friendly_name: 'Coût journalier ECS Blanc HC'
entity_id:
- sensor.energy_total_ecs_usage_daily_blanc_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_daily_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Hebdomadaire
cout_total_ecs_weekly_blanc_hp:
friendly_name: 'Coût hebdomadaire ECS Blanc HP'
entity_id:
- sensor.energy_total_ecs_usage_weekly_blanc_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_weekly_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_weekly_blanc_hc:
friendly_name: 'Coût hebdomadaire ECS Blanc HC'
entity_id:
- sensor.energy_total_ecs_usage_weekly_blanc_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_weekly_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Mensuel
cout_total_ecs_monthly_blanc_hp:
friendly_name: 'Coût mensuel ECS Blanc HP'
entity_id:
- sensor.energy_total_ecs_usage_monthly_blanc_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_monthly_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_monthly_blanc_hc:
friendly_name: 'Coût mensuel ECS Blanc HC'
entity_id:
- sensor.energy_total_ecs_usage_monthly_blanc_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_monthly_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Annuel
cout_total_ecs_yearly_blanc_hp:
friendly_name: 'Coût annuel ECS Blanc HP'
entity_id:
- sensor.energy_total_ecs_usage_yearly_blanc_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_yearly_blanc_hp')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_yearly_blanc_hc:
friendly_name: 'Coût annuel ECS Blanc HC'
entity_id:
- sensor.energy_total_ecs_usage_yearly_blanc_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_yearly_blanc_hc')|float)*(states('input_number.electricite_general_cout_kwh_blanc_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
############### TEMPO ROUGE
###### Journalier
cout_total_ecs_daily_rouge_hc:
friendly_name: 'Coût journalier ECS Rouge HC'
entity_id:
- sensor.energy_total_ecs_usage_daily_rouge_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_daily_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_daily_rouge_hp:
friendly_name: 'Coût journalier ECS Rouge HP'
entity_id:
- sensor.energy_total_ecs_usage_daily_rouge_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_daily_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Hebdomadaire
cout_total_ecs_weekly_rouge_hp:
friendly_name: 'Coût hebdomadaire ECS Rouge HP'
entity_id:
- sensor.energy_total_ecs_usage_weekly_rouge_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_weekly_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_weekly_rouge_hc:
friendly_name: 'Coût hebdomadaire ECS Rouge HC'
entity_id:
- sensor.energy_total_ecs_usage_weekly_rouge_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_weekly_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Mensuel
cout_total_ecs_monthly_rouge_hp:
friendly_name: 'Coût mensuel ECS Rouge HP'
entity_id:
- sensor.energy_total_ecs_usage_monthly_rouge_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_monthly_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_monthly_rouge_hc:
friendly_name: 'Coût mensuel ECS Rouge HC'
entity_id:
- sensor.energy_total_ecs_usage_monthly_rouge_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_monthly_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Annuel
cout_total_ecs_yearly_rouge_hp:
friendly_name: 'Coût annuel ECS Rouge HP'
entity_id:
- sensor.energy_total_ecs_usage_yearly_rouge_hp
value_template: "{{ ((states('sensor.energy_total_ecs_usage_yearly_rouge_hp')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hp')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
cout_total_ecs_yearly_rouge_hc:
friendly_name: 'Coût annuel ECS Rouge HC'
entity_id:
- sensor.energy_total_ecs_usage_yearly_rouge_hc
value_template: "{{ ((states('sensor.energy_total_ecs_usage_yearly_rouge_hc')|float)*(states('input_number.electricite_general_cout_kwh_rouge_hc')|float)/1000)|round(3) }}"
unit_of_measurement: "€"
###### Creation des variables d'energie en kwh
###### Journalier
energy_total_ecs_usage_daily_bleu_hp_kwh:
friendly_name: "Energie Jour ECS Bleu HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_daily_bleu_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_daily_bleu_hc_kwh:
friendly_name: "Energie Jour ECS Bleu HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_daily_bleu_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_daily_blanc_hp_kwh:
friendly_name: "Energie Jour ECS Blanc HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_daily_blanc_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_daily_blanc_hc_kwh:
friendly_name: "Energie Jour ECS Blanc HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_daily_blanc_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_daily_rouge_hp_kwh:
friendly_name: "Energie Jour ECS Rouge HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_daily_rouge_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_daily_rouge_hc_kwh:
friendly_name: "Energie Jour ECS Rouge HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_daily_rouge_hc.state | float) /1000) | round(2) }}'
###### Hebdomadaire
energy_total_ecs_usage_weekly_bleu_hp_kwh:
friendly_name: "Energie Semaine ECS Bleu HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_weekly_bleu_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_weekly_bleu_hc_kwh:
friendly_name: "Energie Semaine ECS Bleu HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_weekly_bleu_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_weekly_blanc_hp_kwh:
friendly_name: "Energie Semaine ECS Blanc HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_weekly_blanc_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_weekly_blanc_hc_kwh:
friendly_name: "Energie Semaine ECS Blanc HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_weekly_blanc_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_weekly_rouge_hp_kwh:
friendly_name: "Energie Semaine ECS Rouge HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_weekly_rouge_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_weekly_rouge_hc_kwh:
friendly_name: "Energie Semaine ECS Rouge HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_weekly_rouge_hc.state | float) /1000) | round(2) }}'
###### Mensuel
energy_total_ecs_usage_monthly_bleu_hp_kwh:
friendly_name: "Energie Mois ECS Bleu HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_monthly_bleu_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_monthly_bleu_hc_kwh:
friendly_name: "Energie Mois ECS Bleu HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_monthly_bleu_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_monthly_blanc_hp_kwh:
friendly_name: "Energie Mois ECS Blanc HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_monthly_blanc_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_monthly_blanc_hc_kwh:
friendly_name: "Energie Mois ECS Blanc HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_monthly_blanc_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_monthly_rouge_hp_kwh:
friendly_name: "Energie Mois ECS Rouge HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_monthly_rouge_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_monthly_rouge_hc_kwh:
friendly_name: "Energie Mois ECS Rouge HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_monthly_rouge_hc.state | float) /1000) | round(2) }}'
###### Annuel
energy_total_ecs_usage_yearly_bleu_hp_kwh:
friendly_name: "Energie Annee ECS Bleu HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_yearly_bleu_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_yearly_bleu_hc_kwh:
friendly_name: "Energie Annee ECS Bleu HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_yearly_bleu_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_yearly_blanc_hp_kwh:
friendly_name: "Energie Annee ECS Blanc HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_yearly_blanc_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_yearly_blanc_hc_kwh:
friendly_name: "Energie Annee ECS Blanc HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_yearly_blanc_hc.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_yearly_rouge_hp_kwh:
friendly_name: "Energie Annee ECS Rouge HP kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_yearly_rouge_hp.state | float) /1000) | round(2) }}'
energy_total_ecs_usage_yearly_rouge_hc_kwh:
friendly_name: "Energie Annee ECS Rouge HC kWh"
unit_of_measurement: "kWh"
device_class: energy
value_template: '{{ ((states.sensor.energy_total_ecs_usage_yearly_rouge_hc.state | float) /1000) | round(2) }}'
############### UTILITY METERS #################
utility_meter:
###### Total journalier
energy_total_ecs_usage_daily:
source: sensor.energie_totale_ecs
name: "Energie Journaliere Tempo ECS"
cycle: daily
tariffs:
- Bleu HP
- Bleu HC
- Blanc HP
- Blanc HC
- Rouge HP
- Rouge HC
###### Total hebdomadaire
energy_total_ecs_usage_weekly:
source: sensor.energie_totale_ecs
name: "Energie hebdomadaire Tempo ECS"
cycle: weekly
tariffs:
- Bleu HP
- Bleu HC
- Blanc HP
- Blanc HC
- Rouge HP
- Rouge HC
###### Total mensuel
energy_total_ecs_usage_monthly:
source: sensor.energie_totale_ecs
name: "Energie mensuelle Tempo ECS"
cycle: monthly
tariffs:
- Bleu HP
- Bleu HC
- Blanc HP
- Blanc HC
- Rouge HP
- Rouge HC
###### Total annuel
energy_total_ecs_usage_yearly:
source: sensor.energie_totale_ecs
name: "Energie annuelle Tempo ECS"
cycle: yearly
tariffs:
- Bleu HP
- Bleu HC
- Blanc HP
- Blanc HC
- Rouge HP
- Rouge HC
Côté explication, c'est simple, cela me crée mes templates de sensor :
D'abord tous les totaux puissances et coûts pour le jour/semaine/mois/annee
- energy_total_ecs_daily
- cout_total_ecs_daily
- energy_total_ecs_weekly
- cout_total_ecs_weekly
- energy_total_ecs_monthly
- cout_total_ecs_monthly
- energy_total_ecs_yearly
- cout_total_ecs_yearly
- cout_total_ecs_daily_bleu_hp
- cout_total_ecs_daily_bleu_hc
- cout_total_ecs_weekly_bleu_hp
- cout_total_ecs_weekly_bleu_hc
- cout_total_ecs_monthly_bleu_hp
- cout_total_ecs_monthly_bleu_hc
- cout_total_ecs_yearly_bleu_hp
- cout_total_ecs_yearly_bleu_hc
Ensuite je convertis les sensors de consommations de l'utility_meter qui sont en Wh en kWh
ici uniquement le journalier, mais il faut la même chose pour chaque cycle
- energy_total_ecs_usage_daily_bleu_hp_kwh
- energy_total_ecs_usage_daily_bleu_hc_kwh
- energy_total_ecs_usage_daily_blanc_hp_kwh
- energy_total_ecs_usage_daily_blanc_hc_kwh
- energy_total_ecs_usage_daily_rouge_hp_kwh
- energy_total_ecs_usage_daily_rouge_hc_kwh
Et enfin les utility_meter à mesurer :
Ce qui compte ici c'est la source de la mesure, qui vient des mesures knx d'un TE331, sensor.energie_totale_ecs pour moi pour ce fichier là
- energy_total_ecs_usage_daily
- energy_total_ecs_usage_weekly
- energy_total_ecs_usage_monthly
- energy_total_ecs_usage_yearly
Il faut ensuite multiplier ce fichier par le nombre de mesures, et renommer ECS sur la cible concernées (Prises, Froid, Lumières, etc.)
- Les Automations
J'ai donc 6 Automations comme celles-ci :
- Tempo HC Bleu
- Tempo HP Bleu
- Tempo HC Blanc
- Tempo HP Blanc
- Tempo HC Rouge
- Tempo HP Rouge
Exemple pour Tempo HC Bleu :
Code :
alias: Tempo HC Bleu
description: ""
trigger:
- platform: time
at: "22:00:00"
variables:
tariff: Bleu HC
condition:
- condition: state
entity_id: sensor.tempo_aujourd_hui
state: BLEU
action:
- service: select.select_option
target:
entity_id: select.energy_total_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_ecs_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_ecs_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_ecs_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_ecs_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lt_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lt_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lt_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lt_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lumieres_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lumieres_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lumieres_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_lumieres_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_prises_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_prises_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_prises_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_prises_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_groupesfroid_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_groupesfroid_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_groupesfroid_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_groupesfroid_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrocuisine_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrocuisine_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrocuisine_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrocuisine_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrobuanderie_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrobuanderie_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrobuanderie_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_electrobuanderie_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffage_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffage_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffage_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffage_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagevmc_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagevmc_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagevmc_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagevmc_usage_yearly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagesdb_usage_daily
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagesdb_usage_weekly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagesdb_usage_monthly
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.energy_total_chauffagesdb_usage_yearly
data:
option: "{{ tariff }}"
mode: single
- Les récupérations des infos Tempo
Code :
- resource_template: https://particulier.edf.fr/services/rest/referentiel/searchTempoStore?dateRelevant={{now().strftime("%Y-%m-%d")}}
scan_interval: 21600
sensor:
- name: "Tempo Demain"
value_template: "{{ value_json['couleurJourJ1']|regex_replace(find='^TEMPO_', replace='') }}"
- name: "Tempo Aujourd'hui"
value_template: "{{ value_json['couleurJourJ']|regex_replace(find='^TEMPO_', replace='') }}"
- resource: https://particulier.edf.fr/services/rest/referentiel/getNbTempoDays?TypeAlerte=TEMPO
scan_interval: 21600
sensor:
- name: "Jours Rouge restants"
value_template: "{{ value_json.PARAM_NB_J_ROUGE }}"
- name: "Jours Blanc restants"
value_template: "{{ value_json.PARAM_NB_J_BLANC }}"
- name: "Jours Bleu restants"
value_template: "{{ value_json.PARAM_NB_J_BLEU }}"
Et enfin, le dashboard associé à tout cela :
Voilà pour moi, sans usage de nodered du tout du coup. (J'ai toujours pas compris à quoi ça servait )