Platform: State wont work due to slow update from Verisure

I would like my door to lock automatically every time it is closed between 2100 and 0700.
Made this automation, but it only works when the door switch changes state from “on” to “off”. And with a 40sec delay for updating status from Verisure it normally wont sense that the door has been opened and closed.

Any suggestions for modifications, or to speed up the update time from Verisure?

- alias: Lås dør
    platform: state
    entity_id: binary_sensor.mk_inngangsdr
    to: 'off'
    condition: time
    after: '21:00:00'
    before: '07:00:00'
    service: lock.lock
      code:  !secret verisure_lock_code
      entity_id: lock.hoveddr

I was thinking I could use state: 'off' instead of to: 'off'but that did not work…