I have USB/RS485 converter and want us him for sending a commands to external main unit for heating control. When I send a command like : [“0x10”,“0x01”,“0xFF”,“0xFF”,“0x10”,“0x30”,“0xF8”,“0x02”,“0xE3”,“0x61”,“0xFF”]
then I will receive a answer from which I must take out a data.
First of all I want ask, if it’s possible do it and how. Directly from HA or via node red … ?
What’s a best way ?
Update :
I checked post here in the community and tried to implement first simple request :
- platform: serial
serial_port: /dev/ttyUSB0
- platform: command_line
switches:
8ch_relay01:
command_on: 'echo -e "\x10\x01\xFF\xFF\x10\x30\xF8\x02\xE3\x61\xFF" > /dev/ttyUSB0'
command_off: 'echo -e "\x55\x01\x11\x00\x00\x00\x01\x68" > /dev/ttyUSB0'
8ch_relay02:
command_on: 'echo -e "\x55\x01\x12\x00\x00\x00\x02\x6A" > /dev/ttyUSB0'
command_off: 'echo -e "\x55\x01\x11\x00\x00\x00\x02\x69" > /dev/ttyUSB0'
idea is send a command when switch is used and read a answer
But I received a error when tried a restart system :
what’s wrong ?
THX
OK I found it. Missing switch: on the start But no answer from external unit.
Not sure if it will send this :
[“0x10”,“0x01”,“0xFF”,“0xFF”,“0x10”,“0x30”,“0xF8”,“0x02”,“0xE3”,“0x61”,“0xFF”]
I really don’t know what is wrong. I tested USB/RS485 adapter with original SW and it’s working
Also code [“0x10”,“0x01”,“0xFF”,“0xFF”,“0x10”,“0x30”,“0xF8”,“0x02”,“0xE3”,“0x61”,“0xFF”] I correct one. So now I want ask, how to test (or read) what was sent. Is it possible do any logging ?
And is command :
sensor:
- platform: serial
serial_port: /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
correct for response reading ?