Hi Guys, I’m new to HA and I need find a way to send (via telnet), two commands to power down my cinema processor (Trinnov).
I’ve tried through a simple terminal, telnet session and these two parameters work perfectly. Question how can I put these two instructions on a script that I can later use inside an automation ?
It might look simple but … for a newbie its rather complex. I’ve red that document several times it asks to put that code inside the configuration.yaml.
When I go to settings – Automations and Scenes, select scripts and create new, what shall I put under identity ID and further down in “action type” ?
Here are the parameters I need to pass to the processor;
IP address: 192.168.100.19
Port: 4410
first string: id home_assistant
second string: power_off_SECURED_FHZMCH48FE
switch:
- platform: telnet
switches:
projector: # change this to: cinema_processor:
resource: THE_IP_ADDRESS # your telnet ip address here
port: 4002 # your port here
command_on: "PWR ON" # the command you send to turn your switch on
command_off: "PWR OFF" # the command you send to turn your switch off
command_state: "PWR?" # The command you send to get the switch state (optional, leave this whole line out if you do not have this command)
value_template: '{{ value == "PWR=01" }}' # if you do have a command to check the switch state this is how you interperet the reply. If you dont, then leave this line out too.
timeout: 0.9 # how long to wait for a reply
Simply change the parts you need to. Make sure to maintain the indentation exactly as it is. It is important in YAML.
I think I beguin to understand … first I create the switch at configuration.yaml and only than I can create the script that later will be used by the automations, right ?
The Trinnov needs those two instructions to shutdown, on this telnet example I can only see room for one, can you show me please how to send two instructions using this switch sintaxe ?
Ok You were right the name should have been altered. Here is the switch current configuration. Maybe I didn’t explain myself right, this is more like a kill switch its not gonna have an “On” position, I wake up the Trinnov using the Wake on Lan protocol. I need this only to power down the Trinnov and for that I need to provide those two instructions. Here is the actual script;
I have to. Otherwise the Trinnov wont accept the powerdown command. I tested all this through a Telnet terminal session and worked only when the handshake string was sent prior to the shutdown command …
Cant I use the handshake string on the on position and on the automation I do an On and next Off to the switch … Do you think it will work ?
One other thing that comes to mind is to create a telnet script with all the instructions inside and some how call the script in automations …
Hi Tom,
I’ve done some progress here. I now have a Button on my Dashboard that triggers the power down of the processor. Works perfectly. Since what I really need is press button ( I only need it to shutdown the unit) I used the same string for On and Off. Regarding sending two instructions at the same string the Telnet command supports that, see code below…
As you can see, the telnet command accepts multiple strings as long as you separate them. Regarding the insertion of the button inside an automation, can you give me a clue ?
Thanks