Ecolink Door Sensor Setup Help

I have a zwave Ecolink door sensor that i am using to monitor my patio door. Below is my what i have setup in my automations.yaml file to send ios notifications to my iPhone. This is working as i do receive alerts when the door is opened and when its closed. I will be adding additional door sensors soon to this setup. Would someone please look this code over to make sure i have it setup correctly. If there is better way to do this please let me know.

  • id: patio_door_open
    alias: Patio Door Open
    trigger:
    platform: state
    entity_id: binary_sensor.sensor
    to: ‘on’
    action:
    service: notify.ios_fz_iphone
    data:
    message: Patio Door is Open

  • id: patio_door_closed
    alias: Patio Door Closed
    trigger:
    platform: state
    entity_id: binary_sensor.sensor
    from: ‘on’
    action:
    service: notify.ios_fz_iphone
    data:
    message: Patio Door is Closed

Thank you.

You said it’s working. So yes, the content of the automations are correct, but we cannot verify the spacing and formatting is correct (it actually is, otherwise the automations wouldn’t work). Please read and follow the link in the blue banner at the top of the page regarding posting configuration snippets.