Configure extra sensor for setting camera entity as (in)active

I have a webcam running and showing in home assistant configured like this:

camera:
  - platform: mjpeg
    name: mycam
    still_image_url: "http://mycam.local/snapshot"
    mjpeg_url: "http://mycam.local/stream"

It shows up as always Inactive, since it has no motion detection.

But what if I have a way to see if there are motion (like motioneye) that I can use to set a secondary sensor (maybe via MQTT) to active or inactive.

Can I somehow configure a hybrid camera that takes the image from still_image_url and mjpeg_url but the active/inactive from another sensor (or even just directly from an MQTT topic)?

Please say yes :smiley:

Why do you need to combine it into 1 ‘camera’ device? What’s your end goal here?

I guess I don’t need it to be combined into one, I just think it would make sense since the active/inactive status is also shown in the card in Lovelace.

But I agree that in regards to automation and stuff, it would not matter if it was just a separate sensor.

You can do this with picture glance cards, which is why I asking if it’s really necessary.

I’ll look into that, thanks for the idea :slight_smile:

Yeah, just use a picture glance with a camera entity, then in the entities list, use the binary_sensor. It will show up as a little guy that turns on with movement and off with no movement.

Been busy, but finally had time to fiddle around with HA, and it totally worked :slight_smile:

1 Like