Store the value of the roller shutter in the helper

Hello everyone,

I would like to store the value of the status of the opening of a roller shutter in a helper. Unfortunately, this does not work with the following code. Do you have any idea what this could be? If I replace the value with a number, it will be written.

Thank you very much!


alias: Rollladen WZ rechts auto öffnen
description: wenn die Türe geöffnet wird, wird auch der Rollladen geöffnet
triggers:
  - type: opened
    device_id: ecc977f470d5e23ae8dd7d7b36d27656
    entity_id: 3f06c32e0d5fd4ad28bb01dbfba2f07a
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - device_id: 9d47bb3498bfbe57f25a0e4dbbc3e7c4
    domain: cover
    entity_id: bf7f375a7076bdec9ee6582d200cb120
    type: open
  - if:
      - condition: device
        device_id: 9d47bb3498bfbe57f25a0e4dbbc3e7c4
        domain: cover
        entity_id: bf7f375a7076bdec9ee6582d200cb120
        type: is_position
        below: 100
    then:
      - action: input_number.set_value
        metadata: {}
        data:
          value: >-
            {{ state_attr('cover.bf7f375a7076bdec9ee6582d200cb120',
            'current_position') | int }}
        target:
          entity_id: input_number.helfer_rl_wz_rechts_int
mode: single

What does this resolve to in Developer tools → Templates?

{{ state_attr('cover.bf7f375a7076bdec9ee6582d200cb120','current_position') | int }}

How would it have to be stated correctly? I want to save the status of the opening. Thank you, best regards

I cant tell you unless you do what I asked you to.

I don’t think I understand the question correctly here because of my knowledge of English. I integrated the code into an automation because I assumed that the status of the opening could be accessed.

Test this:

{{ state_attr('cover.bf7f375a7076bdec9ee6582d200cb120','current_position') | int }}

What does it say in the right hand result box?

Hi, thank you very much for the detailed explanation! I’m slowly working my way in :wink: The result is actually “Open” and not a numerical value. What would it have to be correct for me to get the position in percent? Thank you very much!

Go to Developer Tools → States

Look for your entity in the list then look to the right hand column to see what attributes are available and what values they have.