I have multiple automations like everyone, but some of them are auto disabled. I do have some automations that are disabling other automations when some conditions are met, but this one specific automation is untouched. When I click the enable button, after 1 second it is automatically disabled.
What should I start looking for? Is it something I missed, or did something wrong?
I am currently running the latest update 0.109, but this happened in 0.108 and I think in 0.107 too but I am not sure.
I couldnt find anything relative in my logs. Maybe I missed it? I dont knowâŚ
No, I dont have the initial_state, but that would only help to have the automations enabled after restarting HA⌠Thats not the case⌠The automations CANNOT be enabled⌠I click the enable button and it immediately disables itself.
This doesnt happen to all automations. It happens randomly.
Some hours after this post, I restarted HA and everything is fine. I dont know how long it takes before it starts behaving like this again.
If you donât find anything useful in the UI logs, try looking in home-assistant.log. There should be INFO lines that might help shed light on whatâs happening. If that still doesnât help, try:
logger:
default: info
logs:
homeassistant.core: debug
That will generate a lot more detail in home-assistant.log, but hopefully should make it clear whatâs happening.
But my guess as to what is happening is there is something wrong with the automationâs trigger(s.) If you look in home-assistant.log, near the beginning, youâll probably find an ERROR line that contains: âError setting up triggerâ. This is probably happening before the UI log is set up, which would explain why youâre not seeing the error there.
Can you post the automation that youâre having trouble with (which you should almost always do anyway when youâre asking for help)? Maybe we can spot a simple problem that can be easily corrected.
I have the same issue with one of my automations.
Every now and then it stops working.
The automation runs every second as the trigger (/1) and the action is to increment a number.
Nothing fancy going on but it still stops working after some reboots.
It would be helpful if you, too, could post the automation. Also, any clues in home-assistant.log? If not, as I suggested above, enabling debug can help shed light on whatâs happening.
Thank you for your reply. There is nothing referring to a trigger in the logs. I searched the word âtriggerâ if thats ok (the log is 2MB long).
Here is the automation:
- id: '1587751375531'
alias: '[TTSTEXTS] AUTO TURN ON OPENINGS TTS'
trigger:
- entity_id: automation.ttstexts_openings_tts
for: 01:00:00
platform: state
to: 'off'
condition: []
action:
- data: {}
entity_id: automation.ttstexts_openings_tts
service: automation.turn_on
This is straight from the automations.yaml file which is auto generated. I have created all my automations from the gui. Dont ask me why. 3 years now I am using the yaml to write my automations, but I recently formatted my raspberry and I thought I would give it a try. So here I am. Nevertheless, this was happening even before the formatting.
sidenote: the automation is working fine. My problem is that it is disabling itself sometimes⌠And my guess is that this is happening randomly, or at least that is what I think. I havent noticed a pattern anywayâŚ
this hasnt happened for 2 days now⌠yetâŚ
What editor do you use?
Notepad++ can load all your yaml files and you can search for automation turn off actions (same is true for vsc, or you can just search in your OS for files within a folder (including sub folders) for files containing âtextâ)
Do you use automation turn off?
I donât as the status is then sometimes in question (just use an appropriate boolean in the condition).
The purpose of this automation is simple but let me explain the whole thing to make it clear.
I am having a TTS announcer, as I have speakers all over my house. When a door or window opens or closes, the TTS informs me of that using automatiion (A). When it is late at night and when some conditions are met, I am turning off the automation (A), so it will remain silent.
The automation I posted before is automation (B) and is making sure that automation (A) will turn back on after 1 hour.
Since automation (B) is disabled randomly, automation (A) will stop announcing even after the hour passes by.
Now, after 2 days (and after my previous post that I made 2 hours ago) I noticed that automation (B) is again disabled. I cant turn it back on.
You asked about my editor. I am using notepadd++ and yes, I have already done that, but didnt find anything.
I also searched again for âtriggersâ in my logs since the automation is disabled once again, but no luck. If I restart home assistant or press the EXECUTE button on the automations page, the automation will be enabled againâŚ
Thanks for any help guys.
Weâre all scratching our heads here, you seem to have checked everything.
Wild stab n the dark, rather than a trigger could it instead be a trigger that then runs a script.? So weâre looking in the wrong place ?
If you enable debug for core as I suggested above, then you can search home-assistant.log for state_changed events for that automation. Youâll be able to find when it gets turned off, and if you look at what happened in the log previous to that, hopefully it should tell you what turned it off.
@finity Yes, when I say turn on I mean the state. Not executing/triggering the automation. @Mutt Remember mentioning formatting the raspberry recently? I am manually reconfiguring everything (instead of copy-paste my old config into the new setup) and I havent even touched scripts. I have no scripts in my setup yet. @wolfpins No changes in the yaml file. Even if that was the case, if you check my previous post, I mention that the automation goes âonâ when i restart HA or when i click the âexecuteâ button aka when I manually trigger the automation. Then I have to wait some time (completely random to 10 hours - 2 days) and then it goes off by itselfâŚ
OK, I tried something after my last post.
With automation (B) turned off (aka bugged), I turned off automation (A). That means that after 1 hour it would remain âoffâ⌠Newsflash everybody⌠Automation (A) turned back on, meaning automation (B) worked normally even though it LOOKS to be âoffâ.
When I checked automation (B), it now says âONââŚ
What I am thinking is that the bug is only visual! What I havent noticed is the state from the developer tools⌠Next time it goes âoffâ I will have to check the state and report back to you.
Duh! How havent I thought of that? The gui from the automation dashboard said it is âoffâ but I never checked the âstatesâ tab! I will next time it happens and I will report back the results!
If it still doesnt make any sense, I will enable the debug log as @pnbruckner suggestedâŚ
Hmm, just exactly where are you seeing that? In a card of all automations? If so, I noticed a while ago that that is sometimes wrong. I donât know why, and never looked into it. If you click on it to bring up its âmore infoâ window, that window should show the correct on/off state. And, of course, the STATES tab in Developer Tools will, too.
Thank you for noticing that! You are indeed right, but for some reason, I cant remember now, I have changed the entity_id of that automation. Take a look at this:
Good catch though!
Yes. But only for turning it on.
Nothing controls Automation (B)
Iâm sorry about this, and I understand all the hate, but itâs just impossible to copy text from the app and Iâm in bed now.
But this is a very simple automation as I said.
Just increment a counter.
Just as Argy says it just wonât enable in the GUI window. It does not run in the background I know that for sure.
So itâs not just âvisualâ for me.
It stops working and starts working after reboots. Sometimes many reboots before it âtogglesâ.
Have never looked in the logs, itâs not a big problem for me if this is off, so I have not spent much time on it.