Help with Picture Automation

Hello-
I’m trying to show a lovelace picture and information when a particular sensor goes from off to on (via MQTT). The sensor almost immediately goes back to off. This is basically tied to a Blue Iris MQTT message alert when someone approaches our door. I’d like for the automation to fetch a particular URL (which is a still from the door area) and pop it up. During the ‘off’ periods I’d like to grab a different still from a different camera via URL.

So basically when there’s no door motion, I’ll be grabbing a still every 1 minute from the driveway camera, but when the MQTT sensor goes on, I’d like to show a front door picture for x minutes.

  1. Extend your mqtt binary sensor on time to 60 seconds with the delay_off option. This will make things much easier.

  2. Use the custom state switch card to display your driveway camera while the binary sensor is off, then display the door camera while the sensor is on.

The easiest cards to use in the state switch card would be a picture entity card displaying a generic camera. They update every 10 seconds in the dashboard or every 1 second if the more info pop-up is selected.

e.g.

Camera config:

camera:
  - platform: generic
    name: Driwvay
    still_image_url: http://[url to your driveway camera image]
  - platform: generic
    name: Door
    still_image_url: http://[url to your door camera image]

Lovelace card:

- type: custom:state-switch
    entity: binary_sensor.door_movement # your mqtt sensor here
    states:
      off:
        type: picture-entity
        entity: camera.driveway
        show_state: false
      on:
        type: picture-entity
        entity: camera.door
        show_state: false

thank you!

1 Like