Picture entity card: change camera view between auto and live

Hi,

I have a Picture entity card that shows a camera and is normally set to Auto refresh which is fine most of the time. I also have a separate zigbee motion sensor covering the camera area and would like to switch the Picture entity card from auto to live when motion is detected on the zigbee motion sensor.

I have seen solutions where a separate card is opened as a pop-up when motion is detected, but that would be too annoying. I just want to switch between live and auto based on motion.

Please can anyone help with this?

I’m using the state_switch card for this, but should also be possible with the Conditional Card.

      - type: custom:state-switch
        entity: input_boolean.radar_switch
        states:

          'on':
            type: picture-entity
            entity: camera.regenradar_bild
            show_name: false
            show_state: false
            tap_action:
              action: call-service
              service: input_boolean.toggle
              service_data:
                entity_id: input_boolean.radar_switch

          'off':
            type: picture-entity
            entity: camera.regenradar_film
            show_name: false
            show_state: false
            tap_action:
              action: call-service
              service: input_boolean.toggle
              service_data:
                entity_id: input_boolean.radar_switch

The tap_action toggles an input_boolean and changes the picture-entity card.