Hi Palmer,
It took me a while, but I do have this working on an Integra/Onkyo Receiver using a NodeMCU and esphome. First I noticed that if I hooked up the NodeMCU RX, TX, GND directly to the Integra’s Serial Port, the NodeMCU seemes to power down; almost as if there was a short. I spoke to an engineer where I work, and he thought I might need a TTL to RS232 Converter. I got this one on Amazon:
https://www.amazon.com/gp/product/B00OPU2QJ4/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1.
I hooked it up and the NodeMCU stayed powered up. So far, so good… After that it took me about a week or so working in small bits using a USB-Serial cable and a Null Modem to verify what I was sending and then once I got my carriage return correct, it started working. I found this yesterday, and while I have seen it a few times already, it is probably what led me to the carriage return solution:
UART Switch Help.
Here is some code:
# Example configuration entry
uart:
tx_pin: D0
rx_pin: D1
baud_rate: 9600
switch:
- platform: uart
name: "POWER ON MAIN"
data: [0x21, 0x31, 0x50, 0x57, 0x52, 0x30, 0x31, 0x0D, 0x0A]
- platform: uart
name: "POWER OFF MAIN"
data: [0x21, 0x31, 0x50, 0x57, 0x52, 0x30, 0x30, 0x0D, 0x0A]
- platform: uart
name: "MAIN VOLUME LEVEL 1"
data: [0x21, 0x31, 0x4D, 0x56, 0x4C, 0x31, 0x36, 0x0D, 0x0A]
- platform: uart
name: "MAIN VOLUME LEVEL 2"
data: [0x21, 0x31, 0x4D, 0x56, 0x4C, 0x32, 0x34, 0x0D, 0x0A]
- platform: uart
name: "MAIN VOLUME LEVEL 3"
data: [0x21, 0x31, 0x4D, 0x56, 0x4C, 0x33, 0x32, 0x0D, 0x0A]
- platform: uart
name: "MAIN VOLUME LEVEL 4"
data: [0x21, 0x31, 0x4D, 0x56, 0x4C, 0x34, 0x30, 0x0D, 0x0A]
- platform: uart
name: "MAIN VOLUME LEVEL 5"
data: [0x21, 0x31, 0x4D, 0x56, 0x4C, 0x34, 0x38, 0x0D, 0x0A]
- platform: uart
name: "INTEGRA MAIN SOURCE TO CD"
data: [0x21, 0x31, 0x53, 0x4C, 0x49, 0x32, 0x33, 0x0D, 0x0A]
- platform: uart
name: "INTEGRA MAIN SOURCE TO TUNER"
data: [0x21, 0x31, 0x53, 0x4C, 0x49, 0x32, 0x36, 0x0D, 0x0A]
- platform: uart
name: "POWER ON ZONE2"
data: [0x21, 0x31, 0x5A, 0x50, 0x57, 0x30, 0x31, 0x0D, 0x0A]
- platform: uart
name: "POWER OFF ZONE2"
data: [0x21, 0x31, 0x5A, 0x50, 0x57, 0x30, 0x30, 0x0D, 0x0A]
These switches can be activated to send the commands, or I can ask Alexa to do it for me:
I hope this helps you all as well.
UPDATE: In my troubleshooting, I switched from a Hardware UART to a Software UART. I switched back to Hardware, so the setup looks like the below and still works. I want to keep the digital pins free for hopefully shorting the on/off buttons, using relays, on my speaker selector connected to the Integra Receiver so I can enable/disable speakers in a whole house audio setup. I may look into solenoids to press the buttons, but not sure yet.
# Example configuration entry
uart:
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600