I put an electric trolling motor on my pontoon, and I’m trying to track my charging cost per hour. I’ve been triggering an input_boolean to turn on whenever the power meter hooked up to the charger goes to 0 watts AND my phone is located on the lake. This allows me to track the time that my pontoon is being used on the lake. I then use history_stats to track the “on” time of the input boolean.
#Pontoon usage stats
- platform: history_stats
name: Pontoon - Time Used Since 08062019
entity_id: input_boolean.pontoon_in_use
state: 'on'
# start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
start: '{{ 0 }}'
end: '{{ now() }}'
Everything has been going great until I noticed that the time went negative overnight. Does anyone know why this would happen? It was just after midnight (around 12:26am).
Does your history stats time used sensor reset after a home assistant restart?
There was a recent (automatic, no you can’t stop it) hassio supervisor update pushed out. I wonder if that affected the hassio container like a restart?
Scratch that. It did not reset to 0. I’ve got nothing.
The time doesn’t appear to restart. I run Hassio on an Ubuntu VM, and I have restarted the VM several times without loosing any information. I was sleeping at 12:26 am, so it would have to have been an automatic restart.
What’s interesting is that the new value the tracker went to is in between the time values that were previously established (ie, this doesn’t appear to have reverted to a previous value).
Yeah I was totally off track, your Y-axis threw me for a bit (I assumed the bottom was 0).
The only thing I can think of (grasping at straws) is a massive NTP (Network Time Protocol) adjustment. Pretty sure NTP does not allow automatic adjustments of a day though, and it would be unlikely that you would ever need that size adjustment. As I said, I got nothing sorry.
EDIT: Can you test if the sensor updating, now, after the glitch?