What's the difference between these yaml anchors

yes, thanks!
so this means that depending on the indentation you can simply anchor anything. great. cut yet again a few lines, and make the editing so much less error prone. Thanks Marc.

    <<: &notify_alarm
    condition:
      condition: state
      entity_id: input_boolean.notify_alarm
      state: 'on'
    action:
      service: notify.notify
      data:
        title: >
          {% set mode = trigger.to_state.state|replace('_',' ')|capitalize %}
          ALARM: {{mode}}
        message: >
          {% set mode = trigger.to_state.state|replace('_',' ')|capitalize %}
          {{as_timestamp(now())|timestamp_custom('%X')}}: The alarm is in '{{mode}}' mode

could we use the new variables here? for the mode?

like:

<<: &notify_alarm
condition:
  condition: state
  entity_id: input_boolean.notify_alarm
  state: 'on'
action:
  variables:
    mode: >
      trigger.to_state.state|replace('_',' ')|capitalize
     
  service: notify.notify
  data:
    title: >
      ALARM: {{variables.mode}}
    message: >
      {{as_timestamp(now())|timestamp_custom('%X')}}: The alarm is in '{{variables.mode}}' mode
1 Like