Automation on Event / State Increment - HELP! :)

Hi

I am trying to build some automation around ZoneMinder. What I would like to do is to create a notification from HA when a state increments.

sensor.front_door_camera_events
{
“friendly_name”: “Front Door Camera Events”,
“unit_of_measurement”: “Events”
}

The Events state will start from 0 and each time motion is triggered the Events state will increase by one, each time this happens I would like to kick off an automation to send a IOS notfiy.

Can anyone help with the logic here, I am new to scripting :frowning:

Thanks

I would create a input slider /sensor to keep track of the count. I use the a light’s brightness to keep track of a timer. Here is the syntax

  action:
      - service: light.turn_on
        data_template:
          entity_id: light.garage_timer 
          brightness: '{{states.light.garage_timer.attributes.brightness|int + 1}}'

Thanks so i could use something similar and every time it increments so a IOS notify automation ?