Need Help using RS232 to control a receiver

I am having no luck with anything on that page

I need to be able to read the commands coming in, and to send commands. I created a mysensor to attempt to do it, a serial sensor, and nothing. It’s not recognizing anything.

So you tried the serial sensor component? Is the USB adapter being recognised by HA?

There are a few examples of A/V devices controlled over RS-232 included with Home Assistant. One is for an Acer Projector, which is treated as an on/off switch:

The nice thing about this component is that everything, including RS-232 communications, is defined in a single script. This script might be a good place to start. However, it won’t give you full control over your receiver.

Another example is for a Monoprice Blackbird HDMI Matrix Switch. It is designed as a media player device, which can support more of the features of your receiver.

This device has both a network and an RS-232 interface. There is a separate Python package named pyblackbird which handles all TCP and RS-232 communications with the device. This package can be tested independently of Home Assistant to ensure all of the commands and communication is correct.

The Blackbird code in Home Assistant implements the media player interface for the services it supports and uses pyblackbird for communications. Keeping communications separated is recommended on step four of the Checklist for Creating a Component:

This is probably too much information, but I found it helpful when working on support for other RS-232 devices.

So it’s showing up as a sensor, and the data its showing is the correct code format, how can I write something that will send a command to it? And I have commented out all instances of the sensor in my config file, but it still shows, so I don’t know where its seeing it.

I don’t think a switch is what I’m looking for here, as I need to be able to send only one line of code, but that code needs to be able to handle a template. The formatting of the line I need to send is:


e.g. (VST Z1 11) as shown above

and I am getting the reading receipts from the sensor that I am assuming home assistant automatically detected, but I still don’t know how to send a command as setting the state of the sensor didn’t do anything. Please help

Could I use node-red to do this?

Sorry to resurrect this old thread. I’m trying to do something similar with an old Vantage Axium amp. If anybody is interested in assisting me on a paid basis please send me a private message.

1 Like

I just had a thought to use a NodeMCU or ESP8266 to connect to my Integra Receiver. There is a uART page that may help:

Here is an example configuration:

Example configuration entry

tx_pin: D0
rx_pin: D1
baud_rate: 9600

So my thought is to connect D0, D1 for RX/TX, and then connect Pin5 on the serial port to Neg on the NodeMCU to make a common negative and then if I can monitor the communication, I could turn the receiver on, change inputs, increase/decrease the volume to see if I can “receive” communication. Hopefully I can find a way to send strings from there…

Here is what I ended up doing:

  1. I picked up a serial (RS232) to USB cord and ran it from my RPi 3 to my pre-amp

  2. I added this to my configuration.yaml:

