Using trigger.id as numeric value for the position of the cover

The trigger.id is a number like 49, and i want to use this trigger.id to determine on which position the cover should be set.

How can I do this?

I tried this:

action: cover.set_cover_position
metadata: {}
data:
  position: "{{ states('trigger.id') | int(0) }}"
target:
  entity_id: cover.rollo_computerzimmer_xyz

The cover will close the cover when triggered and not set an certain position…

alias: 35%
platform: numeric_state
entity_id:
  - sun.sun
attribute: azimuth
above: 196.6
id: '35'
enabled: true
below: 275

The trigger variable does not have a state object like entities, so you don’t use the states() function. Just use trigger.id on it’s own:

action: cover.set_cover_position
metadata: {}
data:
  position: "{{ trigger.id | int(0) }}"
target:
  entity_id: cover.rollo_computerzimmer_xyz
1 Like

thanks will test