Hey Colleagues,
i try now for days to add an entity to my energy dasboard without success and i kindly ask for help.
What i want to do?
I created a ai-on-the-edge device to capture my gas consumption. Link: Ai-on-the-edge
I added an entity according to homeassistant rules that some important characteristics are covered, see long-term-statistics but i think i took everything to the coding…
mqtt:
#Ai on the edge
sensor:
#Gaszähler
- name: "Gaszaehler AIOE"
state_topic: "gaszaehler/main/value"
value_template: "{{ value }}"
unit_of_measurement: m3
icon: mdi:flash
unique_id: zaehlerstand_gas
state_class: measurement
device_class: gas
last_reset_value_template: '1970-01-01T00:00:00+00:00'
Unfortunately, i cannot select the created entity from the drop-down menu in the energy dashboard, see
Help is highly appreciated…
Many thanks
Tobi
I’ll suggest to try changing the state_class to ‘total_increasing’
Many thanks!
Tried this as well without success … i played around several times but there is unfortunately no improvement
mqtt:
#Ai on the edge
sensor:
#Gaszähler
- name: "Gaszaehler AIOE"
state_topic: "gaszaehler/main/value"
value_template: "{{ value }}"
unit_of_measurement: m3
icon: mdi:flash
unique_id: zaehlerstand_gas
state_class: total_increasing
device_class: gas
last_reset_value_template: '1970-01-01T00:00:00+00:00'
I’m surprised it didn’t work. It seems to work for me using the total_increasing state_class.
Edit: On second look… it might be because you’re using the ‘old’ template format:
A state_class of total
or total_increasing
is required for the sensors to be available in the energy dashboard.
The legacy template sensor platform does not support state_class as an option. You will have to use customize to add it to the sensors.
Or start using the new template integration which does support state_class.
You should also be supplying defaults for your float
filters and be using an availability template to protect your energy dashboard from junk data.
i think you guided me somehow to the right point…
i did use the new template already, meaning this tip was not the one to solve this issue, but i found a post where you extracted your hint, meaning everyone facing a similar issuie go here:
https://community.home-assistant.io/t/energy-dashboard-sensor-not-showing-up/438537/4?u=baggerfahrer21