4 sec motion detection delay local API

Im using telldus local API and since ive gone to local my motion sensors triggers 4 sec after trigger. Any ideas of what to do?
Running the HA on a hyperv 2CPU 3gb RAM

One of my sensors can also trigger light even if motion detect was no physicly made. Im thinking if my timer/automation is wrong. When motion i would like the timer to reset…
I looked at the trace and it looks like the automation is turning the sensor ON when timer.finished. Dont see how thats possible in the automation

Here is my automation

alias: Barnrum Light
description: “”
trigger:

  • platform: device
    type: turned_on
    device_id: 3f704aab4da5e8b9b6fdb62117d539d1
    entity_id: e6fd8f7c0f8fc98ae76ceecc5ddb1d8f
    domain: switch
    id: Motion detected
  • platform: event
    id: Timer finished - Light off
    enabled: true
    event_type: timer.finished
    event_data:
    entity_id: timer.light_timer_barnrum
    condition:
  • condition: time
    after: sensor.sun_next_setting
    weekday:
    • sun
    • sat
    • fri
    • thu
    • wed
    • tue
    • mon
      before: sensor.sun_next_rising
      action:
  • choose:
    • conditions:
      • condition: trigger
        id:
        • Motion detected
          enabled: true
          sequence:
      • type: turn_on
        device_id: 6d0473f90716f0270b634a6f2be425a9
        entity_id: b0a2e193d12ac1e81ae30ae4d890df0b
        domain: switch
      • service: timer.start
        data: {}
        target:
        entity_id: timer.light_timer_barnrum
    • conditions:
      • condition: trigger
        id:
        • Timer finished - Light off
          enabled: true
          sequence:
      • service: switch.turn_off
        data: {}
        target:
        entity_id:
        - switch.hallway_on_off
        - switch.hallway_sensor
        mode: single