petrleocompel / hikaxpro_hacs

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

Automations and Polling Interval Variability #143

Open 5ur3n opened 1 day ago

5ur3n commented 1 day ago

Hi there

After a bit of messing about with my AX Pro, I have discovered a way to get motion detection events even when the alarm is not armed. This has spectacular automation and energy saving potential. I have described it here: https://community.home-assistant.io/t/hikvision-ax-pro-alarm/541882/5?u=5ur3n

However, to do something like turn the lights on when motion is detected, I've had to set the polling interval down to 1-2 seconds, but this causes the alarm to behave erratically, for instance,

My assumption here is that with 45-odd devices on the AX Pro, refreshing frequently might be maxing out the CPU or other resources and worsening latency.

I'm not very familiar with the ISAPI interfaces, but is it possible to create a workaround for this problem? Some ideas that could perhaps work:

My hypothesis here is that load reduction would mitigate the erratic behavior by reducing load on the hub with frequent calls. Of course, I have very little data to support this since there are no errors in the logs that I have seen.

What are your thoughts? Is this worth thinking about given the potential for smart automation?

petrleocompel commented 18 hours ago

This issue is being tracked basically from start. #2

As far as I know there is no API how to monitor the CPU Usage. There is a SSH but I had not time to discover what we can do.

Workaround is basically impossible.

All of that is a reason why default pull interval is 30 seconds. Because it can cause overload.

You can get a lot of "why something does not work as expected" from this picture

image