I assume the name of the input_select has to match the Automation entries they call, so I have (in part):
- alias: "Roku started from HASS"
trigger:
platform: state
entity_id: input_select.harmony <-------
to: 'Watch Roku'
action:
service: script.turn_on
entity_id: script.roku
- alias: "TV started from HASS"
trigger:
platform: state
entity_id: input_select.harmony <--------
to: 'Watch TV'
action:
service: script.turn_on
entity_id: script.tv
The entries in scripts.yaml work fine - when I call them individually from the raw “Overview” display.
I swear I’ve tried every logical combination of components and names to display the input_select in Lovelace, but all I can get are yellow error boxes:
(I think it’s all aligned in the post; I know it is in the actual file; it passes config check.)
So what’s the deal? How do I properly code and call an input_select? I’ve got ideas for a couple more I’d like to create, but I can’t get past the first one.
Sorry, that’s a typo. My input_select (and all other working definitions) are indeed in configuration.yaml where they belong. I’ll edit my question so future readers aren’t confused.
Have you looked on the states page? Is input_select.harmony listed there? If so, you can test the automation by clicking the box with the arrow in it to the left of input_select.harmony. That will open a box where you can change the selection.
If it’s not listed there that would explain why the frontend can’t find it.
Okay, I’ve got it (mostly) working. It was all about capital letters forbidden in script/automation names.
Just to wrap it all up, please help me make sure I understand how these work…
An input_select has multiple options. When an option is picked, it calls the automation with the matching name (no capital letters). The automation does what it needs to do and then calls a script to do the actual “work”.
So the flow of control is:
input_select changes —> automation is run —> automation calls script
What happens when you pick an input_select option is, that causes a state change event. The automation trigger “listens” for (or watches for) that state change event. When that happens the automation action runs, which in your case “called” (or started) a script, which then ran.
So, yes, it goes from input_select to automation to script, but it’s the automation’s trigger that watches for the input_select to change, not the input_select “calling” the automation.
@bundito ,on top of this, the input_select doesn’t HAVE to be related to an automation trigger either. In some use cases you may use the value of an input_select to act as part of a condition in an automation that is triggered by something completely different. That’s not the case in your example but when talking about input_selects and how they work, its an option you can use elsewhere.
Cool, thanks to both of you. I’m slowly getting a better feel for how some of the internals of this thing work. It’s definitely not simple, but it’s got plenty of power and customize-ability.