Hi
I had a fully working energy dashboard using the new energy integration however having upgraded to 2022.3.8 I’m having issues with the integration displaying or processing any data
Originally my sensor (which gives the kWh reading over mqtt) worked fine with this code:
- platform: mqtt
name: "Day Energy Smart"
unique_id: "house_cosumption_smart"
device_class: "energy"
state_class: "measurement"
unit_of_measurement: "kWh"
state_topic: "energy/dayuse"
value_template: "{{ value | float * 1 / 1000 | round(2) }}"
last_reset_topic: "energy/dayuse"
last_reset_value_template: homeassistant.util.dt.utc_from_timestamp(0)
Once updated to 2022.3.8 the energy dashboard complained that there was no “last_reset”
The “last_reset_value_template” is not been converted to the “last_reset” anymore I have also confirmed this in the “States” under “developer tools” and the line is missing
So I added “last_reset” to the code above in the config but apparently it is not supported in MQTT as it errors when i check the config
So then I thought OK I will make a template and use the MQTT sensor value processed above and that should work:
- platform: template
sensors:
energy_day_use:
value_template: '{{ states(''sensor.day_energy_smart'') }}'
unit_of_measurement: kWh
device_class: energy
attribute_templates:
state_class: 'measurement'
last_reset: '1970-01-01T00:00:00+00:00'
Well that cured the “last_reset” issue in the energy monitor and the entity “energy_day_use” has the correct values, there are no errors in the logs etc but I get nothing in the Energy integration.
Its worth mentioning I have updated the sqlite3 package to 3.34.1 2021-01-20 as part of the upgrade because the HA logs were indicating that it needed upgrading else recorder wasn’t going to work
Everything else appears to work OK just not the energy dashboard. There are no errors in the log to help point to what the issue might be.
Here is what the device looks like in device states:
And the sensor shows history:
And no issues on the Energy dashboard:
But still the energy integration is sad:
Any ideas or suggestions would be great!
Thank you