Combining 'AND' and 'OR' conditions

If I’m reading it correctly (and apologies if I’m not, I’ve just woken up), shouldn’t your condition block be…

condition:
  - condition: state
    entity_id: sun.sun
    state: below_horizon
  - condition: or
    conditions:
      - condition: state
        entity_id: media_player.sony_XXXX
        state: 'on'
      - condition: state
        entity_id: media_player.panasonic_XXXX
        state: 'on'

(which says the sun must be below the horizon, and either of the media players is on)

4 Likes