You can combine multiple conditions using logical operators. Home Assistant supports both standard and shorthand notations.
And Condition
Passes if all embedded conditions are valid.
- Standard: Use
condition: and with a conditions list. - Shorthand: Use the
and key directly.
Or Condition
Passes if any embedded condition is valid.
- Standard: Use
condition: or with a conditions list. - Shorthand: Use the
or key directly.
Not Condition
Passes if all embedded conditions are NOT valid.
- Standard: Use
condition: not with a conditions list. - Shorthand: Use the
not key directly.
# Standard And
condition: and
conditions:
- condition: state
entity_id: light.kitchen
state: "on"
- condition: sun
after: sunset
# Shorthand And
and:
- condition: state
entity_id: light.kitchen
state: "on"
- condition: sun
after: sunset
# Not Shorthand
not:
- condition: state
entity_id: binary_sensor.motion
state: "on"