Cover position as automation trigger

Hi everybody,

I try to set up an automation that triggers upon any cover position below a defined one:

trigger:
  - platform: template
    value_template: "{{ state_attr('cover.wohnzimmer_terasseture_rolladen', 'current_position') | int < 30 }}"

This does not work as

Message malformed: required key not provided @ data['trigger'][2]['platform']

Any help would be appreciated,
thank you!

Braaak

Perhaps try

trigger:
  - platform: template
    value_template: "{{ (state_attr('cover.wohnzimmer_terasseture_rolladen', 'current_position') | int) < 30 }}"

In any event, test the template in dev tools.

Great - worked! :slight_smile: Thank you!

1 Like