hi. yes - probably it is due to the “last_reset” which is missing here.
I haven’t tried it by myself yet - but you could create a sensor template where you inherit the properties of this sensor (state & attributes)…
this is just some code I’ve found here in the forum to add some of my solaredge sensors into the energy dashboard.
I just found the following in the logs and I have no idea what this means:
Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:359
Integration: Sensor (documentation, issues)
First occurred: October 1, 2021, 10:12:00 PM (2 occurrences)
Last logged: October 1, 2021, 10:12:00 PM
The unit of sensor.drogertotaal (kWh) does not match the unit of already compiled statistics (None). Generation of long term statistics will be suppressed unless the unit changes back to None
The unit of sensor.koelkastgaragetotaal (kWh) does not match the unit of already compiled statistics (None). Generation of long term statistics will be suppressed unless the unit changes back to None
That might be worth a try. However, they do appear correctly on lovelace dashboards with the correct unit_of_measurement set to kWh (I’ve updated the original post).
Also I do use MariaDB and I have no idea how to access that database. I am unable to find the location since I am using a ‘Generic x86-64’ installation of Home Assistant instead of Pi or Docker.
It doesn’t matter how they appear in Lovelace. The unit is saved with every data point in the statistics table, which is used for the energy dashboard. And it doesn’t match, as per your log.
I have known all the issues above. wondering why I could not add any other socket device to my energy tab.
All ‘settings’ where there. But a no show in adding devices. Turned out I had to put the sensor in recorder.yaml after that (and a restart) I could select the device, it created an ‘warning/error’ at first (the yellow square) that it couldn’t get statistics but of course that was because of the lack of data, it disappeared after an hour…
oh, warning, all (ALL!!!) my data has been lost (at least in the energy tab) after adding the additional devices…
Looks like a total reset of the energy board…