CircuitSetup / Expandable-6-Channel-ESP32-Energy-Meter

Hardware & Software documentation for the CircuitSetup Expandable 6 Channel ESP32 Energy Meter. Works with ESPHome and Home Assistant.
https://circuitsetup.us/product/expandable-6-channel-esp32-energy-meter/
MIT License
511 stars 102 forks source link

Home Assistant Energy Page #80

Closed iannecj closed 2 years ago

iannecj commented 2 years ago

This had been reporting on Energy Page completely however now while bars in individual devices are still reporting, the total grid energy graph is not. When I go to Energy configuration in home assistant I see its complaining:

Last reset missing The following entities have state class 'measurement' but 'last_reset' is missing: sensor.pm_main_total_daily_kwh_farmbell

Is there new configuration in ESPhome YAML file? I don't see this last reset aspect in the docs.

Here is my current YAML for these sensors:

`#kWh Farmbell Daily

kWh Pool

kWh Upstairs AC

kWh Downstairs AC

switch:

Meter has been flawless by the way thanks!

Thanks,

Chris

CircuitSetup commented 2 years ago

It looks like there was a fix to the default behavior of Total Daily Energy.

Try changing _stateclass: measurement to _state_class: totalincreasing

iannecj commented 2 years ago

Yes that did it. Took a day to correct itself as expected. Might I suggest that get added to example YAML? Thanks again!

CircuitSetup commented 2 years ago

Yes, I'll definitely change it in the examples. Thanks for bringing this to light!

CircuitSetup commented 2 years ago

oh, I forgot to ask. Was state_class added automatically (as stated in the forum thread), or is that something you added? I'm trying to figure out if it explicitly needs to be in the config.

iannecj commented 2 years ago

I had for the main total energy sensor in YAML and I had added it at some point. I believe from an online example. device_class: "energy" state_class: "measurement"

That did not work and it complained of no last reset parameter as we said.

Based on your suggestion I changed to: device_class: "energy" state_class: "total_increasing"

And it works but it may have also worked if I had just deleted state_class: "measurement". Didn't try that.

CircuitSetup commented 2 years ago

got it! Thanks for your help!