#How to send telnet commands with custom payload

1 messages · Page 1 of 1 (latest)

fresh sphinx
#

Hi everyone,
I've been struggling with figuring out how to make an automation/ configuration which lets me send a telnet command with a custom payload.

I've figured out I can send them via terminal with:

echo -e "test\r\n" | nc 192.168.0.200 23

however it seems | is not available in configration.yaml it seems.

I'ved used the telnet integration to do some basic stuff like:

switch:
  - platform: telnet
    switches:
      nuvo_zone_1_mute:
        resource: 192.168.0.200
        port: 23
        command_on: >
          *Z1MUTE
        command_off: >
          *Z1MUTE
        timeout: 0.9

However this isn't really great for other things I might want to do
Anyone got any ideas?

marble gazelle
#

You could try executing a bash script containing that command instead.
Alternatives to try would be to put 's around it or do something like bash -c 'commandhere'.

fresh sphinx
#

do bash commands allow the pipes like configuration.yaml doesnt?

marble gazelle
#

I'm not quite sure on the internals of how the command is executed. These are just the things I would try.

fresh sphinx
#

fair, I tried using bash before but it didnt seem to work. Will experiment more