Okay, so I came up with this, but it is still not working as planned. Any thoughts, anyone?
I wanted to define the automation in a way that is not limited to a single entity_id. It should extract the ID from that call and then act on that same ID.
Automation should only influence 0% (tilt 0%) and 100% (tilt 100%) positions. This way, it remains wholly closed (slats down) and completely open (slats up) in extreme positions.
- id: Cover Position Automation
alias: Cover Position Automation
trigger:
- platform: event
event_type: call_service
event_data:
domain: cover
service: set_cover_position
condition:
condition: template
value_template: "{{ trigger.event.data.position in ['0', '100'] }}"
action:
- choose:
- conditions: "{{ trigger.event.data.position == ''0'' }}"
sequence:
- service: cover.set_cover_tilt_position
data:
entity_id: "{{ trigger.event.data.entity_id }}"
tilt_position: 0
- conditions: "{{ trigger.event.data.position == ''100'' }}"
sequence:
- service: cover.set_cover_position
data:
entity_id: "{{ trigger.event.data.entity_id }}"
position: 100
Any help would be greatly appreciated.