Foscam camera switch to another view on reboot

Hello,

I have 5 Foscam C1 cameras in different room views using stream in lovelace.

The cameras by default are called foscam.camera, foscam.camera.2, etc

The problem is that every time I reboot, a camera I’ve assigned to a view moves to another view. So, a camera for Sitting Room ends up in Kitchen and Kitchen in Hall in a random fashion.

Can anybody please advise.

Thanks in advance

What are you rebooting? Just Home Assistant?

My first guess would be that you didn’t assign static ip addresses, so when they reboot, DHCP is giving them a different address…but that is kind of unlikely that they are just swapping ip addresses.

Looking at the documentation (and code), you should probably assign a real name in your configuration.

name

(string)(Optional)

This parameter allows you to override the name of your camera.

The cameras are discovered asynchronously…so whichever one is the first to reply is going to be named foscam.camera and so on down the line.

So this should fix it for you.

Yes, just rebooting home assistant

If your suggestion above relates to configuration.yaml I have renamed both in configuration.yaml and customization of name to no avail.

Any further thoughts.

Are you naming them “Camera.0”, “Camera.1”, etc?

Your original said

The cameras by default are called foscam.camera, foscam.camera.2, etc

Try not using the dot. It is probably confusing some parsing as the dots usually separate domains.

And yes. I’m talking about setting the name in the foscam config part. Right here.

camera:
  - platform: foscam
    ip: IP_ADDRESS
    username: YOUR_USERNAME
    password: YOUR_PASSWORD
    name: kitchen
  - platform: foscam
    ip: IP_ADDRESS
    username: YOUR_USERNAME
    password: YOUR_PASSWORD
    name: sitting_room

This can’t be done in customization or renaming the entity. It has to be right here. If you don’t name them, they get the default name “Foscam Camera”. And HA will just add numbers to them randomly. “Foscam Camera 1”, “Foscam Camera 2”. And they will be in a random order depending on how long it took for them to reply to the rtsp and motion queries. These names will show up as “camera.foscam_camera”, “camera.foscam_camera_1”, “camera.foscam_camera_2”, etc.

By specifying a name like this, it doesn’t matter how long it takes them to reply. There will only ever be a single camera.kitchen, and camera.sitting_room, etc.