Notification to iPhone on motion

Hi, trying to send notifications to my mobile when motion is detected but it works only if I run the action manually…

This is what I have in my configuration yaml.

automation motion_basement:
  - alias: 'Basement Motion'
    trigger:
      platform: state
      entity_id: binary_sensor.ir_basement
      to: 'On'
    action:
      - service: notify.mobile_app_iphone
        data:
          title: "Basement Motion"
          message: "Motion Detected"

Try just „on“ as the to state. All in lowercase

thanks that worked!!