On restart all automations except 1 are disabled?

This just started happening within the last few updates. When I restart HassIO or reboot, all my automations except one start in the disabled state.

Config checks out ok. I don’t see anything in the logs.

Any ideas?

I see one similar post:

but no responses…

Do you have

initial_state: 'on' 

For all your automations?

Well. Don’t I feel stupid.

initial_state: True

was in only the one that was starting out on. But, something must have changed, as they used to start out on by default before.

I added the above to each automation, and all good now.

Thanks.

The ‘default’ behaviour is that it remembers its previous state over restart. However if there’s a database error during the restart process it can’t, so defaults to off. Setting initial: ensures that it is always on.

Hope this helps.

In that case, maybe I have a db error…

How do I check for db error and/or run repair?

Thanks…

It’s more if when you’ve restarted it didn’t finish writing to the database than a proper error. If there’s nothing in your logs about failure of the database it’s fine.

I sometimes get ‘found unfinished session’ which is directly linked to when I restart and the service ends up being killed by systemctl. Those are the times when it won’t ‘remember’ automation states and a few other things.