I have a bunch of switches and I would like to create a list which would activate the selected switch -this is to prevent making buttons for all of them-.
Now I tried the input_select approach but I feel like I am missing an automation.
So make the automation that does what you want. The input select does nothing but create an input select. You have to create an automation that reacts to the input select changing.
I’ll give you some hints, your trigger will be the input_select changing state. Your action will use the trigger object inside a template for the entity_id in the target. Your service will simply be script.turn_on.
Im sorry but I have a few questions. Firstly starting with trigger.
trigger:
- platform: state
entity_id: input_select.personnel_nav
id: 'Personnel selected '
to: sergh
Above is how I set my trigger in the automation. However when selecting the name “sergh” the automation does not trigger. I did try to play with the from and to options in trigger. but nothing seems to work.
Conditions I see I do not need. I guess
and for actions.
I honestly do not know what you mean even after doing more research Below is what I have achieved for now…
- id: '1638970984299'
alias: 'CTO selected '
description: 'Once Sergh is selected in input select then trigger switch.sergh to
activate '
trigger:
- platform: state
entity_id: input_select.personnel_nav
id: 'Personnel selected'
to: sergh
condition: []
action:
- scene: scene.sergh
mode: single
Currently, for action I did make a scene that looks something like this (below). However, I do not like it even though it works. Because I really want to avoid making a scene for every personnel
Trigger object is only accessible in templates. It’s all documented here.
The state of your input_select will always be an item in that list. Which is always a switch. So use the to_state state as the entity you’re turning on.