Hi,
I’m trying to write an automation script with nested conditions. Here is what I wrote so far:
- alias: Start music in bedroom
trigger:
platform: state
entity_id: switch.bedroom_2_3
to: 'on'
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: media_player.kodi_bedroom
state: 'idle'
- condition: state
entity_id: media_player.kodi_bedroom
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: media_player.mpd
state: 'paused'
- condition: state
entity_id: media_player.mpd
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.mpd_bedroom
- service: switch.turn_off
entity_id: switch.mpd_livingroom
- service: media_player.turn_on
entity_id: media_player.mpd
However, it doesn’t work: voluptuous.MultipleInvalid: not a valid value for dictionary value @ data['conditions'][0]['condition']
Is it possible to write this kind of nested conditions?