Hi,
I am a HomeAssistant beginner and I am trying to learn the automations. I want to create an automation that checks the frost protection status of my weather station. If the frost status is pending, all shutters should be checked if they are closed more than 65%. If so, they should be raised to 65%.
I wanted to solve this with a template and search all shutters via the device_class and current_position attribute. But I don’t understand how I can set the desired position for all found shutters (see ‘then:’ => target entity_id).
Or should I solve this completely different ? Thanks for any help
Shutter-Example:
- name: "UG-Whz | Besch.-Roll.-SW-1DK-Door"
device_class: "shutter"
move_short_address: "3/0/14"
move_long_address: "3/0/15"
position_address: "3/0/16"
position_state_address: "3/0/17"
#travelling_time_down: 51
#travelling_time_up: 61
invert_position: true
Automation:
alias: New Auto.
description: ""
trigger:
- platform: time_pattern
minutes: "10"
condition:
- condition: state
entity_id: binary_sensor.aussen_wetterstation_frostalarm
state: "on"
action:
- if:
- condition: template
value_template: >-
"{{ states.cover | selectattr('attributes.device_class', 'eq',
'shutter') | selectattr('current_position', '>=', '65') }}"
then:
- service: cover.set_cover_position
data:
position: 65
target:
entity_id: ???
mode: single