Hey guys,
ive been trying for ages to get the UART switch working,
I have a TV that I am trying to control via RS232, I have a logic voltage to RS232 converter, and using a USB TTL adapter, I can control the TV from the Arduino IDE by sending commands,
but sending the same commands from ESPHome does nothing,
I think its in how im sending the data, I dont think the CR and NL are sending…
I have tried formatting it in several ways,
heres what im currently working with:
uart:
baud_rate: 38400
tx_pin: D4
switch:
- platform: uart
name: "Power On"
data: '0x80 0x79 0x87 0x82 0x32 0x32 0x32 0x49 0x0D 0x0A'
- platform: uart
name: "Power Off"
data: '0x80 0x79 0x87 0x82 0x32 0x32 0x32 0x48 0x0D 0x0A'
- platform: uart
name: "HDMI 1"
data: 'INSP 10\r\n'
- platform: uart
name: "HDMI 2"
data: 'INSP 13\r\n'
- platform: uart
name: "HDMI 3"
data: 'INSP 18\r\n'
I have tried ASCII, both HEX and Decimal, plain text, as seen in the code above, but nothing seems to work
Please can someone give me any ideas as I have run out?
To clarify, the hardware works, and it SHOULD control the TV, but something about what im sending from the ESP doesnt work…
EDIT:
This PDF explains the simple command structure:
https://support.sharp.net.au/downloads/faqattach/RS232C_control_guide.pdf
I have also tried using commas:
- platform: uart
name: "Power On"
data: '0x50, 0x4f, 0x57, 0x52, 0x20, 0x20, 0x20, 0x31, 0x0a, 0x0d'
- platform: uart
name: "Power Off"
data: '0x50, 0x4f, 0x57, 0x52, 0x20, 0x20, 0x20, 0x30, 0x0a, 0x0d'
Additionally, if I send for example, just 'INPS ’ the monitor will reply with the current selected input, likewise, just 'POWR ’ will tell me if the monitor is ON or OFF, am I able to use this as a sensor of some kind?
Thank you,