Bonsoir Merci
J’ai ajouté dans config/sensors.yaml
- platform: template
sensors:
enedis_last_month_kwh:
friendly_name: "Enedis Last month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{'%.2f'|format(state_attr('sensor.myenedis_XXX', 'last_month'))}}
- platform: template
sensors:
enedis_last_month_cost:
friendly_name: "Enedis Last month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_last_month_kwh_XXX')|float * 0.158)}}
- platform: template
sensors:
enedis_current_month_kwh:
friendly_name: "Enedis Current month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{'%.2f'|format(state_attr('sensor.myenedis_XXX', 'current_month'))}}
- platform: template
sensors:
enedis_current_month_cost:
friendly_name: "Enedis Current month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_current_month_kwh_XXX')|float * 0.158)}}
Les XXX correspondant à mon PDL
Extrait de outil développement état
daily_cost: 1.17
yesterday_HC: 0.000
yesterday_HP: 5.591
current_week: 0.000
last_month: 157.341
current_month: 0.000
last_year: 1995.825
current_year: 332.983
errorLastCall:
monthly_evolution: 7.079