I’ve started to use history_stats sensors to keep track of how long time I heat my pool, fill water etc. Introduced this a couple of days ago and I’ve been happy with what I’ve seen until this morning.
Right now my sensor.poolheating_daily shows more than 7hours, but the heating has not been on since midnight. As far as I understand, history_stats just sums up history date for the entity used as the base for the measurement.
Unfortunately it seems like my problem is back again. I’m on 2022.6.7 and I have not made any changes in my definition of my history_stat sensors. But all of a sudden my sensor that keeps track of pool water circulation presents 0 this morning, even if the circulation was on for 4hr this night.
History gives the pump turned on 00:00:14 and off at 04:00:15. On/off is triggered by energy price, but as far as I understand history_stat just sums up historic data. So it should not really matter what triggers on/off of the actual sensor historic_stat looks at.
It is just this historic_stat sensor that fails. My others are just fine. Could it be related to the on time happens very close to midnight?
Unfortunately history statistics keeps bothering me. It seems like data for daily usage becomes wrong if the measured entity is “on” over midnight. Exactly the same problem as I reported in my first post in this thread. But now this happens for another sensor measuring how long time the switch controlling the pool water filling is on each day.
Tonight, the switch was open less than 5 minutes aroung midnight:
I expect my history statistics should present 3m14s for July 27th and 22s for July 28th. But it continues to count all day ( today) even if the switch turned of 22s after midnight. Right now it looks like this:
Am I doing something wrong here, or is there a bug in history stats?
I’m on 2022.7.5, but I can’t see any correction made in 2022.7.6 or 2022.7.7 in this area, so I doubt an update will solve this.
Ok, your proposed filter in the github link does not seem to work. Gives a huge amount of issues. However, I found this issue that seems to be very close to what I have observed. However, this issue is closed and I think it should be reopened instead of creating a new one. This is the issue I refer to:
I can’t reopen this issue, so if someone can help out and include a reference to what I write above, it would be nice. Many thanks in advance!