Question about secondary information

Newbie question: I have a several covers with secondary information:

type: entities
entities:
  - entity: cover.storen_front
    secondary_info: position
  - entity: cover.storen_sofa1
    secondary_info: position
  - entity: cover.storen_kuche
    secondary_info: position
  - entity: cover.storen_front
    secondary_info: last-changed`

Position is always between 0…100

I struggle to create a helper (or sensor?) that has the states ‘open’ if the secondary_info is between 50…100 and ‘closed’ if it is between 0…50.

cover.storen-front.position doesn’t seem to work - I might be wrong though.

Can anybody give me a hint ?

Thanks a lot

It sounds like you need a template sensor.

template:
  - binary_sensor:
      - name: Storen Front
        device_class: opening
        state: "{{ state_attr('cover.storen_front', 'current_position') | int > 50 }}"
        availability: "{{ state_attr('cover.storen_front', 'current_position') | is_number }}"

EDIT: Fixed attribute based on OP’s response below.

Thanks a lot ! Worked great !!! I had to change ‘postion’ to ‘current_position’ in the ‘state:’ and ‘availability’. Not sure why, but then it worked.

Best regards and thanks again :slight_smile:

Stephan