Single automation for door state

How do i setup a single automation which notifies me when the door is opened or closed ?

Currently i have 2 automations for this. I would like to see if i can combine it in one.

I have tried below but not sure how to add text OPEN or CLOSED depending on state of the door sensor

alias: test
description: ""
trigger: []
condition:
  - condition: or
    conditions:
      - type: is_open
        condition: device
        device_id: 9b5779d9522c2f756802edcf1c5a3c53
        entity_id: 2bcacdc62148f351717a4a68bf307466
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 9b5779d9522c2f756802edcf1c5a3c53
        entity_id: 2bcacdc62148f351717a4a68bf307466
        domain: binary_sensor
action:
  - device_id: ec2e3545be793d26432eb9927576a2d0
    domain: mobile_app
    type: notify
    message: "DOOR  IS ???"
    title: DOOR IS ???
mode: single
alias: example
trigger:
  - platform: state
    entity_id: binary_sensor.your_door
    from:
      - 'off' 
      - 'on'
    to:
      - 'on'
      - 'off' 
condition: []
action:
  - variables:
      mode: "{{ iif(trigger.to_state.state == 'on', 'open', 'closed') }}"
  - service: notify.your_phone
    data:
      title: 'Door is {{ mode }}.'
      message: 'Door is {{ mode }}.'
  • Change the binary_sensor’s entity_id to match yours.
  • Change the notification service call to match yours as well. It cannot be the Device Action you used in your posted example because Device Actions don’t support templates.