Need Help using RS232 to control a receiver

I have an early 2000’s McIntosh preamp with RS232 serial on it, and I have some documentation on what codes to send, but I have no idea how to send hex or ASCII codes with hassio over RS232. I was trying to write a python script before I realized I have no idea what I am doing and if that will even work.

Here’s a link to a secondhand documentation: [https://github.com/RobKikta/IntoBlue/blob/master/McIntosh_RS232ControlApplicationNote.pdf]

and here is another link that I am not sure is relevant: [https://www.reddit.com/r/learnpython/comments/5nyii6/pyserial_rs_232_and_ascii/]

EDIT: I have a USB to RS232 plugged into the respective ports on both the receiver and my Pi

Looking at that manual you linked, you just need to send it ascii commands. Perhaps this link may help you.

The dev/ttyUSB0 part is the reference to the USB port that you serial converter is plugged into on the RPi so make sure that is correct.

1 Like

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:

(COMMAND ZONE LEVEL)

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

uart:
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 [myurl.beebotte.com, POST, application/json, body: {“data”: [{“source”: “TextField”}]} ). I chose beebotte.com 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 = msg.payload.data[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: http://download.axiumcontrol.com/AxiumCommsProtocol.pdf. 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:

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
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