Help with automation for ios notification

HI guys, hope someone can help :slight_smile:

I am trying to do my first automation so I can press a button in the ios notification and have my gates open!

Have enclosed appropriate section of my config - anyone got any ideas? My Open Gates button appears but it doesnt do anything :frowning:

#Enable IOS Component
ios:
push:
categories:
- name: Open Gate
identifier: ‘gate’
actions:
- identifier: ‘OPEN_GATE’
title: ‘Open Gates’
activationMode: ‘background’
authenticationRequired: no
destructive: yes
behavior: ‘default’

automation:

  • alias: Open the gates
    trigger:
    platform: event
    event_type: ios.notification_action_fired
    event_data:
    actionName: OPEN_GATE
    action:
    service: switch.turn_on
    entity_id: switch.open_gates

and the switch details from that bit of the config

switch:

  • platform: mqtt
    name: Open Gates
    state_topic: “comfort2/response32”
    command_topic: “comfort2/response32/set”
    availability_topic: “comfort2/alarm/online”
    payload_on: “1”
    payload_off: “0”
    payload_available: “1”
    payload_not_available: “0”

Thanks in advance!

so I foolishly referenced automation: twice in my config file and didn’t find it until I turned logging on!

learning from your own mistakes is slow but one of the best ways to learn. Watch out for missing spaces, colons, quotations when writing in YAML. Just remember to make small changes and test, so that when things stop working, you can narrow down the source of the issue. Good luck!