Hi, I have a blueprint that I’ve used to create an automation which cycles colors on my lights. I am trying to have the lights default to that automation when they are powered on.
My current attempt is an automation which triggers “When” the device changes “From” “Any State” to “On”.
This however, does not start the color cycling. Instead, the light is set to the latest solid color it was set to.
How can I fix this? Alternatively, is there a setting for lights to just return lights to their last setting when they have been turned off and then back on?
Did your automation trigger at all. You can look at the traces to see if it triggered, it will leave a trace.
TBH a easy automation is all you need to do this. You should always write an automation as the basis for your blueprint automations anyway. Makes it easier.
An automation for this would trigger when the light goes from any to on, delay like 5 seconds, and start up your random color script or actions.
OK…
The from: null I would eliminate. Lights are never at a null state so it will never trigger. If you say ONLY to: "on" it will trigger when the light is turned on no matter what state it is in, including on. Another possibly useful thing to put there is from: "off". (Automation Trigger - Home Assistant)
Then, automation.turn_on is not doing what you think it is doing there. That command enables the automation to look for triggers and function. It does not make the automation trigger. (Automation services - Home Assistant)
You may want to either add the trigger here to the automation.color_loop thing, or turn automation.color_loop into a script and call that action with a service call. (Scripts - Home Assistant)
Look, I’m just not going to be able to help you. I try to tell you something and you are gone for 2 days, repeat the thing back to me that isn’t working, show not a bit of understanding from what I said.
I’m not going to be able to help you…
Hey, sorry I don’t respond quicker. I don’t have a ton of free time these days.
I figured automation.turn_on triggers/starts an automation. When that function is called, does it not start the automation from its first step?
I enacted your suggestion and removed the
trigger:
...
from: null
line, which is reflected in the second YAML I posted. It’s better than what I had before, in that the automation does consistently start when the light is turned on/off through software, but not when it is physically turned on/off by cutting/returning power to the light
Am I incorrect with what I assume automation.turn_on does?
Are there more edits I need to make to have that happen when I power cycle the light?