rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
387 stars 73 forks source link

IVS Rule Details #364

Closed ron-osu closed 2 months ago

ron-osu commented 3 months ago

Can you please add support to receive IVS details including the name of the custom IVS rule being triggered and the direction (leave vs enter) and object (human vs vehicle) detected? The CrossRegionDetection sensor in HA is triggered when these IVS events occur, but I cannot see any of the specific IVS details.

image

I have been able to get this information into Home Assistant using a docker container (https://hub.docker.com/r/psyciknz/cameraevents) that publishes Dahua IVS event details via MQTT. I believe this is the source code: https://github.com/psyciknz/CameraEvents. This just provides a dynamic string but it can be parsed/searched to trigger automations. There may be a better way to expose these details in HA but I'm a bit of a newbie to this platform.

image

Relavent configuration.yaml snippet for MQTT / CameraEvents: mqtt: sensor:

It would be really nice to completely replace that docker container with this integration. That seems to be the only gap in functionality between the two, at least for my use cases.

Either way, thank you so much for your efforts on this integration - it's working well for me!

stalniy commented 3 months ago

I configured it the way you want. It’s possible with https://github.com/rroller/dahua?tab=readme-ov-file#events

Don’t use sensors for IVS. They are useless for this task.

ron-osu commented 2 months ago

Thanks @stalniy - I wasn't aware of the events available in HA - this solves my ask completely! This integration has been solid for me so far.