Netatmo camera: non working sensor

Hello,
I’m struggling with a non-working sensor.
It is about a Netatmo Presence camera (outdoor).

Configuration. yaml :

template:
  sensor:
    - name: Lichtstatus
      unique_id: sensor.opritcamera_light_mode
      state: > 
        {{ state_attr('camera.netatmo_oprit', 'light_state') }}

Result: unavailable
What’s wrong ?

Thx

Please format your yaml properly so we can see spacing.

I formatted the yaml properly. Sorry.

Template expects a list of sensors. You need a dash on sensor:

template:
  - sensor:
      - name: Lichtstatus
        unique_id: sensor.opritcamera_light_mode
        state: > 
          {{ state_attr('camera.netatmo_oprit', 'light_state') }}

ETA reference link