emhass icon indicating copy to clipboard operation
emhass copied to clipboard

Improvement: Use HomeAssistant Statistics

Open nateguchi opened this issue 10 months ago • 2 comments

Hi

My energy usage is updated every few seconds and that causes the data fetch from home assistant to take quite a while. Is it possible to use the statistics API to get the totals / averages for an hour or half hour period to speed things up?

nateguchi avatar Apr 17 '24 14:04 nateguchi

Yes this could be great, but I just don't know how to do it. The HA API is only able to retrieve normal data, not HA statistics data. Here are the two APIs documentations that are used in the code:

In neither of those it is possible to retrieve statistics data. If anyone finds a solution I'm wiling to take a look at this possibility.

davidusb-geek avatar Apr 17 '24 14:04 davidusb-geek

Can statistics be retrieved through the websocket api?

gieljnssns avatar Apr 21 '24 07:04 gieljnssns

Can statistics be retrieved through the websocket api?

I don't know, how?

davidusb-geek avatar Apr 30 '24 22:04 davidusb-geek