Below are two simple scripts
- Version A & B to return a value when called
- To receive a value and notify if true
You would expect when running script 2 that the conditional would return true and it would return a notify if either script 1.A or 1.B was used.
However it only seems to work when 1.A is used. 1.B fails to return any object.
Why? It has to be something to do with the stop being nested inside the if statement in 1.B but i can’t seem to work out why that would effect anything. I have checked the Variable docs page and i don’t think it is a scoping issue?
- Core 2024.1.3
- Supervisor 2023.12.1
- Operating System 11.4
- Frontend 20240104.0
1.A
alias: Test Return A Value
variables:
testingvar:
value: true
sequence:
- stop: All Done
response_variable: testingvar
mode: single
1.B
alias: Test Return A Value
variables:
testingvar:
value: true
sequence:
- if:
- condition: device
type: is_off
device_id: someidhere
entity_id: someidhere
domain: switch
then:
- stop: All Done
response_variable: testingvar
else:
- stop: All Done
response_variable: testingvar
mode: single
2
alias: Test - Receive A Value
sequence:
- service: script.test_return_a_value
data: {}
response_variable: recivedvar
- condition: template
value_template: "{{recivedvar.value}}"
- service: notify.mobile_app_a
metadata: {}
data:
message: test
mode: single