Slow to trigger motion via wired PIR

Hi, just started with the home assistant project coming over from vera.
Problem, testing a basic motion automation using “Turn on Lights for 10 Minutes After Motion Detected” example, but it is slow to react… when testing just the PIR I get a instant response on the web interface, and when switching the light on manually I get a instant response, but when triggering via the automation it takes 6secs
I have tried triggering via a zwave motion PIR, and a hard wired PIR via the GPIOs on the PI, both react instantly via the web interface and have tried a zwave light switch, and philips hue light both react instantly via the web interface. tried fishing through the logs but nothing stands out.
is there a way to watch live logs via tail or somthing? any other tips would be greatly appreciated.

thansk

Use template switch and tie automation to switch. Test this delay.

Are you triggering zwave devices?
You say manual trigger is OK for switch but what if you manual switch in software(HA)?

thanks for the reply, yeah been testing with both philips hue and zwave, both similar results.
manual trigger of lights via the HA software (web gui) is fast and motion to the gui is fast aswell. just tried to simplify the automation with just a on trigger and that worked very fast.

automation:
alias: Turn on room lights when there is movement
trigger:
platform: state
entity_id: binary_sensor.pir_kitchen
to: ‘on’
action:
service: light.turn_on
entity_id: light.test

will read up on template switch and see what I can come up with.
appreciate your reply and time

I had a similar problem, which improved considerably when I deleted home-assistant_v2.db, which had become very large, and restarted HA.

Deleting the database loses all your history, but it might be worth a try.

@ashsav Did you find a solution for this issue?
I’m having the same problem. I’m using a kaku motion sensor to sent an on and off signal to HA.
In HA i created a automation to turn on the light in the hallway.
But it takes around 4 seconds to turn the light on, while on the the web interface the status already changed.
I tried to bind the automation to swith.motionsensor and to binary_sensory.motionsensor (a binary sensor i created to show the motion sensor as a motion sensor in the web interface in stead of a normal switch), but in both cases it’s waiting for the execution of the automation.

hi, yeah could not get the example to work at an acceptable speed but had more luck with this code Turn on lights on and keep them on when motion detection works almost instantly, also having better luck with hard wired PIR’s to the PI’s GPIO’s. also tried as suggested deleting database, good suggestion but no luck.

@ashsav I don’t really see what’s different than what we’re already doing, but tried it anyways.
Today I even started a complete new installation and even with only 1 motion sensor and 1 light, after the action is triggered in the automation there is a delay of +/- 2 seconds.

Created an issue on github:
https://github.com/home-assistant/home-assistant/issues/5271