Tsar
(Christian)
December 21, 2021, 6:37pm
1
I have this automatisation
alias: Tussentijdse inschakeling bij thuiskomst
description: ‘’
trigger:
platform: state
entity_id: input_boolean.toggle_christian_is_thuis
from: ‘off’
to: ‘on’
condition:
condition: state
entity_id: input_boolean.toggle_airco_living
state: ‘on’
action:
service: script.switch_airco_living_20_graden
mode: single
For the same trigger I have to do this
condition:
condition: state
entity_id: input_boolean.toggle_airco_gang
state: ‘on’
action:
service: script.switch_airco_gang
Can this been done in one automatisation ?
One option is to use two choose actions:
alias: Tussentijdse inschakeling bij thuiskomst
description: ''
trigger:
- platform: state
entity_id: input_boolean.toggle_christian_is_thuis
from: 'off'
to: 'on'
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.toggle_airco_living
state: 'on'
sequence:
- service: script.switch_airco_living_20_graden
default: []
- choose:
- conditions:
- condition: state
entity_id: input_boolean.toggle_airco_gang
state: 'on'
sequence:
- service: script.switch_airco_gang
default: []
mode: single
Tsar
(Christian)
December 21, 2021, 9:13pm
3
Nice, but I get an error
Message malformed: expected dictionary @ data[‘action’][0][‘choose’][0][‘sequence’][0]
alias: Tussentijdse inschakeling bij thuiskomst
description: ‘’
trigger:
platform: state
entity_id: input_boolean.toggle_christian_is_thuis
from: ‘off’
to: ‘on’
condition: []
action:
choose:
conditions:
condition: state
entity_id: input_boolean.toggle_airco_living
state: ‘on’
sequence:
script.switch_airco_living_20_graden
default: []
choose:
conditions:
condition: state
entity_id: input_boolean.toggle_airco_gang
state: ‘on’
sequence:
service: script.switch_airco_gang
default: []
mode: single
Tsar
(Christian)
December 21, 2021, 9:36pm
4
Found it…service was gone.
Thanks, will test this tomorrow !
Tsar
(Christian)
December 22, 2021, 4:53pm
5
Just for testing I changed it to switch on some lights.
Unfortunately it doesn’t work…nothing happens (no lights).
Normally, both lights (switch.sfeerverlichting_links and switch.sfeerverlichting_rechts) should been on because input_boolean.toggle_airco_living and input_boolean.toggle_airco_gang are on.
alias: Tussentijdse inschakeling bij thuiskomst
description: ‘’
trigger:
- platform: state
entity_id: input_boolean.toggle_christian_is_thuis
to: ‘on’
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.toggle_airco_living
state: ‘on’
sequence:
- type: turn_on
device_id: daec5c6545b70ab1e2a1aa4954463ce6
entity_id: switch.sfeerverlichting_links
domain: switch
default: []
- choose:
- conditions:
- condition: state
entity_id: input_boolean.toggle_airco_gang
state: ‘on’
sequence:
- type: turn_on
device_id: dd77e7fcd8e29c8129905d5b77f148d9
entity_id: switch.sfeerverlichting_rechts
domain: switch
default: []
mode: single
Double check your quotation marks… it looks like some of them have gotten switched to fancy quotes at some point in the copying and pasting.
Tsar
(Christian)
December 22, 2021, 8:01pm
7
You have very good eyes, better than me…
Thank you very much !