- Python 98.5%
- Shell 1.5%
| custom_components/cambridge_cxa_network | ||
| .gitignore | ||
| check_ha_integration.py | ||
| check_integration_loaded.sh | ||
| CLAUDE.md | ||
| debug_connection.py | ||
| fix_integration.py | ||
| hacs.json | ||
| protocol_results.txt | ||
| README.md | ||
| test_debug.py | ||
| test_find_volume.py | ||
| test_integration.py | ||
| test_interactive.py | ||
| test_official_protocol.py | ||
| test_sources.py | ||
Home Assistant Custom Component for controlling Cambridge Audio CXA 61/81 amplifiers
This component allows you to control your Cambridge Audio CXA amplifier through Home Assistant. It now supports both direct serial connections and network connections via WiFi-to-serial converters like the USR-W610.
Features
- Power on/off control
- Input source selection
- Mute control
- Speaker output selection (A, AB, B)
- Volume control (only when used with Cambridge CXN - see limitations below)
- NEW: Network connection support via USR-W610 WiFi-to-serial converter
- NEW: GUI-based configuration (no more YAML editing!)
Important: RS232 Protocol Limitations
The official Cambridge Audio RS232 protocol for CXA amplifiers does NOT support:
- Volume control (no commands to set, query, or adjust volume)
- Volume status queries
- Bass/Treble control
- Balance control
These limitations are part of the Cambridge Audio design - the RS232 interface is primarily for basic control and source switching. For full control including volume, you must either:
- Configure a Cambridge CXN streamer IP address in the integration settings (CXN provides network control of CXA volume)
- Use the physical remote control or front panel controls
Installation
HACS Installation (Recommended)
- Add custom repository
jlxq0/cambridge_cxa_networkto HACS - Install the "Cambridge Audio CXA Network" integration
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for "Cambridge CXA Network" and follow the configuration wizard
Manual Installation
- Copy the
cambridge_cxa_networkfolder to yourcustom_componentsdirectory - Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for "Cambridge CXA Network" and follow the configuration wizard
Configuration
This integration now uses the Home Assistant UI for configuration. When you add the integration, you'll be guided through a setup wizard that will:
- Ask whether you're using a network or serial connection
- Configure the connection details
- Test the connection
- Select your amplifier model (CXA61 or CXA81)
- Optionally configure CXN IP for volume control
Network Connection Setup (USR-W610)
To use this integration with a USR-W610 WiFi-to-serial converter:
USR-W610 Configuration
- Connect to your USR-W610's web interface
- Configure the following settings:
- Work Mode: TCP Server
- TCP Server Port: 8899 (default)
- Serial Port Settings:
- Baud Rate: 9600
- Data Bits: 8
- Stop Bits: 1
- Parity: None
- WiFi Settings: Connect to your network
Wiring
Connect your USR-W610 to your Cambridge CXA amplifier:
- USR-W610 TX → CXA RS232 RX (pin 2)
- USR-W610 RX → CXA RS232 TX (pin 3)
- USR-W610 GND → CXA RS232 GND (pin 5)
Use a straight-through RS232 cable (not a null modem cable).
Direct Serial Connection Setup
If you have a direct serial connection between your Home Assistant instance and your Cambridge CXA:
- Connect your USB-to-serial adapter or serial cable
- The integration will automatically detect available serial ports
- Select the correct port from the dropdown during setup
Remote Serial Connection (Legacy Method)
If you need to use ser2net/socat for a remote serial connection, you can still follow the original setup instructions below. However, we recommend using the USR-W610 for a simpler network setup.
ser2net Configuration
For ser2net version 3.x, add to /etc/ser2net.conf:
5000:raw:600:/dev/serial/by-id/<insert id of USB to serial device here>:9600 8DATABITS NONE 1STOPBIT
For ser2net version 4.x, add to /etc/ser2net.yaml:
connection: &cambridge
accepter: tcp,5000
enable: on
options:
kickolduser: true
telnet-brk-on-sync: true
connector: serialdev,
/dev/serial/by-id/<insert id of USB to serial device here>,
9600n81,local
socat Configuration
Create /etc/default/socat.conf:
OPTIONS="pty,link=/dev/ttyCXA,raw,ignoreeof,echo=0 tcp:<IP address of the Raspberry Pi>:5000"
Then set up the systemd service as described in the original documentation.
Usage
Once configured, your Cambridge CXA will appear as a media player entity in Home Assistant. You can:
- Turn it on/off
- Select input sources
- Mute/unmute
- Select speaker outputs (A, AB, or B)
- Control volume (if CXN IP is configured)
Troubleshooting
Connection Issues
- Network: Ensure your USR-W610 is on the same network and the IP/port are correct
- Serial: Check that the serial port permissions are correct and no other process is using it
No Response
- Verify your RS232 cable is straight-through (not null modem)
- Check TX/RX connections are not reversed
- Ensure the amplifier is powered on
Enable Debug Logging
Add to your configuration.yaml:
logger:
default: info
logs:
custom_components.cambridge_cxa: debug
Version History
- v2.0.0: Added network support via USR-W610, GUI configuration, async implementation
- v0.5: Original serial-only implementation
Credits
- Original implementation by @lievencoghe
- Network support and GUI configuration by @jlxq0
Support
For issues and feature requests, please use the GitHub issue tracker.