sensor:   - platform: serial
    serial_port: /dev/ttyUSB0
    name: McIntosh Pre-Amp
    baudrate: 9600
  1. In Node-Red I set up a serial port to listen to what was coming out of the receiver, and then set up some function nodes to filter out the commands I wasn’t interested in (like the current surround settings) and used the information I got out of that to set some input_booleans (like which input is currently set). I ended up having to set those values as global values so my other flows could access them, and so they wouldn’t be reset. I can control all the receiver variables from my Lovelace UI.

  2. For voice control, I have IFTTT capturing certain commands to my google home (via Google Assistant “IF you say…”, Then Make a Web
    Request - where the settings are [, POST, application/json, body: {“data”: [{“source”: “TextField”}]} ). I chose to broker the message to MQTT to then send on to HASSIO.

  3. In a second Node-Red flow I have the incoming MQTT messages from beebotte JSONified in a function node so I can filter the source, set the volume, etc. I did have to set up individual channels/IFTTT commands for each type of command (volume number vs. input name). You’ll have to play with it a bit. The JSONified code is:

var jsonobj = msg.payload;
var too = JSON.parse(jsonobj);
//too =[0].source;
msg.payload = too
return msg;
  1. I then have each possible command set into a switch node that will be passed onto a state_changed:input_boolean before finally getting passed on to the serial node to actually set the receiver. The purpose of the input_booleans being set is to keep track of what state the receiver is actually in and to be able to set one of the inputs via the Lovelace UI.

I’m not sure what exact model you have, but this looks like a sheet of commands for your unit: I ended up just calling McIntosh and asking them for the codes and they sent them over happily. Feel free to message me if you have any more problems and I can send you my node red flows. Good luck.

Hi all,
I am looking for some help in my challenge: 8 relay board - RS232-USB controll - integration
Woudl any of you have any idea or hint which directrion to go ?

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:

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
  tx_pin: D0
  rx_pin: D1
  baud_rate: 9600

  - 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
    data: [0x21, 0x31, 0x53, 0x4C, 0x49, 0x32, 0x33, 0x0D, 0x0A]
  - platform: uart
    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
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600
1 Like

Hi Palmer.

Were you able to control the amp?

I make a RS232 to mqtt with Arduino and works perfect, but Im begin in Hassio, I send commands but dont parse strings.

1 Like

did you manage to get it working the your axium amp

If anyone is interested. I have an old Arcam amp hooked up with serial to Node Red to HA. Took ages to get it working so happy to share code if it helps.

I have the code on the raspberry pi I was using to control the unit with, but I can’t find them lol. Once I do I’ll post it here.

Hi Davey,

Yes please !

Just bought an AV8 and would like to integrate into HA

Hi Rich,

No worries. I use a USB to serial for the Arcam. I’ll post the code when I get home.

1 Like

Same setup here. Do share the code please.

Here is the Node Red export that communicates with HA. You should be able to import directly into Node Red (I think)

[{“id”:“537ff01a.d5694”,“type”:“tab”,“label”:“Arcam Serial”,“disabled”:false,“info”:“”},{“id”:“44db0922d68e743c”,“type”:“serial in”,“z”:“537ff01a.d5694”,“name”:“Arcam”,“serial”:“9b6c3c03.9253f”,“x”:110,“y”:640,“wires”:[[“069ade71dffbeb06”,“7dfadfb3b9d2d04b”,“a886b1ec6801ec26”,“0e76b3690275815c”]]},{“id”:“f4409487.fa405”,“type”:“function”,“z”:“537ff01a.d5694”,“name”:“Convert volume to actual level”,“func”:“let data = […msg.payload]\ndata = => parseInt(hex));\ndata[6] = data[6] - 48; // or 0x30 or "0x30"\nmsg.payload = data;\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:610,“y”:480,“wires”:[[“5a12ef2665f015c4”]]},{“id”:“5a12ef2665f015c4”,“type”:“ha-entity”,“z”:“537ff01a.d5694”,“name”:“Send volume to HA”,“server”:“cbd47e7957cb4d83”,“version”:2,“debugenabled”:false,“outputs”:1,“entityType”:“sensor”,“config”:[{“property”:“name”,“value”:“Volume”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“mdi:volume-equal”},{“property”:“unit_of_measurement”,“value”:“dB”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“state”:“payload[6]”,“stateType”:“msg”,“attributes”:,“resend”:true,“outputLocation”:“payload”,“outputLocationType”:“none”,“inputOverride”:“allow”,“outputOnStateChange”:false,“outputPayload”:“”,“outputPayloadType”:“str”,“x”:910,“y”:480,“wires”:[]},{“id”:“069ade71dffbeb06”,“type”:“switch”,“z”:“537ff01a.d5694”,“name”:“Check volume command”,“property”:“payload[3]”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“0x2f”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:290,“y”:480,“wires”:[[“f4409487.fa405”]]},{“id”:“a886b1ec6801ec26”,“type”:“switch”,“z”:“537ff01a.d5694”,“name”:“Check source input”,“property”:“payload[3]”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“0x31”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:310,“y”:680,“wires”:[[“1f89e1860f9973da”]]},{“id”:“7dfadfb3b9d2d04b”,“type”:“switch”,“z”:“537ff01a.d5694”,“name”:“Check display”,“property”:“payload[3]”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“0x2b”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:320,“y”:600,“wires”:[[“e882bdf78af02669”]]},{“id”:“0b7236e323df4bdb”,“type”:“switch”,“z”:“537ff01a.d5694”,“name”:“Check analogue or digital”,“property”:“payload[4]”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“55”,“vt”:“num”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:310,“y”:760,“wires”:[]},{“id”:“e882bdf78af02669”,“type”:“ha-entity”,“z”:“537ff01a.d5694”,“name”:“Send display value to HA”,“server”:“cbd47e7957cb4d83”,“version”:2,“debugenabled”:true,“outputs”:1,“entityType”:“sensor”,“config”:[{“property”:“name”,“value”:“Arcam Display”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“state”:“payload[6]”,“stateType”:“msg”,“attributes”:,“resend”:true,“outputLocation”:“payload”,“outputLocationType”:“none”,“inputOverride”:“allow”,“outputOnStateChange”:false,“outputPayload”:“”,“outputPayloadType”:“str”,“x”:930,“y”:580,“wires”:[]},{“id”:“1f89e1860f9973da”,“type”:“ha-entity”,“z”:“537ff01a.d5694”,“name”:“Send input to HA”,“server”:“cbd47e7957cb4d83”,“version”:2,“debugenabled”:false,“outputs”:1,“entityType”:“sensor”,“config”:[{“property”:“name”,“value”:“Arcam Input”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“state”:“payload[6]”,“stateType”:“msg”,“attributes”:,“resend”:true,“outputLocation”:“payload”,“outputLocationType”:“none”,“inputOverride”:“allow”,“outputOnStateChange”:false,“outputPayload”:“”,“outputPayloadType”:“str”,“x”:910,“y”:680,“wires”:[]},{“id”:“0e76b3690275815c”,“type”:“switch”,“z”:“537ff01a.d5694”,“name”:“Check volume change command”,“property”:“payload[3]”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“0x30”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:320,“y”:540,“wires”:[[“f4409487.fa405”]]},{“id”:“9b6c3c03.9253f”,“type”:“serial-port”,“serialport”:“/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_00000000-if00-port0”,“serialbaud”:“38400”,“databits”:“8”,“parity”:“none”,“stopbits”:“1”,“waitfor”:“”,“dtr”:“none”,“rts”:“none”,“cts”:“none”,“dsr”:“none”,“newline”:“0xd”,“bin”:“bin”,“out”:“char”,“addchar”:“”,“responsetimeout”:“10000”},{“id”:“cbd47e7957cb4d83”,“type”:“server”,“name”:“Home Assistant”,“version”:2,“addon”:true,“rejectUnauthorizedCerts”:true,“ha_boolean”:“y|yes|true|on|home|open”,“connectionDelay”:true,“cacheJson”:true,“heartbeat”:false,“heartbeatInterval”:“30”}]