Tu définis trop de plateform
template, il t’en faut une seule :
# enedis
- platform: myEnedis
token: XXXXXXXX
code: 221XXXXXXX
hc_cout: 0.0
hp_cout: 0.0
heures_creuses: "[['00:30', '07:00'], ['10:00', '11:30']]"
heuresCreusesON: true
scan_interval: 3600
- platform: template
sensors:
enedis_last_month_kwh:
friendly_name: "Enedis Last month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ state_attr('sensor.myenedis_221XXXX', 'last_month') |round(2) }}
enedis_last_month_cost:
friendly_name: "Enedis Last month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_last_month_kwh_221XXX')|float * 0.158)}}
enedis_current_month_kwh:
friendly_name: "Enedis Current month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ state_attr('sensor.myenedis_221XXXX', 'current_month') |round(2) }}
enedis_current_month_cost:
friendly_name: "Enedis Current month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_current_month_kwh_221XXXX')|float * 0.158)}}
redémarre et dis nous si au moins une entité est présente dans les outils de développement
sas
Mars 2, 2021, 11:42
22
rien n’est présent dans outils de développement / état
OK, procédons par étape :
As tu bien mis le dernier code que je t’ai fourni ?
Je viens de remarquer un truc :
Tu ne peux pas utiliser sensor.enedis_last_month_kwh_221XXX
car il n’est défini nul part, utilise à la place l’entité que tu as créé enedis_last_month_kwh
donc le code est le suivant
Afficher le code
# enedis
- platform: myEnedis
token: XXXXXXXX
code: 221XXXXXXX
hc_cout: 0.0
hp_cout: 0.0
heures_creuses: "[['00:30', '07:00'], ['10:00', '11:30']]"
heuresCreusesON: true
scan_interval: 3600
- platform: template
sensors:
enedis_last_month_kwh:
friendly_name: "Enedis Last month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ state_attr('sensor.myenedis_221XXXX', 'last_month') |round(2) }}
enedis_last_month_cost:
friendly_name: "Enedis Last month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_last_month_kwh')|float * 0.158)}}
enedis_current_month_kwh:
friendly_name: "Enedis Current month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ state_attr('sensor.myenedis_221XXXX', 'current_month') |round(2) }}
enedis_current_month_cost:
friendly_name: "Enedis Current month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_current_month_kwh')|float * 0.158)}}
Tu as bien remplacé les XXXX
par le numero de PDL avant de sauvegarder ?
Que montre le log ? (/config/home-assistant.log)
La vérification (Configuration → Contrôle du serveur → Bouton VERIFIER LA CONFIGURATION ) retourne une erreur ou pas ?
sas
Mars 2, 2021, 4:03
24
je pense que oui.
- platform: myEnedis
token: .....
code: 22....
hc_cout: 0.0
hp_cout: 0.0
heures_creuses: "[['00:30', '07:00'], ['10:00', '11:30']]"
heuresCreusesON: true
scan_interval: 3600
- platform: template
sensors:
enedis_last_month_kwh:
friendly_name: "Enedis Last month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ state_attr('sensor.myenedis_Code PDL', 'last_month') |round(2) }}
enedis_last_month_cost:
friendly_name: "Enedis Last month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_last_month_kwh')|float * 0.158)}}
enedis_current_month_kwh:
friendly_name: "Enedis Current month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ state_attr('sensor.myenedis', 'current_month_Code PDL') |round(2) }}
enedis_current_month_cost:
friendly_name: "Enedis Current month cost"
unit_of_measurement: '€'
value_template: >
{{'%.2f'|format(states('sensor.enedis_current_month_kwh_Code PDL')|float * 0.158)}}
enedis_current_week:
friendly_name: Conso semaine en cours
device_class: energy
unit_of_measurement: 'kWh'
value_template: >
{{ (state_attr('sensor.myenedis_Code PDL','current_week') | float) | round(2) }}
oui le XXX est bien remplacer par mon code PDL
Le log indique des erreur de Dyson et pour le reste mystère
Ne retourne aucune erreur
sas
Mars 22, 2021, 3:50
25
Bien,
il est temps de s’y remettre personne n’en parle vraiment de récupérer les month, last month, year, last year, serait-ce le monstre du Loch ness on en parle mais personne ne l’a vu ?
Les entités sont présentes dans outils de développement ?
sas
Mars 22, 2021, 7:44
27
Non toujours pas je ne comprends pas pourquoi il doit y avoir un mammouth qui m’échappe pire un troupeaux
Si les entités ne sont pas présentes :
Peux tu fournir le contenu du fichier configuration.yaml
(dépourvu de login/mdp/email/etc.) ?
sas
Mars 22, 2021, 9:21
29
pour enedis tout est dans sensors.yaml
Perso, quand je mets le code sans l’intégration enedis, j’ai tout de même les entités qui remontent :
Du coup, je n’ai toujours pas ton fichier de configuration…
sas
Mars 23, 2021, 7:33
31
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
frontend:
themes: !include_dir_merge_named themes
homeassistant:
customize: !include customize.yaml
sensor:
- platform: nespresso
mac: XXX
resource: XXX
scan_interval: 100
- platform: moon
##### Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switch: !include switch.yaml
sensor: !include sensors.yaml
# Mes Groupes
group:
Hue Signe:
name: Hue Signe
entities:
- light.signe_d
- light.signe_g
Bureau:
name: Lampe Bureau
entities:
- light.lampe_bureau
WC Royal:
name: WC Royal
entities:
- light.hue_amb_wc_spot_1
- light.hue_amb_wc_spot_2
Home:
name: Toutes les Lumières
entities:
- light.hue_flamme
- light.hue_ch2
- light.hue_bureau
- light.hue_plafonnier_papa
- light.hue_sdb
- light.hue_sde
- light.hue_terrasse
- switch.sonoff_10007659e7
- group.wc_royal
- group.couloir
- group.Bureau
Couloir:
name: Couloir
entities:
- light.hue_amb_coul_spot_1
- light.hue_amb_coul_spot_2
- light.hue_amb_coul_spot_3
- light.hue_amb_coul_spot_4
Cuisine:
name: Cuisine
entities:
- light.hue_amb_cuis_spot_1
- light.hue_amb_cuis_spot_2
- light.hue_amb_cuis_spot_3
- light.hue_amb_cuis_spot_4
Dyson ico:
name: Dyson
entities:
- fan.unnamed_device
yeelight:
devices:
1XXXX:
name: Lampe Bureau
sonoff:
username: XXX
password: XXX
# required fields
deebot:
username: XXX
password: XXX
country: fr
continent: eu
deviceid: XXX
live_map: True
show_color_rooms: False
livemappath: 'www/live_map.png'
logger:
logs:
homeassistant.components.ecovacs: debug
homeassistant.components.vacuum.cherie: debug
sucks: debug
camera:
- platform: generic
name: Deebot_live_map
still_image_url: XXXX
configuration for livemappath: 'www/live_map.png'
verify_ssl: false
tuya:
username: XXX
password: XXX
country_code: 33
platform: tuya
device_tracker:
- platform: bluetooth_tracker
ble_monitor:
device_tracker:
- platform: xiaomi_miio
host: XXX
token: XXX
switch:
- platform: broadlink
host: XXX
mac: XXX
switches:
- name: LG_TV
command_on: X
command_off: X
# switches:
# - name: ikohs
## Raspbery Pi
sensor:
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /home
- type: memory_free
# Date et time
sensor:
- platform: time_date
display_options:
- 'date'
- platform: template
sensors:
date_template:
friendly_name: 'Date'
value_template: '{{ as_timestamp(now()) | timestamp_custom("%d/%m/%y", True) }}'
- platform: time_date
display_options:
- 'time'
# for Tado
device_tracker:
- platform: tado
username: XXX
password: XXX
home_id: XXX
media_source:
local: /media
et
et
et
Il ne faut pas que tu aies plusieurs fois la même plateforme (dans ton cas sensor:
) de déclarée.
Essaies par exemple ce code :
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
frontend:
themes: !include_dir_merge_named themes
homeassistant:
customize: !include customize.yaml
sensor vrac: # <--------MODIFIE
- platform: nespresso
mac: XXX
resource: XXX
scan_interval: 100
- platform: moon
##### Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switch: !include switch.yaml
sensor: !include sensors.yaml
# Mes Groupes
group:
Hue Signe:
name: Hue Signe
entities:
- light.signe_d
- light.signe_g
Bureau:
name: Lampe Bureau
entities:
- light.lampe_bureau
WC Royal:
name: WC Royal
entities:
- light.hue_amb_wc_spot_1
- light.hue_amb_wc_spot_2
Home:
name: Toutes les Lumières
entities:
- light.hue_flamme
- light.hue_ch2
- light.hue_bureau
- light.hue_plafonnier_papa
- light.hue_sdb
- light.hue_sde
- light.hue_terrasse
- switch.sonoff_10007659e7
- group.wc_royal
- group.couloir
- group.Bureau
Couloir:
name: Couloir
entities:
- light.hue_amb_coul_spot_1
- light.hue_amb_coul_spot_2
- light.hue_amb_coul_spot_3
- light.hue_amb_coul_spot_4
Cuisine:
name: Cuisine
entities:
- light.hue_amb_cuis_spot_1
- light.hue_amb_cuis_spot_2
- light.hue_amb_cuis_spot_3
- light.hue_amb_cuis_spot_4
Dyson ico:
name: Dyson
entities:
- fan.unnamed_device
yeelight:
devices:
1XXXX:
name: Lampe Bureau
sonoff:
username: XXX
password: XXX
# required fields
deebot:
username: XXX
password: XXX
country: fr
continent: eu
deviceid: XXX
live_map: True
show_color_rooms: False
livemappath: 'www/live_map.png'
logger:
logs:
homeassistant.components.ecovacs: debug
homeassistant.components.vacuum.cherie: debug
sucks: debug
camera:
- platform: generic
name: Deebot_live_map
still_image_url: XXXX
configuration for livemappath: 'www/live_map.png'
verify_ssl: false
tuya:
username: XXX
password: XXX
country_code: 33
platform: tuya
device_tracker:
- platform: bluetooth_tracker
ble_monitor:
device_tracker:
- platform: xiaomi_miio
host: XXX
token: XXX
switch:
- platform: broadlink
host: XXX
mac: XXX
switches:
- name: LG_TV
command_on: X
command_off: X
# switches:
# - name: ikohs
## Raspbery Pi
sensor rpi: # <--------MODIFIE
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /home
- type: memory_free
# Date et time
sensor time: # <--------MODIFIE
- platform: time_date
display_options:
- 'date'
- platform: template
sensors:
date_template:
friendly_name: 'Date'
value_template: '{{ as_timestamp(now()) | timestamp_custom("%d/%m/%y", True) }}'
- platform: time_date
display_options:
- 'time'
# for Tado
device_tracker:
- platform: tado
username: XXX
password: XXX
home_id: XXX
media_source:
local: /media
sas
Mars 23, 2021, 5:11
33
C’est noté je regarde merci.
sas
Mars 23, 2021, 5:31
34
Bien ça me donne pleins d’erreurs j’ai restauré ma sauvegarde pour avancer pas à pas.
Le mieux c’est de tout mettre dans sensors.yaml
…
Merci de reprendre ton post et de le mettre en forme
sas
Mars 24, 2021, 8:46
38
j’ai mis enedis dans sensors.yaml
c’est quand même fou que un truc qui apparait ne remonte pas.
# enedis
- platform: myEnedis
token: XXX
code: XXX
hc_cout: 0.0
hp_cout: 0.0
heures_creuses: "[['00:30', '07:00'], ['10:00', '11:30']]"
heuresCreusesON: true
scan_interval: 60
- platform: template
sensors:
enedis_current_week:
friendly_name: Conso semaine en cours
device_class: energy
unit_of_measurement: 'kWh'
value_template: >-
{{ (state_attr('sensor.myenedis_XXX','current_week') | float) | round(2) }}
enedis_last_month_kwh:
friendly_name: "Enedis Last month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ state_attr('sensor.myenedis_XXX', 'last_month') |round(2) }}
sas
Mars 29, 2021, 1:47
39
Merci Clemalex, j’ai enfin résolu mon problème, il en reste encore un la consommation semaine dernière est de 40568 par exemple au lieu de 40.57
Une petite division par 1000 ?
- platform: template
sensors:
enedis_current_week:
friendly_name: Conso semaine en cours
device_class: energy
unit_of_measurement: 'kWh'
value_template: >-
{{ (state_attr('sensor.myenedis_XXX','current_week') | float) | round(2) }}
enedis_last_month_kwh:
friendly_name: "Enedis Last month Kw/h"
unit_of_measurement: 'kwh'
value_template: >
{{ ( (state_attr('sensor.myenedis_XXX', 'last_month') |float)*0.001) |round(2) }}
sas
Mars 29, 2021, 4:58
41
Merci @Clemalex c’est réglé
1 « J'aime »