when the automation below is executed, I get the error “Task was destroyed but it is pending!” in log. The automation is a few releases old, maybe there is a better way to do it? It worked without problems in the past but I guess something has changed with one of the last releases.
If you look in the log there should be INFO messages that show when each step of the action section is executed. It might help to take a look to see if there are any clues as to which step is causing the problem. I don’t see anything obvious. Depending on how you have logger configured you may need to make changes to see those messages. They won’t show up in the GUI by default. You either need to click the button to load the whole log, or look in the home-assistant.log file.
Are you sure these errors occur only due to that particular automation running? And do they always happen about the same amount of time after the automation runs?
Is it at all possible that binary_sensor.vibration changes quickly, such that it might re-trigger the automation while the actions are still running, e.g., on-off-on quickly?
In the 0.113 release that is in beta right now the way automations & scripts work has changed significantly. Without any changes to your configuration, if the automation is re-triggered while the actions are still running the trigger will be ignored (and you’ll see a warning stating so.)
You’ll also have the choice of selecting a different behavior via the new mode config option. E.g., restart will cause the actions to stop and then start over if the automation is re-triggered while the actions are still running. Or you could select queued mode, in which case the actions will finish and then be run again.
That sound pretty good, 0.113 isn’t that far away and I can live with the issues till then.
What about the automation itself? Is the way of color changing still the way to go?
I have added mode: single to the automation but had the error again today. I have also added - delay: 00:00:10. The automation did run without any issues though. What else could cause that?