is there a way to retrieve states by copying a variable together with a fixed value
I want to control all my shutters with one script
this should work like this i call the script and give it an argument shutter_back_right
the script should then retrieve different values based on the argument Open Position Temperature etc.
here I have generated helper
with cover.{{shutter }} it works
but how can I address the helpers?
my code:
> alias: Open shutter
> fields:
> shutter:
> description: The content
> example: shutter_back_right
> required: true
> variables:
> openpos: "{{ states('input_number.[{{ shutter }}]_open_pos') }}"
> sequence:
> - if:
> - condition: or
> conditions:
> - condition: and
> conditions:
> - condition: time
> after: input_datetime.roller_shutter_back_right_full_up
> - condition: numeric_state
> entity_id: sensor.sun_azimuth
> above: input_number.shutter_back_right_azimuth_in
> - condition: numeric_state
> entity_id: sensor.sun_elevation
> above: input_number.shutter_back_right_elevation_in
> - condition: time
> after: input_datetime.shutter_shutter_back_right_spat_up
> then:
> - service: cover.set_cover_position
> data:
> position: "{{ openpos }}"
> target:
> entity_id: cover.{{ shutter }}
> - service: telegram_bot.send_message
> data:
> message: >-
> {{ openpos }} {{ states('input_number.''[{{ shutter }}]''_open_pos')
> }} {{ shutter }} cover.[{{ shutter }}] [{{ shutter }}]
> mode: single
> icon: mdi:window-shutter-open
=> how can I replace shutter_back_right with the {{ shutter }} argument?