Rewriting Built in HA Automations to Node-Red

I currently have an automation setup in HA that when ever my garage doors are opened or closed I get a notification. Below is what current HA automation looks like and I am wanting to know what is the best way to get the same outcome in Node-Red.

alias: Notify iOS device when garage door 1 opens or closes
trigger:
  - platform: state
    entity_id: cover.garage_door_1
action:
  - service: notify.mobile_app_iphone
    data_template:
      message: >-
        Garage Door 1 just changed from {{ trigger.from_state.state }} to {{
        trigger.to_state.state }}!
mode: single

An event: state node into a call-service node.

data field of the call-service node

{
"message": "Garage Door 1 just changed from " & data.old_state.state & " to " & data.new_state.state & "!"
}
1 Like