Prevent notification when event is triggered from within HA?

I have a garage door that’s controlled by an MQTT cover. I also set up a notification to ping me when the door is open based on the door sensor (not actuation of the door control relay). Is there a way to limit the notification to only occur when the door sensor reads open but it was NOT initiated from within Home Assistant?

How do you trigger the opening of the door?
You could add a condition in the notification based on the “trigger” element (switch off for 5 minutes for example)

My go-to for these things is here.

Add an input_boolean to the mix, that you turn on when you use an automation to open the door, and then off any time the door closes. Then you can use the state of the input_boolean as a condition in the notification.

1 Like

MQTT Cover:

cover:
  - platform: mqtt
    name: "Garage Door"
    friendly_name: Garage Door
    state_topic: "homeassistant/garage/door/status"
    state_open: "OPEN"
    state_closed: "CLOSED"
    command_topic: "homeassistant/garage/door/control"
    payload_open: "OPEN"
    payload_close: "OPEN"
    payload_stop: "OPEN"
    optimistic: false
    retain: false
    value_template: '{{ value }}'

I’m going to try this and see if it works:

  - alias: Notify iOS Garage
    initial_state: true
    hide_entity: true
    trigger:
      - platform: state
        entity_id: cover.garage_door
        from: 'closed'
        to: 'open'
    condition:
      - condition: template
        value_template: '{{ as_timestamp(now()) - as_timestamp(states(switch.sensor.garage_door_control.last_updated)) < 10 }}'
    action:
      - service: notify.ios_dkphone
        data:
          title: "Garage Alert"
          message: "GARAGE IS OPEN"
          data:
            push:
              badge: 0
              category: 'GARAGE1'

@sjee any thoughts on this since you look like you have it working with this?