WTH does trigger: use a platform: but condition: uses a condition:?

I’m talking about this:

  trigger:
    platform: state
    entity_id: sensor.cp_packages_coming_today
  condition:
    condition: state
    entity_id: 'sensor.cp_packages_coming_today'
    state: 'Delivery'

Shouldn’t types of conditions also be platforms? It gets pretty weird when they are nested 4 deep:

  condition:
    condition: or
    conditions:
      - condition: and
        conditions:
          - condition: time
            after: '22:30:00'
            before: '5:00:00'
          - condition: template
            value_template: "{{ not is_state('device_tracker.sean_s_iphone_x', 'Traveling') }}"
          - condition: template
            value_template: "{{ now().strftime('%m')|int > 6 or now().strftime('%m')|int < 9 }}"
      - condition: and
        conditions:
          - condition: time
            after: '21:30:00'
            before: '5:00:00'
          - condition: template
            value_template: "{{ not is_state('device_tracker.sean_s_iphone_x', 'Traveling') }}"
          - condition: template
            value_template: "{{ now().strftime('%m')|int > 8 or now().strftime('%m')|int < 7 }}"

I’m guessing it’s because platform: or and platform: and wouldn’t make sense

I’m dum, see below

1 Like

Because conditions can also go in other places, not just the condition block of an automation.

2 Likes

Ugh, duh. This is the right answer lol. I even use conditions elsewhere too…

OP, see here for an example of using conditions in automation actions (starting under the first block of YAML):

3 Likes

how can we make this more visible?

Me being dumb? :joy:

2 Likes