Onvif multiple camera configuration

How I can configure more than 1 onvif camara using integration page?
Thanks!

Just hit add integration, select Onvif again and enter the details of the next camera.

eg: I already have 5 setup but can click through the UI to add more:

Doesn’t Works ;(
When I try to add another appears a message:

Aborted
The ONVIF device is already configured.

What IP addresses are you using? It would say that if you are trying to enter the same IP address as an existing camera.

I’m using differents IPs :frowning:

1 Like

I’m not sure what else to suggest. As I say, I have 5 setup with Onvif no issues. Perhaps try a HA restart in case there is just something odd going on / not registering…? Or perhaps it’s a bug that has been introduced since I set my cameras up.

1 Like

I’m having the same issue with two IMOU Ranger 2C cameras. When I add the second one I got “Device is already configured” message. Has anyone resolved this?

2 Likes

I’m suffering the same problem trying to configure two different ONVIF cameras, with different IPs.

From what I see, in my case, the problem is caused by the 2 cameras: they return exactly the same Hardware Id…

It would be really nice if we could force a unique_id for every camera in the yaml file.

The same problem here. I have two Dahua Ranger SE and I can’t add the second one. New IP, port fowarding, nothing works.

Did you find a solution?

I’m currently using GitHub - AlexxIT/WebRTC: Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC and MSE technology to show the two streams on my cam dashboard. You don’t need to add any entity to HA, you configure the RTSP streams directly into the custom WebRTC card.

1 Like

I have the same problem, track this in this issue: Onvif - devices with same hardware id · Issue #70056 · home-assistant/core · GitHub

1 Like

Any solution? I’m not using PTZ on one of the Ranger SE cameras (configured with RTSP). I can only use PTZ with Onvif.

Hi, I’ve experienced the same issue with a bunch of Imou cameras and found a solution which worked at least for me.

The first camera always integrates succesfully via onvif, the second always complains about “Device is already registered” (also messes up the working configuration).

Looking at the code, “device already configured” is thrown if there is already in HA an entity with the same unique_id. Specifically, looking at core/config_flow.py at 2b40f3f1e5c2b280989d4aeadf5b5ff404fd1cc8 · home-assistant/core · GitHub, the config flow enumerates the network interfaces of the camera and uses the first MAC address as unique_id. If not available, falls back to the serial number.

My cameras have of course different MAC address but still I got the exception. But using Onvif Device Manager and looking at “Information” turned out that the camera exposed two MAC addressed, I guess the first one used when in AP mode and the second one when connecting to Wifi as a client. Unfortuntaly the Onvif integration is picking the first one which was the same in the two cameras.

Workaround (not elegant at all), was to add the first camera, then go and open config/.storage/core.config_entries, find the camera, change the unique_id set to a different mac address, restart HA and add the second camera.
But before doing so, I’d reccomend to check with Onvif Device Manager if there is a clash of MAC address like in my case.

@migio the scenario descrived in your github issue Onvif - devices with same hardware id · Issue #70056 · home-assistant/core · GitHub seems very similar to mine :slight_smile:

Thanks

5 Likes

How can I edit the unique_id?

To edit config/.storage/core.config_entries you need the file editor addon and in its configuration having the .storage pattern removed from the ignored from the ignore patterns. Of course pay attention since editing anything within .storage could break things.

1 Like

thank you very much about your solution. Now i can add all of the cameras but i can see the same picture to all of them from the first camera. can you please tell me what may be goes wrong. sorry for my english.

Weird, try ensuring the ip address of each entry is different also in the core.config_entries file, I don’t see other reason why they should point to the same camera

It works for me … I add 4 cameras changing only one digit of the unique id on each entry.
It should be fixed in next updates, but this workaround works for me.

Thanks a lot for your contribution.