  - platform: template
    sensors:
      motion_livingroom:
        friendly_name: Motion Livingroom
        device_class: motion
        entity_id: camera.livingroom
        value_template: "{{ is_state('camera.livingroom', 'motion') }}"
        delay_off:
          seconds: 30