I have a Dahua DH-NVR4216-8P-4K NVR with 9 cameras. I had set up 4 of them to get VideoMotion events, but only two were actually receiving the events. After debugging I found that the index in the event notification coming from the NVR was 0 based, but the channel numbering is 1 based. So to fix the issue I needed to modify custom_components/dahua/init.py line 439 to:
if ( index + 1 ) != self._channel:
was :
if index != self._channel:
I haven't created a pull request since I guess this will need testing on other models but happy to do so if the above fix seems acceptable.
I have a Dahua DH-NVR4216-8P-4K NVR with 9 cameras. I had set up 4 of them to get VideoMotion events, but only two were actually receiving the events. After debugging I found that the index in the event notification coming from the NVR was 0 based, but the channel numbering is 1 based. So to fix the issue I needed to modify custom_components/dahua/init.py line 439 to:
was : if index != self._channel:
I haven't created a pull request since I guess this will need testing on other models but happy to do so if the above fix seems acceptable.