petrleocompel / hikaxpro_hacs

HACS repository of Hikvision Ax Pro integration for home assistant
MIT License
40 stars 4 forks source link

Reed switches reporting delayed #51

Closed ppastur closed 1 year ago

ppastur commented 1 year ago

Hi I have Hikvision_axpro_192.168.1.113 installed and all functionality seems to work fine. The issue I have is that the magnetic reed switches take anywhere between 7-25 seconds to report contact broken (on/off). This means that any automation tied to those contact sensors fails because the door is typically opened and closed in less than 5 seconds. I have done some testing alongside a sonoff snzb04 contact sensor and the history graph tells the story well;

image bottom bar is the hikvision sensor/ top bar is sonoff

interestingly, when the Alarm is on, the reed triggers the alarm instantly so I suspect its the connection to HA that might be causing the delay.
Here is my integration configuration - note that for the past few months I've had it installed it was configured with the use internal API lib (AXHub) ticked. After reading some issues on this git, i tried it unticked but even after a restart, no difference. image

Am I doing something wrong? If not, are there any tweaks or settings I can change to reduce the latency? is there any testing I can set up to further troubleshoot?

Thanks in advance.

petrleocompel commented 1 year ago

Hi, the problem is pulling of update.

Extension is local pulling extension. You can change this by changing the "pull internal from system".

petrleocompel commented 1 year ago

I have been looking in to AXPro / AXHub configuration but "events" cannot be sent to currently to integration so we have to pull the sensor updates.

ppastur commented 1 year ago

Ok, great. I'll give it a try. Do you think changing it to 5 seconds will cause too much impact?

petrleocompel commented 1 year ago

I've seen people to use 1 second also. You can try. If your system will have slow responses on "UI" you can always change this.

ppastur commented 1 year ago

do I need to restart for the setting to take effect?

petrleocompel commented 1 year ago

Yes. Some settings need HA to be restarted, to fully reload.

ppastur commented 1 year ago

Just looping back to confirm that making that change has resolved the issue. Thank you for your work and also your rapid response - you are appreciated.