TCP sensor HEX value in payload

I need to send this string \ 0x13 \ 0x13 \ 0x00 \ 0x00 \ 0x00 \ 0x06 \ 0x01 \ 0x03 \ 0x00 \ 0x00 \ 0x00 \ 0x01 towards to the TCP sensor. Since this output did’t work I decided to send only single byte \ 0x01 for test. However, in the output from the Home Assistant server, I catched a packet in which the Payload field contains five bytes instead of one. (seen in the pictute)
How to fill the Payload field for transparently sending HEX sequence without transformation?

sensor:
  - platform: tcp
    name: TESTING_TCP
    host: 192.168.74.48
    port: 20105
    timeout: 3
    payload: "\0x01"

catched packet:

Hi Andrey,
I am facing the same issue. I have to send an bytearray to the TCP sensor Did you made progress?

Regarding your query: What you can see in the output is your ascii-coded string. So it is sending the string letter by letter and not the byte 0x01. Unfortunately I have no idea how to send a “byte-wise” payload. Hopefully some have?

Ben

Added this feature to tcp sensor

Hopefully we can use it soon :slight_smile:

1 Like