I am trying to integrate my ShellyProEM50 into Homeassistant using a configuration.yaml but for any reason I don’t understand the entity “Energieverbrauch Heizung” and “Energy Total Heizung” don’t show up in the list of entities…
Here a copy of my yaml-script - hope you guys have a smart idea what’s wrong - and many thanks in advance for your thoughts / tips / hints !
Sorry - was trying yesterday already to post it in better format but haven’t been able to find a proper way to get it done properly (until now… )
Thanks very much for this hint and hopefully you have also a smart idea what’s wrong in my code and why the entity doesn’t show up in the list as expected.
Thx Rolf
type or paste code here
```# Loads default set of integrations. Do not remove.
default_config:
frontend:
themes: !include_dir_merge_named themes
# Load frontend themes from the themes folder
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
template:
- sensor:
- name: "Energieverbrauch Heizung"
unique_id: power_total_heizung
state: >
{{ states('sensor.shellyproem50_08f9e0e68e48_em1_power')|float(0) +
states('sensor.shellyproem50_08f9e0e68e48_em0_power')|float(0) }}
unit_of_measurement: W
device_class: power
state_class: measurement
availability: >
{{
[ states('sensor.shellyproem50_08f9e0e68e48_em1_power'),
states('sensor.shellyproem50_08f9e0e68e48_em0_power') ] | map('is_number') | min }}
- sensor:
- name: "Energy Total Heizung"
unique_id: energy_total_heizung
state: >
{{ states('sensor.shellyproem50_08f9e0e68e48_em0_total_active_energy')|float(0) +
states('sensor.shellyproem50_08f9e0e68e48_em1_total_active_energy')|float(0) }}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
attributes:
last_reset: "1970-01-01T00:00:00+00:00"
availability: >
{{
[ states('sensor.shellyproem50_08f9e0e68e48_em0_total_active_energy'),
states('sensor.shellyproem50_08f9e0e68e48_em1_total_active_energy') ] | map('is_number') | min }}
the config for the EM3 works perfectly.
The issue I have is with the EM50 - the YAML-script doesn’s show up in the list of entities I can connect - this is what annoys me so much and I don’t understand the reason for.
Here the script for the EM50:
# Loads default set of integrations. Do not remove.
default_config:
frontend:
themes: !include_dir_merge_named themes
# Load frontend themes from the themes folder
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
template:
- sensor:
- name: "Energieverbrauch Heizung"
unique_id: Energieverbrauch Heizung
state: >
{{ states('sensor.shellyproem50_08f9e0e68e48_em1_power')|float(0) +
states('sensor.shellyproem50_08f9e0e68e48_em0_power')|float(0) }}
unit_of_measurement: W
device_class: power
state_class: measurement
availability: >
{{
[ states('sensor.shellyproem50_08f9e0e68e48_em1_power'),
states('sensor.shellyproem50_08f9e0e68e48_em0_power') ] | map('is_number') | min }}
- sensor:
- name: "Energy Total Heizung"
unique_id: Energy Total Heizung
state: >
{{ states('sensor.shellyproem50_08f9e0e68e48_em0_total_active_energy')|float(0) +
states('sensor.shellyproem50_08f9e0e68e48_em1_total_active_energy')|float(0) }}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
attributes:
last_reset: "1970-01-01T00:00:00+00:00"
availability: >
{{
[ states('sensor.shellyproem50_08f9e0e68e48_em0_total_active_energy'),
states('sensor.shellyproem50_08f9e0e68e48_em1_total_active_energy') ] | map('is_number') | min }}
ok thnaks guys - but now please tell me which of the both is correct and which not…
I suspect the EM3 yaml is correct and the EM50 need to be changed - is is this what you mean?
First of all many thanks for taking the effort to put all together into one yaml - realyl very much appreciated!
I copied and pasted it into a new test.yaml and restarted the machinery completly - however the entity “Energieverbrauch Heizung” and “Energy Total Heizung” still doesn’t turn up in the entlty list where I can chose from to include in a batch in my dahsboard.
How do you include the test.yaml file in the configuration? Is it just a new file? If so, HA will skip it - this file is not part of the configuration.
The configuration is in the configuration.yaml file.
Folks unfortunately have to leave now for a birthday party and won’t be back before Sunday some time…
But I will take a closer look asap. and this way sincere thanks for your extended help! (I might need to come back to it eventualyl but Bieniu’s hint might be pointing to the problem…!)
Will let you know the outcome!
Have a great weekend guys!
Rolf