Automation error showing in logs (I thought it was a simple one but Can't figure out where the issue is)

Hello all,

Can someone help me figure out how the error is getting created on the below automation. I will post first the automation and then second the error showing in my logs.

Is this an instance, when I can’t run it manually to test it? And if so, would someone explain that concept for me because I don’t really understand it.

  - id: dog_mode_activated
    alias: Dog Mode Activated
    mode: single
    trigger:
      - platform: state
        entity_id: binary_sensor.gym_motion_sensor
        to: "on"
      - platform: state
        entity_id: input_boolean.dog_mode
        to: "on"
    action:
      - choose:
          - conditions:
              - condition: template
                value_template: '{{ trigger.to_state.attributes.friendly_name == "Dog Mode" }}'
            sequence:
              - service: script.text_notify
                data:
                  who: "parents"
                  message: "Dog Mode has been enabled manually"
          - conditions:
              - condition: state
                entity_id: input_boolean.sentry_mode
                state: "on"
              - condition: state
                entity_id: group.family
                state: "home"
            sequence:
              - service: input_boolean.turn_on
                entity_id: input_boolean.dog_mode
              - service: script.jarvis_alert
                data_template:
                  # who: kitchen
                  message: "Turning on Dog Mode."
          - conditions:
              - condition: state
                entity_id: input_boolean.sentry_mode
                state: "on"
              - condition: state
                entity_id: group.family
                state: "not_home"
              - condition: state
                entity_id: input_boolean.vacation_mode
                state: "off"
            sequence:
              - service: script.text_alert
                data:
                  who: parents
                  message: "Wrigley may be trying to go out and no one appears to be here to let him out."
      - service: script.dog_mode_lighting_on
        data: {}
      - delay:
          minutes: 20
      - service: input_boolean.turn_off
        entity_id: input_boolean.dog_mode
Logger: homeassistant.helpers.template
Source: helpers/template.py:1862
First occurred: 12:50:28 AM (1 occurrences)
Last logged: 12:50:28 AM

Template variable error: 'dict object' has no attribute 'to_state' when rendering '{{ trigger.to_state.attributes.friendly_name == "Dog Mode" }}'

Yes.

You are using a trigger.to_state as a condition which requires a trigger. Running an automation manually bypasses the triggers and thus, there is no trigger.to_state.

If you want to test it, turn on the input_boolean.

Ahhh, now I understand. Thank you for that explanation @SgtBatten. Essentially I had it showing up in my logs as an error and I was trying to get it to reproduce and it started throwing the error posted here (different than the original) so I may end up coming back here and posting the original error that I was attempting to fix if it shows itself again tonight like I think it may. (Or when I test using your idea from the previous post)

Thank you @SgtBatten for your help, I really appreciate it!