Multiple IP cam configuration

Trying to get multiple IP cams on the go, but only seem to get one functional. What syntax am I screwing up here? I assume that the second camera needs a qualifier, but what format does that take:
camera2:
camera:Two
camera.two:
???

This is my current code:

# Example configuration.yaml entry
camera:
  platform: mjpeg
  mjpeg_url: http://##.##.##.###:####/video
  name: CAM1
  username: USERNAME
  password: PASSWORD

camera:
  platform: mjpeg
  mjpeg_url: http://##.##.##.###:####/video
  name: CAM2
  username: USERNAME
  password: PASSWORD

I don’t have any camera’s, but I think you need to list the first one as you have (camera:) then the second as (camera 2:) and so on…

That was exactly right. One little space between the camera and the number 2 was what I was missing.
For reference here is what worked.
Thanks for your help, dap35.
On to the next sensor.

camera:
platform: mjpeg
mjpeg_url: http://##.##.##.###:####/video
name: CAM1
username: USERNAME
password: PASSWORD

camera 2:
platform: mjpeg
mjpeg_url: http://##.##.##.###:####/video
name: CAM2
username: USERNAME
password: PASSWORD
3 Likes

You could also do with the alternative syntax:

camera:
  - platform: mjpeg
    mjpeg_url: http://##.##.##.###:####/video
    name: CAM1
    username: USERNAME
    password: PASSWORD

  - platform: mjpeg
    mjpeg_url: http://##.##.##.###:####/video
    name: CAM2
    username: USERNAME
    password: PASSWORD

Thank you for the tips. I will probably redo the code for them in that way, if only for the practice. And looking at devices page fabaff pointed me to makes me think I will want to move all my cams to a different tab than the one main page I have going now…it’s getting a bit cluttered.

Thank you both. Once I have it configed, I’ll post the completed section for reference.

Hey @Shazster, did you get your cams tab setup? I’m trying to figure out how to move my cameras to a dedicated tab, and I can’t.

When defining the group, do you use the name? Just “camera” and “camera 2”? I’ve tried both of those and they don’t seem to work. E.g.:

cameras: name: Cameras view: yes entities: - camera

or

cameras: name: Cameras view: yes entities: - Garage

For members of a group, you need the entity_id @rogersmj

something like camera.cam1 per your config

You can check all the entities in your system from the states page in the system tools section (the icon that looks like < > )

Not exactly. I had wanted a separate tab for cameras, and I did manage to get two additional tabs set up in addition to the main view, one for media player and one for sensors. The media player tab I managed to populate with only one media player. For some reason, my smart TV and a second chromecast are not being discovered by netdisco. My sensors tab is completely blank until I figure out how to populate it.
I have been using one of the examples provided by home assistant (see geekofweek’s setup), but it took me a while to get it setup to point where the tabs showed up. (Hint - make lots of use of the online yaml parser to weed out the stupid formatting errors that WILL drive you nuts until you find them)
As for cams, I cut them out. I was using a pair of old tablets as IP cams, but they kept draining the battery faster than the charger could keep up. I may still have the code/formatting I used on my other system (I think it still has my old config). I’ll try to dig it out & post it when I get a chance.

Are bluetooth camera applicable for the application?

Every one else might have realized this but to clarify.

1 Like