I’ve set a default value in a boolean field, however it doesn’t seem to be passed when I use “run script” from the menu. Does this not work?
I can’t set the variables when I call this without a layered script because I’m trying to trigger it from wear os.
123
(Taras)
February 19, 2025, 6:06pm
2
Set a variable in your script.
variables:
lock_all_deadbolts: "{{ lock_all_deadbolts | default(true, true) }}"
If whatever calls your script fails to pass the lock_all_deadbolts
variable or fails to supply it with a value, it will be automatically defined and assigned a value of true
.
1 Like
Cake1468:
Does this not work?
It works, but it’s not a default for what you think it’s a default for…
The default
is just for what is shown in the fields UI, it does not actually populate the variable with a value.
1 Like