First off I want to thank everyone for the help in advance. I have been racking my brain for about an hour trying to figure this one out on my I own.
When I installed the latest version of Home Assistant Core I got an error about it.
I had a sensor in my YAML that converted the time since the last restart to minutes. When I use Node Red I usually have each flow do a quick check to make sure the system has been online for at least 2 minutes before executing a flow.
I would like to be able to figure out how to create a new template sensor that is compatible with Home Assistant Core 10.1 that shoots out the time online in minutes again.
The new uptime sensor seems to just expose a date string.
My goal is to simply see how many minutes since the last restart.
Do you only use this sensor for that application you mentioned?
In that case perhaps use a boolean instead to not save an entity with how many minutes HA has been up?
You could use an automation that triggers on home assistant started event and delay 2 minutes then turn on a boolean.
Then have another to listen for home assistant stopped event and turn it off.
Thanks for the tip. I use it with node red. All of my flows/automations have a condition that checks that home assistant has been up for at least two minutes before they are allowed to proceed.
Yes but if that is all then why have a counter that counts up every minute and floods the database with nonsense values?
If you just turn on a boolean, that is “one row” in the database.