From my experiences with the action CHOOSE what happens in CHOOSE stays in CHOOSE just like in VEGAS, not what I expected. Example: When a condition in a sequence of a choose action/sequence is false only the choose action/sequence terminates, the remainder of the automation/script continues to run. How can I terminate the automation/script from within a choose action/sequence?
Similarly, variables defined outside of a choose action/sequence can be used in the choose action/sequence, but redefining variables inside the choose action/sequence are not carried forward to the remainder of the automation/script. Maybe this will be resolved as variables are fully implemented in HA in the meantime how do I get variables defined/redefined in a choose action/sequence into the remaining actions/sequences of the automation/script?
The following automation was used to verify the above statements.
Thanks for pointing that out Cameron, I corrected the original post. I copied the wrong version of the automation to the post.
RESULTS:
Change input_boolean.hk_manual_override to ON triggers automation
Switch Expected Result Actual Result
b_xmas_lights_32 off off
f_xmas_lights_31 off on
Change input_boolean.hk_manual_override to OFF triggers automation
Switch Expected Result Actual Result
b_xmas_lights_32 on on
f_xmas_lights_31 off on
Thank you, I missed that it will always run in the documentation and your eyes aren’t playing tricks the last service template isn’t in the chooser.
Based on your statement my error is considering the sequence of the choose as an extension of the actions in the automation and the choose as a path director. Similar to traveling down highway 1 and turning off on a town’s business loop for a meal then continue to travel down the business loop until it merges back onto highway 1. But if I have a fatal accident on the business loop all travel stops there and I never merge back onto highway 1.
I will change my perception of choose to a single action that selects a group of actions from a list. The group of actions functions the same as a discrete script where conditions, variables and other actors only apply to the discrete script within that choose. Likewise, variables defined outside the choose are available within the choose, but variables defined within the choose are not available outside the choose. This is also true for a nested choose. Similar to traveling down highway 1 and turning off on a town’s business loop for a meal then continue to travel down the business loop until it merges back onto highway 1. But if I purchase a souvenir while on the business loop the souvenir will disappear when I merge back onto highway 1. If I have a fatal accident on the business loop, I no longer travel down the remainder of the business loop instead I magically reappear back on highway 1.
Choose is not what I expected when I first saw it in 0.113.