Adding a button in HA to send Serial Commands via an Elfin EW11A Serial to Wi-Fi converter

Hi all,

I stared a topic for sending and receiving serial commands to my Storkair WHR90 today.

I need some help as well for the integration with Home Assistant.

I’d like to add a button on my Home Screen in HA that can send a Serial Command via my Elfin EW11A to the Serial RS232 Connected Storkair. I’m having trouble finding how and where to add the commands?

I’m assuming I need to add a bit of code to my configurations .yaml file?

I found this:

sensor:
  - platform: serial # arduinouno
    serial_port: /dev/ttyACM0
    name: usb3
    baudrate: 9600

  - platform: template
    sensors:
      usb_sensor3:
        friendly_name: usb sensor3
        value_template: "{{ states('sensor.usb3') }}"

shell_command:
  temp_io1: /bin/bash -c "echo -n '{{ states.input_text.usbtext.state }}' >> /dev/ttyACM0"
  temp_io2: /bin/bash -c "echo -e -n '{{states('input_text.usbtext')}}'>> /dev/ttyACM0"

But this is USB. I need to send stuff over IP to my Elfin on 192.168.178.22 port 8899.
The Elfin does also support Telnet on port 23 but when testing with a serial tool such as Extron DataViewer, I get successes on sending it to port 8899 so Like to take that approach.

Any suggestions to add the Elfin with a few lines of serial commands?

Example HEX commands I’m going to use:

Setting the Fan Speed to Low:

\x07\xF0\x00\x99\x01\x02\x49\x07\x0F

Reading the Firmware:

\x07\xF0\x00\x69\x00\x16\x07\x0F

With the reading command above, I do need a way to present the outcome on my Home Assistant Dashboard. So help regarding adding something to both send the command and output the feedback would me more than welcome!