Any plans to support HA statistics? #7
Comments
Hi, long term statistics support wasn't on my radar at this time. How long is your normal recorder data retention time (ie. purge_keep_days in the recorder config) ? The card seems to be showing less than a day, that's definitely not normal. What happens when you scroll left or increase the viewed time range to a few days or a week? |
Default it shows the last 10 days. But no worries I just wanted to asked if statistics support is plannedy |
Ah okay, I'll look into it. I'll mark this as a FR. |
I just found this card and I like it a lot. I believe statistics was made as a lightweight method to store long-term data (in lower resolution). So, quite relevant for a History Explorer. Additionally, if you can get statistics data it would be neat to have a delta option for metered values, like an electricity, heat, gas or water meter. There it is not so much the value that is of interest but instead the change, growth or decline. |
Plus one for statestics data. |
Yeah, statistics are on the backlog. I also think that supporting them would be very beneficial. The problem is that supporting them in a good way, seamlessly integrated with normal history and the caching and scrolling etc, is a considerably amount of work. Especially since HA exposes them in a completely different way than normal history, for whatever reason. So this is something that will definitely come to the history explorer card, but I can't guarantee when exactly. |
This seems like something where there should be support in the HA integrations that provide history and statistics. From a user's perspective why are they separate and distinct? Access to the statistics data in HA is so poor right now that there is a lot of room for improvement. So any access to statistics data beyond the current statistics card would be a help. |
Apex-charts card already supports long-term statistics. See https://github.com/RomRider/apexcharts-card/blob/master/src/graphEntry.ts#L257 for the if/else clauses with first statistics fetching then normal history fetching. AFAICT the difference is not much and mostly in I have no time right now but maybe at one point in the next month I'll get to it. |
The data fetching itself is not the issue and is already done. The problem comes from the way how the card does the streaming by issuing async fetches. HA reacts weird when issuing multiple statistics and history fetches at the same time. Requests have a tendency to fail randomly and need to be re-requested, at least on the SQLite backend. Besides that, the local caching structure the card uses also needs to be adjusted with a dynamic slot allocation scheme (rather than the current fixed one) so to efficiently handle entities with and without long range stats shown in the same graph or view. To clarify. I'm not looking into making this a history / statistics toggle where you could select the one over the other in the config. The idea is to fuse both in the same graph, completely transparent to the user, accessing data simultaneously from both sources if available and use the most appropriate source depending on shown time range, how far back you scrolled, etc. |
When you look at the HA source, it is pretty obvious that the entire statistics thing was bolted onto the existing system as a completely separate entity, with no attempt made to integrate it into the existing history subsystem. This concept of two entirely separate history gathering and request subsystems then carried over to the UX. I don't really understand why it was done that way, but I guess they probably had their reasons. |
V1.0.30 adds (experimental) seamless statistics support. See this post on the HA forums for more info: Feedback welcome. |
Long term statistics are now fully supported as of V1.0.32. |
Hey Alex,
first of all: thank you very much for your work!
And then a question: currently your chart takes the last saved data. Is there any plan to support also the statistics?
Best,
Dirk
The text was updated successfully, but these errors were encountered: