Since the sensor is updated almost every second, I wonder if this is really efficient. What do you think? Should I do it this way, or can I modify it somehow to make it more efficient?
Are you concerned that ‘all’ the code you have written is being processed every second?
If so, I wouldn’t worry. When a modern computer responds to something that happens once per second it’s like you responding each time an eclipse comes around. If the computer could think then it would think - blimey something to do and break my boredom.
So when you view the state value of sensor.mower_daily_runtime in Developer Tools > States it changes almost every second (while the mower is operating)?
Haha yeah, you’re probably right, but I’m always striving for maximum efficiency because I have this paranoia that all the little flaws in my installation will one day add up to an unmanageable mess. But I guess I’ll just try it as it is now!
I haven’t been able to test it yet, but I think so because the sensor.mower_daily_runtime uses the time platform and I think it counts every second, so this new sensor should update accordingly.
What i meant was the time-pattern sensor platform. But seems liked i failed twice on that, because the actual sensor doesn’t even use that but the history_stats platform instead. Sorry for the confusion, but here it is now:
I have no evidence. It was just an assumption on my part, because you can measure in seconds. Upon investigation, it turns out that the sensor updates every minute, not every second. Thanks for helping me to find that out! I guess it’s not a problem then.