Hey. I’m a bit of a newbie to Home Assistant configuration.
I’m trying to set up a command line switch to control my receiver. My python scripts all work flawlessly when I run them from the command line. The only thing left is to get the “command_state” portion working…the documentation is making no sense to me. There is a script that queries the power state of the receiver, and it writes a result string to the console. Can I interpret this value in the value_template section (something other than 1 or 0…the values are different if I’m querying for the power state as opposed to the state of the mute button)? What’s the syntax for that?
Hrm…that doesn’t really help in my case. Here’s what I ultimately want to achieve:
Currently, I have a command line switch for which I have to write out shell commands in full. I also have these same shell commands in my shell_command section of config.yaml. Is it possible to have my switch use a shell_command entity instead of having to duplicate the command line?
I’ve since discovered that the query to determine state is not reliable, so I’m just going to leave it as a dumb switch, that runs the command for whatever I press.