ONVIF every few days adds duplicate device

RIght now I have 5 dvr’s, I only have one. There are no manual config options to permanently add the DVR. Is there anyway to stop this? I only use this to get 2 sensors, processor usage and last reboot info. I f I could just add those 2 sensors would be great.

I’m up to 35 copies of my one XVR. Auto discovery is off but it just keeps adding copies every few days. Any suggestion how to stop this would be appreciated.

Hi. Did you find a solution?

I have exactly the same problem and also have auto discovery turned off. When it occurs, all of my camera monitoring fails because I use the second stream for monitoring. The new device defaults to use the primary stream and breaks both devices in HA.

It happens when my Home Assistant host is restarted. I delete all devices and started again to fix it, now its just happened again after a restart.

image

When I first noticed the problem, there were 3 devices. This time I checked immediately when it stopped working and there are 2 devices (see below).

Does anyone know how to fix this?

Thanks, Elton.

I did, in a way. I removed it and started using dahua’s integration in HACS

Excellent, I might do the same.

I did some troubleshooting yesterday and think I found the reason for the fault. In the front end, the display name of the ONVIF integration shows the correct MAC address.

In my case the IP cameras are on a different VLAN so the MAC address towards HA is the virtual MAC of my router. Even though the ONVIF integration shows the correct MAC address in the display name, the MAC address in the back end (core.device_registry) changes when the virtual MAC of my router changes. This is the reason for multiple devices in the back end.

I reported this back to github here:

Hopefully the developer will fix it!

Maybe but I am using non ip hdcvi cameras, so I only have a single mac for the recorder.

My recorder also has a single mac address which is displayed correctly in the integration page. The only way I found the problem was by checking the entries in core.device_registry. Here you can check the differences between the duplicate devices found by HA. If there is no difference then the problem probably wouldnt occur.

Have you managed to fix it?

Everytime my Recorder restarts, the HA detects another MAC, different than the one detected by the router… so it duplicates everytime

I never did, I’m surprised this is still happening. I’ve been using the dahua integration in hacs.