-
Notifications
You must be signed in to change notification settings - Fork 66
Pylontech battery
OpenDTU-OnBattery supports batteries communicating via CANbus using the "Pylontech Protocol"
If your battery has CANbus, you can try connecting it using its default configuration; If unsuccesful, switch to "Pylontech Protocol" and try again. (We have tested a GOBEL GP-SR1-RV150 Battery (280Ah 15kWh, 2022 model), its CANBus even in "DEYE Configuration" communicates with OpenDTU-OnBattery)
Pylontech Batteries have only one CANbus port. If you have more than one systems that need to be connected with CANbus, you may need to use an RJ45 Splitter. One user has tested one such (at 15EUR, VERY EXPENSIVE!) Splitter: this model works well and connects a Pylontech with OpenDTUonBattery and Victron Cerbo-S GX (Brand Name and shop has been removed in order to avoid advertising of overpriced items)
Pylontech Battery BMS can communicate through a RS232 serial communication connection at the "Console" port. Please note that this connection needs regular old-school RS232 levels - +/- 3-12V. If you use a USB to serial adapter, those with TTL (5V) or 3,3V levels DO NOT WORK.
You need a special crafted cable with RJ45 connector at the BMS side. You find USB-to-serial cables to buy for Cisco routers and other network equipment with a RJ45 connector, you can use these cables but must change the pinout! This is shown in this (lenghty) video.
https://www.panda-solar.de/Pylontech-US5000-Energiespeicher.html
look at "Produktdatenblatt / Downloads" beside the description ("Beschreibung")
Deep link: https://www.panda-solar.de/images/BatteryView_us2000b_series_3-0-2-28_2.zip
Information about firmware problems: https://community.victronenergy.com/questions/182659/pylontech-us3000c-us5000-internal-failure-problem.html
Important! Use at your own risk! Read before flash anything!
Update-Program and Firmware: https://www.effekta.com/download/firmwareupdate-for-us2000c-3000c/
Here is a good video example of somebody using the console port to do the firmware update Pylontech US2000C auslesen und Firmware Update via RS232
OpenDTUonBattery can connect with the Pylontech batteries using CANbus. You need a simple module that can receive data (no transmition required). Following modules have been found to be working well:
CAN Bus Shield with TJA1050
SN65HVD230 CAN-Board
Connections to the RJ45 Port Pin:
- CAN L goes to PIN5
- CAN H goes to PIN4
- CAN Ground goes to PIN6 (not needed)
Warning! On some SN65HVD230 boards without termination jumper (pictured below), the terminating resistor between CANH and CANL (R2) must be removed in order to allow communication with the Pylontech battery (see https://github.com/helgeerbe/OpenDTU-OnBattery/discussions/245)
kloppy1984 Bei meinen Test hat es gestern nur ohne den R2 Widerstand funktioniert.
The need for terminating resistor between CANH and CANL (R2) depends on the kind of cable you are using (shielded vs unshielded twisted-pair) Here is some technical information: Diagnosing CANBUS Communication Problems
There must be exactly two (2) termination resistors of 120 ohms each at the physical ends of the CANBUS. Both termination resistors must be on the physical ends of the CANBUS (ends of the main trunk). If they are not at the physical ends of the network, then the effectiveness of the termination filtering resistors will be negated. Always use termination resistors. Even if the network appears to operate without termination resistors in quiet environments, it may not operate correctly when noise is introduced!
All CANBUS wire must be twisted pair cable, even short lengths (longer than 1 inch / 2 cm). The twisted pair wire is an essential part of how the differential mode filtering works on CANBUS, and without it, the signal can be easily distorted.
If the CANBUS wire being used is a shielded (twisted pair) cable, the shield should be grounded on one end only. If both ends of the CANBUS wire shield are grounded then ground loops may be formed which can cause interference.
Python script to emulate the outgoing CAN bus from Pylontech
If you do not have a Pylontech battery yet, you can still test your OpenDTU CANbus installation with an Emulator:
PYLON_EMU Python script to emulate the outgoing CAN bus traffic from a Pylontech LFP battery pack (48V)
https://github.com/juamiso/PYLON_EMU
It requires a raspberry pi (or a linux machine) plus extra hardware (Waveshare RS485 CAN HAT) to communicate via CAN.
See a short screen capture video showing the function of it. https://www.youtube.com/watch?v=CiFts8KZV6k Currently only the keep alive message is being modified every second (incremented by one). The rest of the values are static (but can be modified in the script to be set on-the-fly) https://www.youtube.com/watch?v=CiFts8KZV6k
Required CANtools package, install it using: python3 -m pip install cantools
https://www.waveshare.com/wiki/RS485_CAN_HAT
Install the Waveshare RS485 CAN HAT Your Waveshare RS485 CAN HAT version will probably have a 12M crystal so the config.txt lines should be
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25,spimaxfrequency=2000000
WICHTIG! YOU MUST CHANGE THE CAN0 bitrate before starting the program. Type following command:
sudo ip link set can0 up type can bitrate 500000
Then change to the directory where you have the two files pylon_can.py & pylon_CAN_210124.dbc
UPDATE: You need to edit the pylon_cyc.py and change
Lines 140-141:
for interface, channel in [
('socketcan', 'vcan0'),
into:
for interface, channel in [
('socketcan', 'can0'),
After that run the pylon_can.py script with the command:
python pylon_can.py
which will look like this:
Home Assistant Relevant Information
I found by coincidence the explanations of how it is done: Using the CONSOLE port of the battery.
connect Pin4 (+5~+12V) with Pin5 (GND) for wake up Wake up signal must be ≥0.5Sec, current must be between 5~15mA.
Here is a good video example of somebody using the console port to do the firmware update, it provides information about the communication by Terminal.
Pylontech US2000C auslesen und Firmware Update via RS232
Here is somebody explaining (in German) how he remote controls the powering up of the battery:
Solar – Pylontech Akku (C-Serie) über Konsole aufwecken
Instructions in English are available on Github: Pylontech C Series Monitoring & Wakeup
Just in case it is of use for somebody.
Here is some information about the voltage of the Pylontech US series
Users have reported that even with 52,8V charging voltage, max. SOC % reaches 98% so, take the information below as guidance, rather than absolute rule.
Have also a look there: Battery Tipps
- Home
- FAQ
- First-Time Installation
- Device Profiles (Pin Config)
- Upgrade from OpenDTU
- Getting Help
- Hilfe erhalten
- Builds & Examples
- ESP32 Versions and Memory
- Victron MPPT solar charger
- VE.Direct
- Victron Smartshunt
- Victron Smart Battery Sense
- Warning on Victron MPPT 100/20
- Pylontech battery
- Pytes battery
- Huawei AC PSU
- SBS Unipower Battery
- Jikong JK BMS
- HOYMILES
- Einschaltstrombegrenzung für Balkonkraftwerke - Inrush current limiter
- Live View
- Farbe des Wechselrichterfensters
- Power Meter
- Dynamic Power Limiter
- Dynamic Power Limiter ‐ (Full) Solar‐Passthrough
- Dynamic Power Limiter Limitations
- DC Voltage ‐ Load correction factor
- Battery
- Battery-Tipps
- 24V Battery issues with Hoymiles
- Home Assistant
- Grafana Dashboard
- XXL Balkonkraftwerk 1500 Watt und mehr! Worauf Ihr achten solltet!
- Wie gefährlich kann ein Balkonkraftwerk werden (FI‐Schutzschalter)
- Hardware Purchase Tipp
- Fan speed controller ‐ add temperature sensing to any fan
- Cable length(s) between battery and inverter
- Kabellänge(n) zwischen Batterie und Wechselrichter
- Diodes ‐ Bypass vs. Blocking Diodes
- Impact of high start-currents to the inverter
- Making Cables for your HOYMILES‐CAUTION