AND condition

Hi guys,

I was trying to use the and condition in an automation, like:

condition: and
conditions:
  - condition: state
    entity_id: 'device_tracker.paulus'
    state: 'home'
  - condition: state
    entity_id: 'switch.door'
    state: 'off'

Maybe there is somebody using this already.

LE: this is the error: invalid list value @ data[‘condition’][0]

Regards,
Bogdan

1 Like

Ok, I think I got it:

  condition:    <-- I was missing this line
   condition: and
   conditions:
    - condition: state
      entity_id: 'device_tracker.paulus'
      state: 'home'
    - condition: state
        entity_id: 'switch.door'
        state: 'off'
1 Like

Thank you! This helped me

Can you repost that in code tags?

Here you go

condition:    #Was missing this line
     condition: and
     conditions:
      - condition: state
        entity_id: 'device_tracker.paulus'
        state: 'home'
      - condition: state
        entity_id: 'switch.door'
        state: 'off''

Thanks, I figured it was something like that.

Now say “condition” four times in a row and tell me it doesn’t sound funny.