jlnbln
(Julian)
July 20, 2023, 2:04pm
1
Hey everyone.
I am trying to get my energy consumption into the energy dashboard.
I created these two template sensors from data I get from an ESP, but I can’t pick them in the energy dashboard. Any ideas why?
template:
- sensor:
- name: "Energy Consumption"
unique_id: energy_consumption
state: |
{{ states('sensor.tasmota_mt681_total_in')}}
state_class: total_increasing
unit_of_measurement: "kWh"
device_class: energy
icon: mdi:transmission-tower-import
- sensor:
- name: "Energy Return"
unique_id: energy_return
state: |
{{ states('sensor.tasmota_mt681_total_out')}}
state_class: total_increasing
unit_of_measurement: "kWh"
device_class: energy
icon: mdi:transmission-tower-export
Help is much appreciated!
Cheers!
petro
(Petro)
July 20, 2023, 2:13pm
2
Did you restart HA when you added the template entities?
jlnbln
(Julian)
July 20, 2023, 2:46pm
3
Yes I did. But still they won’t show up.
petro
(Petro)
July 20, 2023, 2:48pm
4
If the entities don’t appear at all in your system, you may have placed them in the wrong spot.
jlnbln
(Julian)
July 20, 2023, 2:49pm
5
I can see the entities under integrations. They just are not available in the energy dashboard.
petro
(Petro)
July 20, 2023, 2:52pm
6
Template entities do not show up under an integration. They will show up on the entities tab or developer tools → states page.
The requirements to show up on the energy dashboard:
Have device_class: energy
Have state_class
Are being recorded in your database
jlnbln
(Julian)
July 20, 2023, 2:56pm
7
Okay my bad. They are showing up under entities. That’s what I meant. They are working entities
As you can see in my code. I have both device_class: energy and state_class defined, so I don’t understand why they are not showing up in the energy dashboard.
How can I check if they are being recorded in my database? I can see them in the HA UI as entities, doesn’t that mean they are being recorded?
petro
(Petro)
July 20, 2023, 2:57pm
8
The entities must have a history
jlnbln
(Julian)
July 20, 2023, 3:00pm
9
Okay I found the solution… for anyone struggling like me.
Under Developer Tools → Statistic I needed to fix an issue with the entities.
That was it.
Thanks @petro for the help!
3 Likes
Have been looking for ages to get this working. This helped me. Hero!
1 Like
This fixed an issue I was having. Thank you.
1 Like
OzGav
(Oz Gav)
August 7, 2024, 2:07am
12
I’m at a loss in my case. No issues in the statistics area. The top entity I can add to the energy dashboard but none of the others. Any idea?
petro
(Petro)
August 7, 2024, 11:48am
13
How are you trying to add it?
OzGav
(Oz Gav)
August 7, 2024, 12:38pm
14
Just as an individual device on the default energy dashboard
petro
(Petro)
August 7, 2024, 12:44pm
15
Can you show a screenshot please?
petro
(Petro)
August 7, 2024, 1:26pm
17
You’re showing a screenshot of entities in your first post, and a UI that only accepts devices. They are not the same thing.
OzGav
(Oz Gav)
August 7, 2024, 8:56pm
18
I see your point but I was able to add the first entity?