Please help me! I need to send for my pio av-reciever a telnet command (“apo”) and (since it is not always reacting) check the answer (“APR0”) …
1,Telnet switch via config.yaml is not good, it triggers all the time the av reciever, so it hangs up after a while
2, I have problem with Node-red either: I have my scripts/automations in yaml; when I use the Node-red button, somehow the automation stops there…
Is there an easy way to send a telnet command (and wai for the “apr0” answer, if not retry) throug Yaml script?
Sorry, I am quite new, I stroggled sending my post. Now I finished above…
Telnet switch does not work for me; since it triggers the reciever all the time (every second) so the reciever answers every sec and hangs after a while. I can see this in a telnet shell window…
What would be the correct syntax?
This does not work::
config.yaml:
send_nc_command: “echo -e ‘apo’ | nc 192.168.188.33 23”
Developertools/Action:
action: >-
shell_command.send_vd_command
RESPONSE:
stdout: “”
stderr: “/bin/sh: syntax error: unexpected redirection”
returncode: 2
yes, it can listen, but I can not send any data eg “vd” =volume down
If I send on a different pc-telnet session “Vd”, it shows up with the reaction; but if I type in the terminal nothing happens
in Temrinal both works (“\r” was missed):
printf “vd\r” | nc 192.168.188.33 8102
echo “VD\r” | nc 192.168.188.33 8102
BUT there is not seeable any answer
Using the following code, I can see answers, but codes typed [and hit enter] are not accepted
nc 192.168.188.33 8102
One step better again:
in terminal; the code works and the answer is also seeable…
(echo “apo\r”; sleep 1) | nc 192.168.188.33 8102
Now I need a way to use this in HA script. Send “APO”; check the answer; if it is APR0 then switch a switch to “on”; if the answer does not contain “APR0” then try again sending “apo/r”