Connect your Pylontech US2000/US3000 battery stack directly to Home Assistant using a USB-to-RS232/RS485 cable.
- Direct Serial Connection: Reads battery data directly from the Console port.
- Home Assistant Native: No MQTT or Docker containers required.
- Energy Dashboard Ready: Includes calculated Energy (kWh) sensors for proper dashboard Integration.
- Per-Battery Monitoring: Voltage, Current, SOC, Temperature, and Status for each module.
- Per-Battery Configuration: Individually tune the capacity of each battery module (Number entity) to accurately compute total stored energy.
- Diagnostics & Raw Data: Track system health (SOH), cycle count, firmware version, and view raw serial responses for debugging.
- Time Synchronization: Automatically or manually sync Home Assistant's time with your BMS internal clock.
- Custom Commands: Send arbitrary raw serial commands directly to the BMS using the built-in Home Assistant service.
Warning
Disclaimer: This integration interacts directly with your hardware. Incorrect configuration or usage could potentially cause damage to your batteries or connected devices. The creators and contributors of this integration take no responsibility for any damage, data loss, or other issues that may arise from using this software. Use at your own risk.
Important
This integration is not affiliated with or endorsed by Pylontech. It is a completely independent project, backed up by the community, and based on official documentation, commands, and reverse engineering.
Note
USB Auto-Discovery: Currently, only the Prolic PL2303 scanner (VID 067B, PID 2303) is supported for auto-discovery. If you have a different adapter, it will not be automatically detected, but you can still manually select the port during configuration.
To add auto-discovery support for your device, please see CONTRIBUTING.md.
Note
Disclaimer: this project has been generated mainly by AI. Even though it has been reviewed and tested by a professional programmer, I feel like it's important to disclose this fact.
- Ensure you have HACS installed.
- Go to HACS > Integrations.
- Click the 3 dots (top right) > Custom repositories.
- Add the URL of this repository.
- Category: Integration.
- Click Add, then find and install Pylontech Serial.
- Restart Home Assistant.
- Locate your configuration directory: Find your Home Assistant
configfolder (whereconfiguration.yamllives). - Create custom_components: If it doesn't exist, create a folder named
custom_componentsinside yourconfigfolder. - Copy files: Copy the
pylontech_serialfolder fromcustom_components/in this repository to your Home Assistant'scustom_components/folder.- Resulting path:
/config/custom_components/pylontech_serial/
- Resulting path:
- Restart Home Assistant: This is crucial for HA to recognize the new component.
- Connect your Pylontech battery to the machine running Home Assistant via USB.
- In Home Assistant, go to Settings > Devices & Services.
- Click + ADD INTEGRATION in the bottom right.
- Search for Pylontech Serial.
- Select your Serial Port from the list.
- Configure the Baud Rate (Default 115200) and Poll Interval (Default 15 seconds) if needed.
- Click Submit.
Instead of a global configuration, this integration provides a Number Entity for each detected battery module. Once the integration is added, navigate to the device page for each module to adjust its capacity (in kWh). This ensures that the integration accurately calculates the total stored energy across batteries of different sizes.
Ensure your battery DIP switches are configured correctly for communication. For US2000/US3000, all DIP switches OFF selects the default baud rate of 115200.
Pylontech US2000 with all DIP switches OFF
To track your battery usage in the Energy Dashboard:
- Go to Settings > Dashboards > Energy.
- Find the Battery Systems section and click Add Battery System.
- For Energy going in to the battery, select:
sensor.pylontech_stack_system_energy_charged - For Energy coming out of the battery, select:
sensor.pylontech_stack_system_energy_discharged - Click Save.
- No data?: Check that the correct serial port is selected and that the cable is plugged into the Console port of the Master battery (not CAN/RS485 unless using a specific adapter).
- Permissions: If running Home Assistant Core in Docker (not OS), ensure the device is passed through (
--device /dev/ttyUSB0).