Hi
I would like to create an automation that change an input select based on person's state and current select's value.
For example, if person A is "not_home" and select is "home", then select change to "just left". If select is "just arrived" then select change to "away".
It works great with one person and hard coded entity id. But we're four people in my house and I would like to create one automation to handle this for everyone.
What I did is to set a trigger id that looks like : people.state.person or people.state
Then I split the trigger id to get the part I want for example :
metadata: {}
data_template:
option: "{{trigger.id.split('.')[1]}}"
target:
entity_id: input_select.{{trigger.id.split('.')[0]|lower}}_presence_dropdown```
The problem is that I need to use select in a condition template to check is current value. I don't achieve to check select value based on a variable name.
I tried several thing like :
```condition: template
value_template: >-
{% set test = 'input_select.'+trigger.id.split('.')[0]+'_presence_dropdown'
%}
{{ test == 'Away'}}```
or
```condition: template
value_template: >-
{{ 'input_select.'+trigger.id.split('.')[0]+'_presence_dropdown' == 'Away'}}```
But I don't find a way to do this.
Do you think it's possible ?
Thanks for your help.