wallbox icon indicating copy to clipboard operation
wallbox copied to clipboard

Long term stats for HA Energy

Open jpleite opened this issue 3 years ago • 5 comments

Hi @hesselonline. Great work you've done. As you know HA launched Energy panel and integrations need to configure their entities correctly so Home Assistant knows that we need to track statistics for it and how. Metered entities have a value that keeps increasing until reset, like energy consumption or production. To have Home Assistant track this entity a last_reset property needs to be included. https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics

Would you be so kind to include it? Thanks for your great work!

jpleite avatar Aug 10 '21 10:08 jpleite

Hi, I haven't had any time to look into this, but I will certainly make time in the near future. So, I will have a look and let you know what's possible in this regard.

hesselonline avatar Aug 14 '21 15:08 hesselonline

Could be possible to "download" from Wallbox Portal the "Monthly summary Energy"? That will give the necessary data to create an Utility_meter sensor inside HomeAssistant, that parameter gives the kWh consumed charging the car....

mafelipe16 avatar Aug 19 '21 08:08 mafelipe16

Hi. Actually after my last request and further investigation you can in fact have long term stats for wall box. First add this to customize.yaml

sensor.wallbox_portal_added_energy: device_class: energy state_class: measurement last_reset: "1970-01-01T00:00:00+00:00"

Then, under configuration.yaml

utility_meter: wallbox_monthly: name: Wallbox Monthly source: sensor.wallbox_portal_added_energy cycle: monthly

Which this you can monitor individual devices (such as wall box) under Energy portal and also a sensor is created with monthly added energy for Wallbox.

jpleite avatar Aug 19 '21 09:08 jpleite

I heard the last_reset parameter will change again in 2021.9. So be careful adding this in. However, the sensor proposed here would a very nice addition to the Energy dashboard.

Question is how many times we would update the sensor? Is it polled on a regular basis from the web api?

tipofthesowrd avatar Aug 22 '21 07:08 tipofthesowrd

I will add this in a future release of the HA integration. Not sure if I will also add it to the custom component (the integrated HA component is quite different at this point in time so I would need to invest some time in combining these).

I will be using the added_energy sensor for this.

hesselonline avatar Aug 22 '21 13:08 hesselonline