Hikvision component delay

Has anyone had any luck setting the delay in the hikvision component? I’ve tried setting it to 300 seconds(5 minutes) but it still only trips for 10 or so seconds before HA reads it as clear again. This makes it much more complicated then it needs to be to do something as simple as turning on a light when motion is detected.

binary_sensor:

  • platform: hikvision
    host: 192.168.0.151
    name: Front Yard
    username: username
    password: password
    customize:
    front_yard_motion:
    delay: 300
    front_yard_line_crossing:
    delay: 300
    front_yard_field_detection:
    delay: 300

can you try and format your code correctly pls?

If all you want is to turn on a light on motion detected and turn off a light xx sec after motion is no longer detected, you can simply create an automation

- alias: Turn Light With Hikvision Motion
  initial_state: true
  trigger:
    - platform: state
      entity_id: binary_sensor.cctv_motion
      to: 'off'
    - platform: state
      entity_id: binary_sensor.cctv_motion
      to: 'off'
      for:
        minutes: 5
  action:
    - service_template: >
      {% if states("binary_sensor.cctv_motion") == "on"%}
        switch.turn_on
      {% else %}
        switch.turn_off
      {% endif %}
      entity_id: light.light_name

I’m sorry I thought it did format. That said I have it working just fine turning a light on, but I do not like how it works. But that is only the beginning. Ultimately I want this light to turn on at different brightness levels depending on what binary sensor tripped it. Having the binary sensors actually stay on for the correct time would simplify it’s functioning. My next choice would be to create a template binary sensor that is tripped by the real sensors.

binary_sensor:
  - platform: hikvision
    host: 192.168.0.151
    name: Front Yard
    username: username
    password: password
    customize:
      front_yard_motion:
        delay: 300
      front_yard_line_crossing:
        delay: 300
      front_yard_field_detection:
        delay: 300