This automation is designed to turn on the light above my smoker, if it is fired up around sunset or is found to be running once time gets close to sunset. The second part is designed to turn off the light 10 minutes after it is switched off.
If I comment out the second set of conditons and the coresponding sequence the automation loads. To me the second set is almost a mirror of the first set. Commenting out the for: does not make it load either.
I really want the second set to follow a transition to the “off” state so as not to affect the light state if manually turned on.
This error results from reloading automations:
Invalid config for [automation]: [to] is an invalid option for [automation]. Check: automation->action->0->choose->1->conditions->0->to. (See ?, line ?).
If I set the second condition to “state: heat”, the automation loads. It will not take “state: off”. Developers Tools/States does show the valid states are off and heat.
The reason is because the word off without quotes is the name of a variable representing a binary value, namely the value known as false. Same goes for the word on which is binary value true. When wrapped in quotes, they are no longer interpreted as being variables but as strings.
On a separate note, why does your automation employ a Time Pattern Trigger? The conditions used in choose would make good triggers and so the automation would trigger only when truly required (as opposed to every three minutes whether necessary or not).
As for the time trigger… The light is being triggered by the state of the smoker and the state of the sun. This is a smoker and sometimes it may be on for 20+ hours and would see transitions for day to night and back to day. The light is led, very little power consumption. So, the time trigger makes sure that the light gets turned on around sunset, I forgot to add a turn off around sunrise. There are times during the deep night that one needs to tend to things on the smoker and in is much easier with a light on.
Is there a better approach to making that happen? My understanding is that the triggers are “and”'ed. So, I do not see a way to use climate.bull as a solo trigger. Are you saying that I could remove the time pattern and the conditions would turn the light on if required by the sun platform?
I figured that the automation would be dormant unless the entity climate.bull changed state and triggered a run through the automation. climate.bull is always in the state “heat” if the power is on.
I am up to learn a better way to make it happen, would help with other automations.