I’m new to Home Assistant, and I’m having some difficulties with my first project’s configuration.
I’m using an input_select in Home Assistant to control my home cinema’s state.
How can I use the status returned by a Shell script to switch the input_select’s position?
Context:
There’s an input_select for the mode (off / Playstation / Apple TV / …) that calls a Python script I wrote. The script then takes care of turning on / off the devices, and set the right inputs. It can also read the home cinema’s status and returns the current status. I wired it to a Home Assistant sensor, which displays the home cinema’s status - so far, so good.
Now I need to use the value returned by my script to keep the input_select in the actual position the home cinema is.
Let’s say I turn it on with Home Assistant, set it to Playstation Mode, then turn it off using the IR remote. How can I have the input_select go back to the “off” state?
Ok, if you have a sensor that has the current state of your home cinema, and you want to keep your input_select synced with that state, use an automation with a trigger on the state changing, and an action that calls the input_select.select_option service with the triggered state.
Found this thread and thought of an input select automation I’ve been meaning to update. Thought I’d share my example in case anyone else needs it. sensor.ecobee_hvac references a thermostat attribute. service input_select.select_option requires entity_id and option.