Basically, an input boolean is set to true while automation is reloading and then it is set to false again after 10 seconds.
I check this input_boolean value in other automations so that my automations don’t unnecessary trigger on automation reload otherwise mqtt based automations (and some others) would trigger.
Long story short this used to work fine, but recently it isn’t.
After some troubleshooting, I can confirm that when automation is reloaded, the input boolean is set to true, but the 10 second delay and then setting off is never completed.
If I manually trigger this automation, the input boolean is properly set back to off. (ie the automation works as designed)
So it looks like, during a true automation reload event, this one completes half way and then somehow aborts silently.
Is this a design change or a regression.
Either way, can one think of a workaround?
I can’t figure out why it is triggered, since I have an and condition and input_boolean.automation_is_reloaded should be off
Unless the other automation is triggered before the boolean value is set to true, which would be odd.
I confirmed the behavior of your script doing exactly what it is supposed to do.
Personally I have all of my automations except one set to initial_state false, then the one that isn’t triggers on startup and automation reloads, does a few checks, waits for devices to come online etc, and then turns all the other automations on. Then it fires a custom event that any of the other automations that would normally be run ‘on startup’ get triggered by.
Sadly, the suggested approach did not work.
I set the specific automation in question to initial_state false
and enabled it at the end of the above automation_reload script (after the 10 second delay)
Everything works as expected, but the minute the second automation is enabled, it is triggered.
I’m beginning to think that it has something to do it being mqtt trigger based.
@anon43302295 I marked your answer as the solution because it addressed the Original issue.
Although I don’t understand why turning on automation with MQTT trigger always fires, I worked around the issue by checking the timestamp of last phone call and only triggering the automation if it is less than 30 seconds.
It solves my problem, but curious me ultimately wants to know what is up with MQTT triggers.