I’m using an input select as a station list for radio stations. Since sometimes the player loses connection, I want to start the station that was playing again. However, when an input-select is already set to an option, it doesn’t generate an event when that option is selected again (reselected).
It would be useful if reselecting an option also triggers an event, possibly a different event than a normal select, since you might not always want to act upon a reselect.
What I do is add an ‘off’ selection, and the script / automation that is triggered by the selection change automatically selects off as the last action.
‘off’ itself doesn’t do anything, it’s just a place for the pointer to sit if you will.
Only thing is I do use the state as a display of what is currently playing, but I’ll make a 2nd list that’s just the previous state of the original list.
As far as I know, an Input Select has no native events. In other words, the event you’re detecting when you change an Input Select’s state value is a state-change event which is common to all entities.
Setting an entity’s state to the same value it already has changes nothing so that’s why there’s no state-change event generated.
How do you propose making an Input Select capable of re-selecting an existing state? I don’t believe I have seen a dropdown that’s able to do that but maybe such a thing exists.
I don’t know how the front-end communicates with the back-end so I also don’t know if it’s possible for it to generate an event, indicating a selection was made, that can be posted to the event bus. Without that capability, it won’t matter if the user can set the same state because it doesn’t produce a state-change and so there’s nothing available for either an Event Trigger or a State Trigger.
I don’t know what’s possible or impossible pertaining to most of the workings in HA. What I do know is if you write an FR, ask for the moon because if someone takes on the request they need to know what you really want.
If it’s not possible, this will be ignored, rightfully so.
If it springs a light bulb over someones head, it might happen.
In the meantime, there is a round-about-way, so use that…