This is the automation i use currently, the problem with is that if TV is off during the initial trigger, it will not work…
I know that there is a trigger for “TV turned off” which is what I want, but I’m not sure if there is a way for this trigger to disable different automation.
If you want an automation to perform its action only for certain conditions, define those conditions in condition. Don’t turn the automation on/off as a means of controlling when it should/shouldn’t execute its action.
The problem is that is that I’m not sure how to make it react to state change in the condition tab.
I need it in While loop (so the script is running as it’s actively changing colors)
I need some way to make the While loop end when TV is turned off (the actual action of turning it off)
To understand the situation more:
I’m the only one home, TV in living room is off as no one is there, the lights can start at 1hr before Sunset and turn off at 23:00. (this means they should start even if the TV is off in the beggining)
My roommate is home, they are watching TV almost everyday, when they turn it off they go to sleep, so the lights should turn off to not distrupt them (this means when the TV gets shut down, the light should turn off)
If I use “IF TV IS ON” as condition in the while loop, then the 1st scenario doesn’t start.
So I’m not sure what would be the best solution for these, I guess I could make 2 independent automations but it would be messy I think.
You trigger on all conditions that can cause the automation to fire. You can set some Trigger IDs to help you better identify what caused it to trigger.
Your next step is to set the conditions that must be met for all variations of your automation to run.
After that, you setup in the Actions section a choose step that can then have conditions of it’s own in it and if those conditions are met the actions of the choose step happen.
For instance, here’s the automation I have on my front entry lights. This automation does the following:
Triggers on the opening, closing (fires after 5 minutes of being closed) or unlocking of the front door
No special conditions for the rest of the actions to run
On the door closed, it turns off the front entryway lights
If my house is in “night mode” (special helper I use for other automations as well) and the door is opened or unlocked, then it turns on the front entryway lights.
I get “extra keys not allowed @ data[‘from’]” error, I think that this would actually help me get it working but I guess the LGTV integration does not support this?
I actually use the from to state change in different integration (not for tv) and it’s working perfectly there