Skip to content

mckay115/homeassistant-middleatlantic-racklink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

225 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Middle Atlantic RackLink Home Assistant Integration

This integration allows Home Assistant to control and monitor Middle Atlantic RackLink PDUs (Power Distribution Units).

Important Note: This integration supports Premium and Premium+ Series PDUs with control protocol capabilities.

Features

  • πŸ”Œ Control outlets (turn on, turn off, cycle power)
  • πŸ“Š Monitor power data (current, voltage, power, energy)
  • 🌑️ Temperature monitoring
  • πŸ“ Customizable outlet names
  • πŸ” Automatic mDNS discovery - finds RackLink devices on your network
  • πŸ”§ Smart port detection - automatically finds the correct control port
  • πŸ”„ Dual protocol support - Telnet (Select/Premium) and Binary (Premium+)
  • 🧠 Smart protocol detection - automatically detects and uses correct protocol
  • 🏠 Home Assistant discovery integration - devices appear automatically

Supported Devices

This integration supports Middle Atlantic RackLink PDU models with control protocol capabilities:

Premium Series (Telnet Protocol - Port 6000)

  • RLNK-P920R βœ… Verified Compatible
  • Other RLNK-P### models with control protocol support

Premium+ Series (Binary Protocol - Port 60000)

  • RLNK-P415
  • RLNK-P420
  • RLNK-P915R
  • RLNK-P915R-SP
  • RLNK-P920R
  • RLNK-P920R-SP

Model number guide:

  • The "P" prefix indicates Premium+ models (advanced features and controls)
  • Numbers "15" and "20" indicate amperage rating (15A or 20A service)
  • "R" suffix indicates rackmount/sequencer models
  • "SP" indicates models with surge protection
  • Models with part numbers ending in "20" (such as RLNK-P420) provide additional power monitoring features

Installation

HACS (Recommended)

  1. Open HACS in your Home Assistant instance
  2. Go to "Integrations"
  3. Click the three dots in the top right corner and select "Custom repositories"
  4. Add this repository URL: https://github.com/mckay115/homeassistant-middleatlantic-racklink
  5. Select "Integration" as the category
  6. Click "ADD"
  7. Search for "Middle Atlantic RackLink" and install it
  8. Restart Home Assistant

Manual Installation

  1. Download the latest release and copy the custom_components/middle_atlantic_racklink directory to your Home Assistant's custom_components directory
  2. Restart Home Assistant

Configuration

Automatic Discovery (Recommended)

The integration can automatically find RackLink devices on your network:

  1. Go to Settings β†’ Devices & Services
  2. Click "Add Integration"
  3. Search for "Middle Atlantic RackLink" and select it
  4. The integration will automatically scan for devices using mDNS discovery
  5. Select your device from the discovered list or choose "Enter manually"
  6. Verify the pre-filled connection details
  7. Click "Submit" to add the device

Manual Configuration

If automatic discovery doesn't find your device:

  1. Go to Settings β†’ Devices & Services
  2. Click "Add Integration"
  3. Search for "Middle Atlantic RackLink" and select it
  4. Choose "Enter manually" if discovery was attempted
  5. Enter your PDU's IP address and port (default: 60000 for RackLink binary protocol)
  6. Enter the username and password for your PDU:
    • Select/Premium: Default username "user", default password "password"
    • Premium+: Any admin user with control protocol access enabled

Important: This integration uses the RackLink binary protocol (port 60000) to communicate with RackLink PDUs. Ensure that:

  • Your PDU is configured to accept TCP connections on port 60000
  • The control protocol is enabled (see instructions below)
  • The PDU is on the same network as your Home Assistant instance
  • Firewall settings allow connections on port 60000

Enabling Control Protocol Access:

  • Select/Premium: Enabled automatically after first web login and password change
  • Premium+: Must be enabled manually via Device Settings β†’ Network Services β†’ Control Protocol (checkbox)
  1. Click "Submit" to add the integration

Troubleshooting

Connection Issues

  1. Cannot Connect:
    • Ensure the PDU is powered on and connected to your network
    • Integration will automatically try ports 6000 (Telnet) and 60000 (Binary)
  2. Authentication Failed:
    • Check that the username and password are correct
    • Default is often admin but password is device-specific
  3. Control Protocol Not Enabled:
    • Access device web interface and enable control protocol
    • Premium series: usually enabled by default
    • Premium+ series: may need manual activation
  4. Device Not Found:
    • Verify your device is Premium or Premium+ series with control protocol support

Common Configuration

  • Default Username: admin (most common default)
  • Default Password: Device-specific (often changed from factory default)
  • Ports:
    • 6000 - Telnet Protocol (Premium Series)
    • 60000 - Binary Protocol (Premium+ Series)
    • Integration automatically detects correct port and protocol
  • Network Requirements: PDU and Home Assistant must be on the same network or have routing configured
  • Control Protocol: Must be enabled on the device (check device settings)

Logging

To enable debug logging, add this to your configuration.yaml:

logger:
  logs:
    custom_components.middle_atlantic_racklink: debug

Services

This integration provides the following services:

  • middle_atlantic_racklink.set_outlet_name: Set a name for an outlet
  • middle_atlantic_racklink.set_pdu_name: Set a name for the PDU
  • middle_atlantic_racklink.cycle_outlet: Cycle power for a specific outlet
  • middle_atlantic_racklink.cycle_all_outlets: Cycle power for all outlets

Entities

Switches

Each outlet on the PDU is represented as a switch entity, allowing you to turn it on or off.

Sensors

Depending on your PDU model, the following sensors may be available:

  • Power (W)
  • Current (A)
  • Voltage (V)
  • Energy (kWh)
  • Power Factor (%)
  • Temperature (Β°C)
  • Frequency (Hz)

Advanced models may also provide per-outlet power and current monitoring.

Technical Details

This integration uses a direct socket connection to communicate with the PDU using asyncio, which provides better performance and compatibility with Home Assistant's asynchronous architecture. The connection is non-blocking and efficiently manages resources.

Troubleshooting

If you encounter issues with the integration:

  1. Check the Home Assistant logs for error messages related to "middle_atlantic_racklink"
  2. Verify that your PDU is accessible from your Home Assistant instance
  3. Test the connection to your PDU using: nc -v <pdu_ip> <port> or telnet <pdu_ip> <port>
  4. If your PDU requires authentication, ensure the credentials are correct
  5. Make sure no other devices or services are trying to connect to the PDU at the same time

Enabling Debug Logging

To help troubleshoot issues, you can enable debug logging for this integration. Add the following to your configuration.yaml file:

logger:
  default: info
  logs:
    custom_components.middle_atlantic_racklink: debug

This will show detailed logs including raw commands sent to the PDU and the responses received. After adding this, restart Home Assistant and check the logs for more detailed information.

The debug logs will show:

  • Raw commands sent to the PDU
  • Raw responses received from the PDU
  • Parsed data and state changes
  • Socket connection details
  • Error messages with full context

After troubleshooting, it's recommended to remove the debug logging or set it back to info level to reduce log file size.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an Issue on GitHub.

License

This integration is licensed under the MIT License. See the LICENSE file for details.

Credits

This integration is based on the work of multiple contributors and was created to improve compatibility with various Middle Atlantic RackLink PDU models.

About

Home Assistant integration for Middle Atlantic RackLink API. Monitor and control RackLink-enabled devices.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages