GithubHelp home page GithubHelp logo

syssi / esphome-seplos-bms Goto Github PK

View Code? Open in Web Editor NEW
61.0 10.0 27.0 9.29 MB

ESPHome component to monitor a Seplos Battery Management System (Seplos-BMS) via UART or RS485

License: Apache License 2.0

Python 47.66% C++ 51.89% Shell 0.46%
esphome esphome-component seplos-bms hacktoberfest modbus uart

esphome-seplos-bms's Introduction

esphome-seplos-bms

ESPHome component to monitor Seplos BMS via UART or RS485

Supported devices

  • 1101-SP05 (reported by @JacquesdeBruyn)
  • 1101-SP15 (reported by @NosIreland)
  • 1101-SP16 (reported by @atze09)
  • 1101-ZH26 (reported by @faizan-elite)
  • 1101-MZ02 (reported by @fajera81)
  • 1101-SP76 (reported by @bagges)
  • 1101-SP101, PUSUNG-135 (reported by @manznOnly)
  • 1101-10E-SP76-16S (reported by @tobox)
  • 1101-10E-JK06-16S (Apex 48200, Apex BMS 48V200A, reported by @Pho3niX90)
  • Boqiang BMS007-LD43-16S-HW (reported by @xdilian) requires custom settings
    protocol_version: 0x26
    override_pack: 1
    
  • Boqiang BMS001-HS01-15S (reported by @xdilian) requires custom settings
    protocol_version: 0x26
    override_pack: 1
    override_cell_count: 10
    
  • Seplos BMS V3.0 Type C, B-48200-C (BMS16S200A-SP05B, FW 1.3, @Goaheadz) using esp8266-seplos-v3-example.yaml

Untested devices

  • EMU10xx
  • 11XX Series

Schematics

                  RS485                      UART
┌────────────┐              ┌──────────┐                ┌─────────┐
│            │              │          │<----- RX ----->│         │
│   Seplos   │<-----B- ---->│  RS485   │<----- TX ----->│ ESP32/  │
│    BMS     │<---- A+ ---->│  to TTL  │<----- GND ---->│ ESP8266 │
│            │<--- GND ---->│  module  │<----- 3.3V --->│         │<-- VCC
│            │              │          │                │         │<-- GND
└────────────┘              └──────────┘                └─────────┘

Please make sure to power the RS485 module with 3.3V because it affects the TTL (transistor-transistor logic) voltage between RS485 module and ESP.

RJ45 jack

Pin Purpose RS485-to-TTL pin Color T-568B
1 B- B- Orange-White
2 A+ A+ Orange
3 GND GND Green-White
4 NC
5 NC
6 GND
7 A+
8 B-

Please be aware of the different RJ45 pinout colors (T-568A vs. T-568B).

Requirements

Installation

You can install this component with ESPHome external components feature like this:

external_components:
  - source: github://syssi/esphome-seplos-bms@main

or just use the esp32-example.yaml as proof of concept:

# Install esphome
pip3 install esphome

# Clone this external component
git clone https://github.com/syssi/esphome-seplos-bms.git
cd esphome-seplos-bms

# Create a secrets.yaml containing some setup specific secrets
cat > secrets.yaml <<EOF
wifi_ssid: MY_WIFI_SSID
wifi_password: MY_WIFI_PASSWORD

mqtt_host: MY_MQTT_HOST
mqtt_username: MY_MQTT_USERNAME
mqtt_password: MY_MQTT_PASSWORD
EOF

# Validate the configuration, create a binary, upload it, and start logs
# If you use a esp8266 run the esp8266-examle.yaml
esphome run esp32-example.yaml

Screen recording

Example response all sensors enabled

[I][seplos_bms:031]: Telemetry frame received
[D][sensor:124]: 'seplos-bms cell voltage 1': Sending state 3.28800 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 2': Sending state 3.30400 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 3': Sending state 3.31600 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 4': Sending state 3.28700 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 5': Sending state 3.31000 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 6': Sending state 3.30100 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 7': Sending state 3.29700 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 8': Sending state 3.29300 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 9': Sending state 3.30500 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 10': Sending state 3.31200 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 11': Sending state 3.30400 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 12': Sending state 3.31100 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 13': Sending state 3.30700 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 14': Sending state 3.29000 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 15': Sending state 3.29400 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms cell voltage 16': Sending state 3.28900 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms min cell voltage': Sending state 3.28700 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms max cell voltage': Sending state 3.31600 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms max voltage cell': Sending state 3.00000  with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms min voltage cell': Sending state 4.00000  with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms delta cell voltage': Sending state 0.02900 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms average cell voltage': Sending state 3.30050 V with 3 decimals of accuracy
[D][sensor:124]: 'seplos-bms temperature 1': Sending state 29.82000 °C with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms temperature 2': Sending state 29.76000 °C with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms temperature 3': Sending state 29.67000 °C with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms temperature 4': Sending state 29.82000 °C with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms environment temperature': Sending state 29.81000 °C with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms mosfet temperature': Sending state 29.78000 °C with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms current': Sending state -6.54000 A with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms total voltage': Sending state 52.80000 V with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms power': Sending state -345.31198 W with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms charging power': Sending state 0.00000 W with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms discharging power': Sending state 345.31198 W with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms residual capacity': Sending state 133.86000 Ah with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms battery capacity': Sending state 170.00000 Ah with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms state of charge': Sending state 78.70000 % with 1 decimals of accuracy
[D][sensor:124]: 'seplos-bms rated capacity': Sending state 180.00000 Ah with 2 decimals of accuracy
[D][sensor:124]: 'seplos-bms charging cycles': Sending state 70.00000  with 0 decimals of accuracy
[D][sensor:124]: 'seplos-bms state of health': Sending state 100.00000 % with 1 decimals of accuracy
[D][sensor:124]: 'seplos-bms port voltage': Sending state 52.79000 V with 2 decimals of accuracy

Known issues and limitations

None.

Protocol

See SEPLOS BMS Communication Protocol_V2.0.pdf and Seplos 48v 100A BMS RS485 Protocol.pdf.

$ echo -ne "~20004642E00200FD37\r" | hexdump -ve '1/1 "%.2X."'
      7E.32.30.30.30.34.36.34.32.45.30.30.32.30.30.46.44.33.37.0D.

# Get pack #0 telemetry data (CID2 `0x42`)
TX -> "~20004642E00200FD37\r"
RX <- "~2000460010960001100CD70CE90CF40CD60CEF0CE50CE10CDC0CE90CF00CE80CEF0CEA0CDA0CDE0CD8060BA60BA00B970BA60BA50BA2FD5C14A0344E0A426803134650004603E8149F0000000000000000DC6C\r"

# Get system parameters (CID2 `0x47`)
TX -> "~200046470000FDA9\r"
RX <- ?

# Get protocol version (CID2 `0x4F`)
TX -> "~2000464F0000FD9A\r"
RX <- ?

# Get manufacturer info (CID2 `0x51`)
TX -> "~200046510000FDAE\r"
RX <- "~20004600C040313130312D5350313520020743414E50726F746F636F6C3A536F666172202020F046\r"

# Get management info (pylontech only?)
TX -> "~200046920000FDA9\r"
RX <- ?

# Get module serial number (pylontech only?)
TX -> "~200046930000FDA8\r"
RX <- ?

Debugging

If this component doesn't work out of the box for your device please update your configuration to enable the debug output of the UART component and increase the log level to the see outgoing and incoming serial traffic:

logger:
  level: DEBUG

uart:
  id: uart_0
  baud_rate: 9600
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}
  rx_buffer_size: 384
  debug:
    dummy_receiver: false
    direction: BOTH
    after:
      delimiter: "\r"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

References

esphome-seplos-bms's People

Contributors

syssi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esphome-seplos-bms's Issues

Decode management info (`0x92`) frame

[16:11:24][D][uart_debug:158]: >>> "~200046920000FDA9\r"
[16:11:24][D][uart_debug:158]: <<< "~200046040000FDB0\r"

[16:11:44][D][uart_debug:158]: >>> "~200046920000FDA9\r"
[16:11:44][D][uart_debug:158]: <<< "~200046040000FDB0\r"

[16:12:04][D][uart_debug:158]: >>> "~200046920000FDA9\r"
[16:12:04][D][uart_debug:158]: <<< "~200046040000FDB0\r"

[16:12:24][D][uart_debug:158]: >>> "~200046920000FDA9\r"
[16:12:24][D][uart_debug:158]: <<< "~200046040000FDB0\r"
~200046040000FDB0\r
       ^^ CID2 0x04 = CID2 invalid

Esphome-seplos-bms suddenly unavailable

I have esphome seplos bms running on a Wemos D1; since yesterday, the sensors in home assistant have become unavailable. The esphome device is still online and it’s physically connected to the BMS.

This is what I can see in the esphome device logs
image

Is anything I can check from home assistant?

Decode serial number (`0x93`) frame

[16:11:26][D][uart_debug:158]: >>> "~200046930000FDA8\r"
[16:11:26][D][uart_debug:158]: <<< "~200046040000FDB0\r"

[16:11:46][D][uart_debug:158]: >>> "~200046930000FDA8\r"
[16:11:46][D][uart_debug:158]: <<< "~200046040000FDB0\r"

[16:12:06][D][uart_debug:158]: >>> "~200046930000FDA8\r"
[16:12:06][D][uart_debug:158]: <<< "~200046040000FDB0\r"

[16:12:26][D][uart_debug:158]: >>> "~200046930000FDA8\r"
[16:12:26][D][uart_debug:158]: <<< "~200046040000FDB0\r"
~200046040000FDB0\r
       ^^ CID2 0x04 = CID2 invalid

Decoding RichPower BMS073 protocol

This BMS seems to use a very similar protocol to the Seplos, as this project is able to decode some of the data already when I connect it in parallel with the other batteries RS485 (it needs a different read command which this code does not send by default) But it can decode most of the data when it is received.

Battery not connected currently so current showing zero is fine. The battery SOC did not display yet.

I tried updating the protocol to 80 which shows it outputting "~80004642E00200FD31\r" which is farily close to the command coming from the master battery that produces the mostly decodable data "~8000D542E00201FD21\r"

That is the data for the battery 1 the slave battery. The master battery is probably just not requesting data of itself I suppose..

I will try to hack on it more later ran out of time. Any hints appreciated.

[11:47:29][D][uart_debug:158]: >>> "~80004642E00200FD31\r"
[11:47:29][D][uart_debug:158]: <<< "~8000D542E00201FD21\r"
[11:47:29][W][seplos_bms:022]: Unhandled data received (data_len: 0x02): 80.00.D5.42.E0.02.01 (7)
[11:47:29][D][uart_debug:158]: <<< "~8000D500B07E0001100CE10CE00CE00CDF0CE00CE00CE00CE00CDF0CE00CE00CE00CE00CE10CE00CDF060B750B760B770B750B920B8C0000149A2BA2046D600000000003E8E1B9\r"
[11:47:29][I][seplos_bms:030]: Telemetry frame (69 bytes) received
[11:47:29][V][seplos_bms:048]: Command group: 1
[11:47:29][V][seplos_bms:052]: Number of cells: 16
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 1': Received new state 3.297000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 1': Sending state 3.29700 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 2': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 2': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 3': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 3': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 4': Received new state 3.295000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 4': Sending state 3.29500 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 5': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 5': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 6': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 6': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 7': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 7': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 8': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 8': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 9': Received new state 3.295000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 9': Sending state 3.29500 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 10': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 10': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 11': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 11': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 12': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 12': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 13': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 13': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 14': Received new state 3.297000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 14': Sending state 3.29700 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 15': Received new state 3.296000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 15': Sending state 3.29600 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 cell voltage 16': Received new state 3.295000
[11:47:29][D][sensor:094]: 'seplos-bms-2 cell voltage 16': Sending state 3.29500 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 min cell voltage': Received new state 3.295000
[11:47:29][D][sensor:094]: 'seplos-bms-2 min cell voltage': Sending state 3.29500 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 max cell voltage': Received new state 3.297000
[11:47:29][D][sensor:094]: 'seplos-bms-2 max cell voltage': Sending state 3.29700 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 max voltage cell': Received new state 1.000000
[11:47:29][D][sensor:094]: 'seplos-bms-2 max voltage cell': Sending state 1.00000  with 0 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 min voltage cell': Received new state 4.000000
[11:47:29][D][sensor:094]: 'seplos-bms-2 min voltage cell': Sending state 4.00000  with 0 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 delta cell voltage': Received new state 0.002000
[11:47:29][D][sensor:094]: 'seplos-bms-2 delta cell voltage': Sending state 0.00200 V with 3 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 average cell voltage': Received new state 3.295938
[11:47:29][D][sensor:094]: 'seplos-bms-2 average cell voltage': Sending state 3.29594 V with 3 decimals of accuracy
[11:47:29][V][seplos_bms:088]: Number of temperature sensors: 6
[11:47:29][V][sensor:043]: 'seplos-bms-2 temperature 1': Received new state 20.200001
[11:47:29][D][sensor:094]: 'seplos-bms-2 temperature 1': Sending state 20.20000 °C with 0 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 temperature 2': Received new state 20.300001
[11:47:29][D][sensor:094]: 'seplos-bms-2 temperature 2': Sending state 20.30000 °C with 0 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 temperature 3': Received new state 20.400000
[11:47:29][D][sensor:094]: 'seplos-bms-2 temperature 3': Sending state 20.40000 °C with 0 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 temperature 4': Received new state 20.200001
[11:47:29][D][sensor:094]: 'seplos-bms-2 temperature 4': Sending state 20.20000 °C with 0 decimals of accuracy
[11:47:29][V][sensor:043]: 'seplos-bms-2 environment temperature': Received new state 23.100000
[11:47:29][D][sensor:094]: 'seplos-bms-2 environment temperature': Sending state 23.10000 °C with 0 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 mosfet temperature': Received new state 22.500000
[11:47:30][D][sensor:094]: 'seplos-bms-2 mosfet temperature': Sending state 22.50000 °C with 0 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 current': Received new state 0.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 current': Sending state 0.00000 A with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 total voltage': Received new state 52.739998
[11:47:30][D][sensor:094]: 'seplos-bms-2 total voltage': Sending state 52.74000 V with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 power': Received new state 0.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 power': Sending state 0.00000 W with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 charging power': Received new state 0.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 charging power': Sending state 0.00000 W with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 discharging power': Received new state 0.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 discharging power': Sending state 0.00000 W with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 residual capacity': Received new state 111.699997
[11:47:30][D][sensor:094]: 'seplos-bms-2 residual capacity': Sending state 111.70000 Ah with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 battery capacity': Received new state 280.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 battery capacity': Sending state 280.00000 Ah with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 state of charge': Received new state 0.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 state of charge': Sending state 0.00000 % with 1 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 rated capacity': Received new state 0.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 rated capacity': Sending state 0.00000 Ah with 2 decimals of accuracy
[11:47:30][V][sensor:043]: 'seplos-bms-2 charging cycles': Received new state 1000.000000
[11:47:30][D][sensor:094]: 'seplos-bms-2 charging cycles': Sending state 1000.00000  with 0 decimals of accuracy

Seplos 200 a 16s CAN

Hi, I have a seplos 200a 16s with CAN1101 firmware v16.04.06_PN01_220924_9600 which communicates with using the 9600 band. The dip switches are 10000000. What are the settings for correct operation? Thank you

Unhandled data received

I have an esp32 connected to the Master BMS of a set 4 batteries with Seplos 10E 200A with BT. The connectivity to the BMS is not very stable and I recieve errors every second in the log. The registers of the 3 slaves are not updated every interval. Sometimes it updates just the registers of one or two packs.

RS485 is powered by 5V. Same behavior with 3.3V. Do youhave any idea what causes this behavior?

[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x40): 20.01.46.5A.C0.40.00.01.0C.F1.0C.EF.0B.B9.0B.AD.FA.60.14.B3.58.11.6D.60.03.25.14.B3.00.00.00.00.00.00.03.02.80.41 (38)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x00): 20.02.46.5A.00.00 (6)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x00): 20.02.46.5A.00.00 (6)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x40): 20.02.46.5A.C0.40.00.01.0C.F2.0C.EF.0B.B8.0B.AD.FA.9C.14.B4.59.AE.6D.60.03.33.14.B5.00.00.00.00.00.00.03.02.80.41 (38)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x40): 20.02.46.5A.C0.40.00.01.0C.F2.0C.EF.0B.B8.0B.AD.FA.9C.14.B4.59.AE.6D.60.03.33.14.B5.00.00.00.00.00.00.03.02.80.41 (38)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x00): 20.03.46.5A.00.00 (6)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x00): 20.03.46.5A.00.00 (6)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x40): 20.03.46.5A.C0.40.00.01.0C.F7.0C.E7.0B.AD.0B.A2.FD.5C.14.B4.64.4B.6D.60.03.94.14.B5.00.00.00.00.00.00.03.02.80.41 (38)
[21:29:38][W][seplos_bms:022]: Unhandled data received (data_len: 0x40): 20.03.46.5A.C0.40.00.01.0C.F7.0C.E7.0B.AD.0B.A2.FD.5C.14.B4.64.4B.6D.60.03.94.14.B5.00.00.00.00.00.00.03.02.80.41 (38)

Has this been tested?

Hi,
I have Seplos BMS and looking to for ways to monitor it. I have found this repo but I am lacking details. I see esphome template but this looks a bit strange to me since I do not see MODBUS anywhere and BMS is using MODBUS ASCII to communicate. Has this been verified as working? As I understand I do nee UART to RS485 converter between ESP and Seplos.
Thanks

1101-SP16 support multiple batteries

Hello,
After i got it working with my single unit 1101-SP16 with Baud 19200, i wanted to try the multiple battery example, because my second BMS will arrive these days.
I changed the DIp to the following:
image
And extended the code to the multiple example, but the sensors in HA are not working.

Here is the debug log.
INFO Reading configuration /config/esphome/seplos-bms-1.yaml...
INFO Updating https://github.com/syssi/esphome-seplos-bms.git@main
INFO Starting log output from seplos-bms-1.local using esphome API
INFO Successfully connected to seplos-bms-1.local
[13:52:57][I][app:102]: ESPHome version 2022.9.4 compiled on Oct 10 2022, 13:42:49
[13:52:57][C][wifi:502]: WiFi:
[13:52:57][C][wifi:360]: Local MAC: 48:3F:DA:87:75:CB
[13:52:57][C][wifi:361]: SSID: [redacted]
[13:52:57][C][wifi:362]: IP Address: 192.168.17.178
[13:52:57][C][wifi:363]: BSSID: [redacted]
[13:52:57][C][wifi:365]: Hostname: 'seplos-bms-1'
[13:52:57][C][wifi:367]: Signal strength: -65 dB ▂▄▆█
[13:52:57][C][wifi:371]: Channel: 1
[13:52:57][C][wifi:372]: Subnet: 255.255.255.0
[13:52:57][C][wifi:373]: Gateway: 192.168.17.1
[13:52:57][C][wifi:374]: DNS1: 192.168.17.2
[13:52:57][C][wifi:375]: DNS2: 0.0.0.0
[13:52:57][C][logger:275]: Logger:
[13:52:57][C][logger:276]: Level: DEBUG
[13:52:57][C][logger:277]: Log Baud Rate: 115200
[13:52:57][C][logger:278]: Hardware UART: UART0
[13:52:57][C][uart.arduino_esp8266:102]: UART Bus:
[13:52:57][C][uart.arduino_esp8266:103]: TX Pin: GPIO4
[13:52:57][C][uart.arduino_esp8266:104]: RX Pin: GPIO5
[13:52:57][C][uart.arduino_esp8266:106]: RX Buffer Size: 384
[13:52:57][C][uart.arduino_esp8266:108]: Baud Rate: 19200 baud
[13:52:57][C][uart.arduino_esp8266:109]: Data Bits: 8
[13:52:57][C][uart.arduino_esp8266:110]: Parity: NONE
[13:52:57][C][uart.arduino_esp8266:111]: Stop bits: 1
[13:52:57][C][uart.arduino_esp8266:115]: Using software serial
[13:52:57][C][seplos_modbus:129]: SeplosModbus:
[13:52:57][C][seplos_modbus:131]: RX timeout: 150 ms
[13:52:57][C][seplos_bms:142]: SeplosBms:
[13:52:57][C][seplos_bms:143]: Minimum Cell Voltage 'seplos-bms-1 bank 0 min cell voltage'
[13:52:57][C][seplos_bms:143]: Device Class: 'voltage'
[13:52:57][C][seplos_bms:143]: State Class: 'measurement'
[13:52:57][C][seplos_bms:143]: Unit of Measurement: 'V'
[13:52:57][C][seplos_bms:143]: Accuracy Decimals: 3
[13:52:57][C][seplos_bms:144]: Maximum Cell Voltage 'seplos-bms-1 bank 0 max cell voltage'
[13:52:57][C][seplos_bms:144]: Device Class: 'voltage'
[13:52:57][C][seplos_bms:144]: State Class: 'measurement'
[13:52:57][C][seplos_bms:144]: Unit of Measurement: 'V'
[13:52:57][C][seplos_bms:144]: Accuracy Decimals: 3
[13:52:57][C][seplos_bms:147]: Delta Cell Voltage 'seplos-bms-1 bank 0 delta cell voltage'
[13:52:57][C][seplos_bms:147]: Device Class: 'voltage'
[13:52:57][C][seplos_bms:147]: State Class: 'measurement'
[13:52:57][C][seplos_bms:147]: Unit of Measurement: 'V'
[13:52:57][C][seplos_bms:147]: Accuracy Decimals: 3
[13:52:57][C][seplos_bms:170]: Total Voltage 'seplos-bms-1 bank 0 total voltage'
[13:52:57][C][seplos_bms:170]: Device Class: 'voltage'
[13:52:57][C][seplos_bms:170]: State Class: 'measurement'
[13:52:57][C][seplos_bms:170]: Unit of Measurement: 'V'
[13:52:57][C][seplos_bms:170]: Accuracy Decimals: 2
[13:52:57][C][seplos_bms:171]: Current 'seplos-bms-1 bank 0 current'
[13:52:57][C][seplos_bms:171]: Device Class: 'current'
[13:52:57][C][seplos_bms:171]: State Class: 'measurement'
[13:52:57][C][seplos_bms:171]: Unit of Measurement: 'A'
[13:52:57][C][seplos_bms:171]: Accuracy Decimals: 2
[13:52:57][C][seplos_bms:171]: Icon: 'mdi:current-dc'
[13:52:57][C][seplos_bms:172]: Power 'seplos-bms-1 bank 0 power'
[13:52:57][C][seplos_bms:172]: Device Class: 'power'
[13:52:57][C][seplos_bms:172]: State Class: 'measurement'
[13:52:57][C][seplos_bms:172]: Unit of Measurement: 'W'
[13:52:57][C][seplos_bms:172]: Accuracy Decimals: 2
[13:52:57][C][seplos_bms:176]: State of charge 'seplos-bms-1 bank 0 state of charge'
[13:52:57][C][seplos_bms:176]: State Class: 'measurement'
[13:52:57][C][seplos_bms:176]: Unit of Measurement: '%'
[13:52:57][C][seplos_bms:176]: Accuracy Decimals: 1
[13:52:57][C][seplos_bms:176]: Icon: 'mdi:battery-50'
[13:52:57][C][seplos_bms:142]: SeplosBms:
[13:52:57][C][seplos_bms:142]: SeplosBms:
[13:52:57][C][captive_portal:088]: Captive Portal:
[13:52:57][C][mdns:100]: mDNS:
[13:52:57][C][mdns:101]: Hostname: seplos-bms-1
[13:52:57][C][ota:089]: Over-The-Air Updates:
[13:52:57][C][ota:090]: Address: seplos-bms-1.local:8266
[13:52:57][C][ota:093]: Using Password.
[13:52:57][C][api:138]: API Server:
[13:52:57][C][api:139]: Address: seplos-bms-1.local:6053
[13:52:57][C][api:141]: Using noise encryption: YES

[13:52:59][D][uart_debug:114]: >>> 7E:32:30:30:30:34:36:34:32:45:30:30:32:30:30:46:44:33:37:0D

[13:52:59][D][uart_debug:114]: >>> 7E:32:30:30:32:34:36:34:32:45:30:30:32:30:32:46:44:33:33:0D

[13:53:03][D][uart_debug:114]: >>> 7E:32:30:30:31:34:36:34:32:45:30:30:32:30:31:46:44:33:35:0D
[13:53:03][D][uart_debug:114]: <<< 7E:32:30:30:31:34:36:30:30:31:30:39:36:30:30:30:31:31:30:30:44:30:44:30:44:30:44:30:44:30:43:30:44:30:44:30:44:30:44:30:44:30:45:30:44:30:45:30:44:30:45:30:44:30:45:30:44:30:44:30:44:30:45:30:44:30:45:30:44:30:46:30:44:30:46:30:44:30:45:30:44:30:45:30:36:30:42:44:32:30:42:44:34:30:42:43:43:30:42:44:30:30:42:39:45:30:42:41:42:30:30:30:30:31:34:45:32:36:39:45:34:30:41:37:30:44:41:30:33:41:41:37:30:44:41:30:30:36:42:30:33:45:38:31:34:44:46:30:30:30
[13:53:03][I][seplos_bms:031]: Telemetry frame received
[13:53:03][D][uart_debug:114]: <<< 30:30:30:30:30:30:30:30:30:30:30:30:30:44:43:41:32:0D

[13:53:09][D][uart_debug:114]: >>> 7E:32:30:30:30:34:36:34:32:45:30:30:32:30:30:46:44:33:37:0D

[13:53:09][D][uart_debug:114]: >>> 7E:32:30:30:32:34:36:34:32:45:30:30:32:30:32:46:44:33:33:0D

[13:53:13][D][uart_debug:114]: >>> 7E:32:30:30:31:34:36:34:32:45:30:30:32:30:31:46:44:33:35:0D
[13:53:13][D][uart_debug:114]: <<< 7E:32:30:30:31:34:36:30:30:31:30:39:36:30:30:30:31:31:30:30:44:30:44:30:44:30:44:30:44:30:43:30:44:30:44:30:44:30:44:30:44:30:45:30:44:30:45:30:44:30:45:30:44:30:45:30:44:30:44:30:44:30:45:30:44:30:45:30:44:30:46:30:44:30:45:30:44:30:44:30:44:30:44:30:36:30:42:44:32:30:42:44:34:30:42:43:43:30:42:44:30:30:42:39:45:30:42:41:41:30:30:30:30:31:34:45:32:36:39:45:34:30:41:37:30:44:41:30:33:41:41:37:30:44:41:30:30:36:42:30:33:45:38:31:34:44:46:30:30:30
[13:53:13][I][seplos_bms:031]: Telemetry frame received

Hope you can help me.
Thank you

1101-SP88 Unable to get any comms. Invalid header: 0x00

Hi.

I am struggling to get this running on my Seplos BMS.

I am using a Wemos D1 mini: https://diyi0t.com/esp8266-wemos-d1-mini-tutorial/?utm_content=cmp-true
And a Fasizi 5pcs TTL To RS485 Adapter: https://www.amazon.co.uk/Fasizi-Adapter-Serial-Converter-Module/dp/B09Z2GTMJ8

I have installed the esp8266-example.yaml, changed my BAUD to 19200 (as tested with my laptop and seplos management software on the RS485 ports.

I am fairly sure it is GPIO1 and GPIO3 from reading the Wemos D1 info: https://mischianti.org/2019/09/19/wemos-d1-mini-esp8266-debug-on-secondary-uart-part-3/

I have enabled debug as you can see in my code. All i am able to get is :

[19:49:58][D][uart_debug:158]: >>> "~20004642E00200FD37\r" [19:50:08][D][uart_debug:158]: >>> "~20004642E00200FD37\r" [19:50:18][D][uart_debug:158]: >>> "~20004642E00200FD37\r" [19:50:28][D][uart_debug:158]: >>> "~20004642E00200FD37\r" [19:50:38][D][uart_debug:158]: >>> "~20004642E00200FD37\r" [19:50:48][D][uart_debug:158]: >>> "~20004642E00200FD37\r" [19:50:58][D][uart_debug:158]: >>> "~20004642E00200FD37\r" [19:51:08][D][uart_debug:158]: >>> "~20004642E00200FD37\r"

An i get a flashing RXD light on the RS485 board, but nothing on TXD.

My seplos BMS is a 1101-SP88 SW16.4

Appreciate any advice please. Have to admit i am a n00b, and don't have a linux box. I am doing everything through ESPHOME on my HA instance.

Here is my board:

20230805_195646
20230805_195503

Here is my code

substitutions:
  name: seplos-bms
  device_description: "Monitor a Seplos BMS via RS485"
  external_components_source: github://syssi/esphome-seplos-bms@main
  tx_pin: GPIO1
  rx_pin: GPIO3

esphome:
  name: ${name}
  comment: ${device_description}
  project:
    name: "syssi.esphome-seplos-bms"
    version: 1.1.0

esp8266:
  board: d1_mini

external_components:
  - source: ${external_components_source}
    refresh: 0s

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

ota:

logger:
  baud_rate: 0

api:

uart:
  id: uart_0
  # Please set the default baudrate of your Seplos BMS model here. It's sometimes 19200 baud instead of 9600.
  baud_rate: 19200
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}
  # The increased RX buffer size is important because
  # the full BMS response must fit into the buffer
  rx_buffer_size: 384
  debug:
    dummy_receiver: false
    direction: BOTH
    after:
      delimiter: "\r"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

seplos_modbus:
  flow_control_pin: 4
  id: modbus0
  uart_id: uart_0
  rx_timeout: 150ms

seplos_bms:
  id: bms0
  # Dip switch configuration of a single pack setup / address 0x0
  #  8    7    6    5    4    3    2    1
  # off, off, off, off, off, off, off, off
  address: 0x00
  # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang)
  protocol_version: 0x20
  seplos_modbus_id: modbus0
  update_interval: 10s

sensor:
  - platform: seplos_bms
    min_cell_voltage:
      name: "${name} min cell voltage"
    max_cell_voltage:
      name: "${name} max cell voltage"
    min_voltage_cell:
      name: "${name} min voltage cell"
    max_voltage_cell:
      name: "${name} max voltage cell"
    delta_cell_voltage:
      name: "${name} delta cell voltage"
    average_cell_voltage:
      name: "${name} average cell voltage"
    cell_voltage_1:
      name: "${name} cell voltage 1"
    cell_voltage_2:
      name: "${name} cell voltage 2"
    cell_voltage_3:
      name: "${name} cell voltage 3"
    cell_voltage_4:
      name: "${name} cell voltage 4"
    cell_voltage_5:
      name: "${name} cell voltage 5"
    cell_voltage_6:
      name: "${name} cell voltage 6"
    cell_voltage_7:
      name: "${name} cell voltage 7"
    cell_voltage_8:
      name: "${name} cell voltage 8"
    cell_voltage_9:
      name: "${name} cell voltage 9"
    cell_voltage_10:
      name: "${name} cell voltage 10"
    cell_voltage_11:
      name: "${name} cell voltage 11"
    cell_voltage_12:
      name: "${name} cell voltage 12"
    cell_voltage_13:
      name: "${name} cell voltage 13"
    cell_voltage_14:
      name: "${name} cell voltage 14"
    cell_voltage_15:
      name: "${name} cell voltage 15"
    cell_voltage_16:
      name: "${name} cell voltage 16"
    temperature_1:
      name: "${name} temperature 1"
    temperature_2:
      name: "${name} temperature 2"
    temperature_3:
      name: "${name} temperature 3"
    temperature_4:
      name: "${name} temperature 4"
    temperature_5:
      name: "${name} environment temperature"
    temperature_6:
      name: "${name} mosfet temperature"
    total_voltage:
      name: "${name} total voltage"
    current:
      name: "${name} current"
    power:
      name: "${name} power"
    charging_power:
      name: "${name} charging power"
    discharging_power:
      name: "${name} discharging power"
    residual_capacity:
      name: "${name} residual capacity"
    battery_capacity:
      name: "${name} battery capacity"
    rated_capacity:
      name: "${name} rated capacity"
    state_of_charge:
      name: "${name} state of charge"
    charging_cycles:
      name: "${name} charging cycles"
    state_of_health:
      name: "${name} state of health"
    port_voltage:
      name: "${name} port voltage"

max battery bank's ?

in theory there can be 15 BMS Moduls on the RS485 Bus .
But it seams after >5 battery bank entry's i get some memory problems.

Iam not sure where the code crashes . look like during mqtt or debug preparing.

Add multiple batteries example

uart:
  id: uart0
  baud_rate: 9600
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}
  rx_buffer_size: 384

seplos_modbus:
  id: modbus0
  uart_id: uart0

seplos_bms:
  - id: bms0
    seplos_modbus_id: modbus0
    address: 0x01
  - id: bms1
    seplos_modbus_id: modbus0
    address: 0x02

sensor:
  - platform: seplos_bms
    seplos_bms_id: bms0
    total_voltage:
      name: "${name} total voltage"
    state_of_charge:
      name: "${name} state of charge"

  - platform: seplos_bms
    seplos_bms_id: bms1
    total_voltage:
      name: "${name} total voltage"
    state_of_charge:
      name: "${name} state of charge"

Requires: #7

unhandled data and bad header

In adition to post: https://github.com/syssi/esphome-seplos-bms/issues/86 and https://github.com/syssi/esphome-seplos-bms/issues/67
I also use the Seplos BMS 48200-1101-10E-SP118-16S (or 1101-4800-10E-BOM-V16-57FTDJR) in a Daly Green mason attached to 3 Victron multiplus II.
I managed to setup a esp8266 lilo with a ttl as described here https://github.com/syssi/esphome-seplos-bms/discussions/55#discussioncomment-9228944

I am getting some errors like unhandled data, bad header and failed CRC check.
logs_esphome-web-761f72_logs.txt

how to resolve these errors?

seplos_modbus reporting invalid header

First of all, thanks for your awesome projects!

I am using an RS458 adapter with MAX458 chip. I tried to use pins 1/3 and 15/13 for Tx/Rx on an ESP32 dev kit v4. As flow control pin I am using 4/5. I read that you do not recommend those boards with flow control, but I designed a PCB with those and try to get them working before I redesign the PCB ...

My config:

substitutions:
  name: seplos-bms
  device_description: "Monitor a Seplos BMS via RS485"
  external_components_source: github://syssi/esphome-seplos-bms@main

esphome:
  name: ${name}
  comment: ${device_description}
  platform: ESP32
  board: nodemcu-32s
  project:
    name: "syssi.esphome-seplos-bms"
    version: 1.1.0

external_components:
  - source: ${external_components_source}
    refresh: 0s

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

api:
ota:
logger:
  baud_rate: 0
  level: DEBUG

uart:
  id: uart0
  # Please set the default baudrate of your Seplos BMS model here. It's sometimes 19200 baud instead of 9600.
  baud_rate: 19200
  tx_pin: 15
  rx_pin: 13
  # The increased RX buffer size is important because
  # the full BMS response must fit into the buffer
  rx_buffer_size: 384
  debug:
    dummy_receiver: false
    direction: BOTH
    after:
      delimiter: "\r"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);
seplos_modbus:
  id: modbus0
  uart_id: uart0
  rx_timeout: 150ms
  flow_control_pin: 4

seplos_bms:
  id: bms0
  # Dip switch configuration of a single pack setup / address 0x0
  #  8    7    6    5    4    3    2    1
  # off, off, off, off, off, off, off, off
  address: 0x00
  # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang)
  protocol_version: 0x20
  seplos_modbus_id: modbus0
  update_interval: 10s

I configured debug logging and can see this:

[15:47:43][D][seplos_modbus:163]: Send frame: ~20004642E00200FD37
[15:47:43][D][uart_debug:158]: >>> "~20004642E00200FD37\r"
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][D][uart_debug:158]: <<< "70A6D6003E76D60000703E815C200000076035902CDDD12\r"
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][W][seplos_modbus:086]: Invalid header
[15:47:43][D][uart_debug:158]: <<< "\xFF\xFF~2000460010960000100D990D990D9A0D980D990D990D990D990D980D9A0D9A0D9A0D9B0D9A0D9B0D9A060B640B5D0B620B600B850B5D000015C26D5"
[15:47:53][D][seplos_modbus:163]: Send frame: ~20004642E00200FD37
[15:47:53][D][uart_debug:158]: >>> "~20004642E00200FD37\r"
[15:47:53][W][seplos_modbus:086]: Invalid header
[15:47:53][W][seplos_modbus:086]: Invalid header

Do you have any idea what could be the issue?

esp32 example file missing and max485 support

Hi, I'm new to esphome and home assistant. I can't seem to get the 8266 code working on my 32. I have modified where gpio pins differ and added the flow control pin under uart but haven't gotten any readings out yet. I just want to get readings out to home assistant to mange loads. Just voltage, soc and amps/watts in out needed mostly. I can post my modified code if you need it. it does flash no problem but I don't get any return in the logs. I have a usb to 485 and the pc software for this bms

Seplos v3 sensor information

I've noticed on v3 some of the sensors have the wrong register type. Some are set as holding - where it should be Read.
I also noticed the tempreture sensors aren't reading the correct temperatures. They seems to be about 5 degrees higher than the temperatures shown on the actual BMS display?

no connect to seplos BMS

Hi,
i have installed to ESP32 with TTL to RS485 Board and i can't conect the BMS.
This is the only information on log, debug ist enabled.

INFO Starting log output from seplos-bms01.local using esphome API
WARNING Can't connect to ESPHome API for seplos-bms01.local: Handshake timed out
WARNING seplos-bms01.local: Connection error occurred: Connection lost

i have changed TX and RX, changed A and B, always the same result, no connect. With original software from seplos it works fine with 19200 baud...
TxD on RS485 blink some times.
how can i do that its work???

about esp32-seplos-v3-example.yaml

hello,
I cant find in this code the "cell balance voltage" and the batterie power.
There is something wrong with temperature, please see picture attach

Capture d'écran 2024-04-24 181853

for SOC I had to add filters / multiply: 0.1

Merci.

1101-JK06 no data being received

So just recently purchased the ESP32 and a TTL converted, I set everything up, and ran in debug mode. RJ45 is connected to the first RS485 next to the CAN.

On the converter, I can see the periodic tx, but RX is never triggered.

  • I have used the esp32-example.yaml and have tried both 19200 and 9600 without success.
  • I have tested the continuity of the RJ45, and all checks out.
  • I have tried using the second RJ45 port, no success.

Here is the debug info:
image

The converter being used:
image

I do see the following warning about GPIO5, not sure if it's related:
image

Add 1101-SP16 support

Hello i have two 1101-S16 units and would also like to use your ESPHOME Splos BMS.
Could you also implement?
i would help with testing.
Thanks.
Regards,
Dominik

Communication stops working from time to time (random)

Hi, I am aware this is a hard question haha.
I've been using this amazing tool for 1 year already. This is the 3rd time I have this problem and would like to know the reason behind it to try to avoid it/fix it.
It all works perfectly until it doesn't work at all. From my point of view it looks like BMS just blocks communication and doesn't respond. Last 2 times it just started working again after few days (1-3d) of not working.
Thanks a lot!!

Config:
Config_seplos.txt
Log:
logs_seplos.txt

Just tested with BatteryMonitor and BMS seems to be working correctly.

Seplos v3 multi battery pack

I have been doing some research on the seplos rs485 bus, and I have programmed a python script to "listen" the data from the complete battery pack (when there is more than one) and publish it to a MQTT server (with auto discovery for home assistant).
When there is only one battery, modbus can be used directly, but when there are several batteries the main one acts as "Master" and there can only be one master, so there is no other option but to listen to what the master asks and decode it.
The code (a draft version) is in: https://github.com/ferelarg/Seplos3MQTT

Seplosbms CRC check error

hi,

I have been trying to get data but i keep getting this error:

[W][seplos_modbus:101]: SeplosBms CRC Check failed! DD5D != DCFD

from time to time i get the bms data ok, but most of the time is that error.
I played with the rx timeout and i get data, but alot of that error.
logs_seplosbms_logs (2).txt

I have a seplos BMS from millenials , 150A 16cells.
this is my config:

`substitutions:
name: seplos-bms
external_components_source: github://syssi/esphome-seplos-bms@main
tx_pin: GPIO4
rx_pin: GPIO5

esphome:
name: ${name}

esp8266:
board: esp01_1m

external_components:

  • source: ${external_components_source}
    refresh: 0s

Enable logging

logger:

Enable Home Assistant API

api:
encryption:
key: "LElVpf+yOX/T7gPTYWuijvEsBFLPyGlGuRXZkKLq5js="

ota:
password: "fbce9898f7a22f8bbc01ce2114efe287"

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: "Seplosbms Fallback Hotspot"
password: "OiVjReZiaGkq"

captive_portal:

uart:
id: uart0
baud_rate: 19200
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
debug:
direction: BOTH
dummy_receiver: true
after:
delimiter: "\r"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);

seplos_modbus:
id: modbus0
uart_id: uart0
rx_timeout: 1100ms

seplos_bms:
id: bms0
seplos_modbus_id: modbus0
update_interval: 10s

sensor:

  • platform: seplos_bms
    min_cell_voltage:
    name: "${name} min cell voltage"
    max_cell_voltage:
    name: "${name} max cell voltage"
    min_voltage_cell:
    name: "${name} min voltage cell"
    max_voltage_cell:
    name: "${name} max voltage cell"
    delta_cell_voltage:
    name: "${name} delta cell voltage"
    average_cell_voltage:
    name: "${name} average cell voltage"
    cell_voltage_1:
    name: "${name} cell voltage 1"
    cell_voltage_2:
    name: "${name} cell voltage 2"
    cell_voltage_3:
    name: "${name} cell voltage 3"
    cell_voltage_4:
    name: "${name} cell voltage 4"
    cell_voltage_5:
    name: "${name} cell voltage 5"
    cell_voltage_6:
    name: "${name} cell voltage 6"
    cell_voltage_7:
    name: "${name} cell voltage 7"
    cell_voltage_8:
    name: "${name} cell voltage 8"
    cell_voltage_9:
    name: "${name} cell voltage 9"
    cell_voltage_10:
    name: "${name} cell voltage 10"
    cell_voltage_11:
    name: "${name} cell voltage 11"
    cell_voltage_12:
    name: "${name} cell voltage 12"
    cell_voltage_13:
    name: "${name} cell voltage 13"
    cell_voltage_14:
    name: "${name} cell voltage 14"
    cell_voltage_15:
    name: "${name} cell voltage 15"
    cell_voltage_16:
    name: "${name} cell voltage 16"
    temperature_1:
    name: "${name} temperature 1"
    temperature_2:
    name: "${name} temperature 2"
    temperature_3:
    name: "${name} temperature 3"
    temperature_4:
    name: "${name} temperature 4"
    temperature_5:
    name: "${name} environment temperature"
    temperature_6:
    name: "${name} mosfet temperature"
    total_voltage:
    name: "${name} total voltage"
    current:
    name: "${name} current"
    power:
    name: "${name} power"
    charging_power:
    name: "${name} charging power"
    discharging_power:
    name: "${name} discharging power"
    residual_capacity:
    name: "${name} residual capacity"
    battery_capacity:
    name: "${name} battery capacity"
    rated_capacity:
    name: "${name} rated capacity"
    state_of_charge:
    name: "${name} state of charge"
    charging_cycles:
    name: "${name} charging cycles"
    state_of_health:
    name: "${name} state of health"
    port_voltage:
    name: "${name} port voltage"`
    can you help me?

Decode manufacturer info (`0x51`) frame

>>> "~200046510000FDAE\r"
<<< "~20004600C040313130312D5350313520020743414E50726F746F636F6C3A536F666172202020F046\r"

[16:11:22][D][uart_debug:158]: >>> "~200046510000FDAE\r"
[16:11:22][D][uart_debug:158]: <<< "~20004600C040313130312D5A4832362002062020202020202020202020202020202020202020F116\r"

[16:11:42][D][uart_debug:158]: >>> "~200046510000FDAE\r"
[16:11:42][D][uart_debug:158]: <<< "~20004600C040313130312D5A4832362002062020202020202020202020202020202020202020F116\r"

[16:12:02][D][uart_debug:158]: >>> "~200046510000FDAE\r"
[16:12:02][D][uart_debug:158]: <<< "~20004600C040313130312D5A4832362002062020202020202020202020202020202020202020F116\r"

[16:12:22][D][uart_debug:158]: >>> "~200046510000FDAE\r"
[16:12:22][D][uart_debug:158]: <<< "~20004600C040313130312D5A4832362002062020202020202020202020202020202020202020F116\r"
0x20      VER
0x00      ADR
0x46      CID1
0x00      CID2
0xC040    INFOLEN
0x313130312D5350313520: 1101-SP15
0x0207: 2.7
0x43414E50726F746F636F6C3A536F666172202020: "CANProtocol:Sofar   "
0xF046    CRC
0x20      VER
0x00      ADR
0x46      CID1
0x00      CID2
0xC040    INFOLEN
0x313130312D5A48323620 DeviceName ("1101-ZH26 ") (10 bytes) 
0x0206    SoftwareVersion "2.6" (2 bytes)
0x2020202020202020202020202020202020202020 ManufacturerName (20 bytes)
0xF116    CRC

Invalid Header

Hi,

I have an 10E version of the BMS SEPLOS V2 but i can't receive any data from RS485 bus.
I bought this boad :
and

I checked baudrates and it's 19200 like i need when i connect my laptop to the BMS and no problem when i do that.

I used pin D1 and D2 to solder TX, RX connector.
image

I downloaded debug logs, i don't know if there is something i can do now.
logs_seplos_logs (1).txt

CAN socket on latest Seplos revision has rs485

Thanks for the project! And the Neey balancer one! (And for the generous FOSS work overall <3).

I have the latest revision of the Seplos 200A 48V 16S BMS (if the seller didn't lie - I haven't disassembled the battery far enough to verify). That one supports RS485 on the CAN socket. Pins are 1&2 (A: green, B: orange), did not test 7/8. Ground is disconnected.

Maybe you want to reflect this in your docs? Should I open a PR?

(I'm not sure if that's advertised anywhere, but I just realized that it shouldn't work when comparing my setup with that of a friend; though the Seplos advertises only half the charging current and I'm afraid that's because it thinks the esp is another charger).

Temperature readings are wrong

The temperature for 6 sensors are note decoded correctly and is alwasy showing 30 degrees.
If I take output from UARTdebug
2000460010960001100CFF0CFE0D030D0C0CFD0D000D0A0D010CFD0D090D000CFD0CFD0D0A0CFD0D02060BCB0BC40BBF0BC00BEB0BDAFF8214CF31C50A426802ED4650006603E814D3000
The temperature sensor data is 060BCB0BC40BBF0BC00BEB0BDA
Decoding it gives me:

06 = 6 Sensors
0BCB 
(3019-2731)/10 = 28.8
0BC4 
(3012-2731)/10 = 28.1
0BBF 
(3007-2731)/10 = 27.6
0BC0 
(3008-2731)/10 = 27.7
0BEB 
(3051-2731)/10 = 32
0BDA
(3034-2731)/10 = 30.3

The values that I get are correct and this is what BMS is showing me. This means the decoding is not correct in the code.
Looking at the code it seems that you are missing substracting the initial value by 2731

  //   41     0x06           Number of temperatures           6                             V
  uint8_t temperature_sensors = data[offset];
  ESP_LOGV(TAG, "Number of temperature sensors: %d", temperature_sensors);

  //   42     0x0B 0xA6      Temperature sensor 1             2982 * 0.01f = 29.82          °C
  //   44     0x0B 0xA0      Temperature sensor 2             2976 * 0.01f = 29.76          °C
  //   46     0x0B 0x97      Temperature sensor 3             2967 * 0.01f = 29.67          °C
  //   48     0x0B 0xA6      Temperature sensor 4             2982 * 0.01f = 29.82          °C
  //   50     0x0B 0xA5      Environment temperature          2981 * 0.01f = 29.81          °C
  //   52     0x0B 0xA2      Mosfet temperature               2978 * 0.01f = 29.78          °C
  for (uint8_t i = 0; i < std::min((uint8_t) 6, temperature_sensors); i++) {
    this->publish_state_(this->temperatures_[i].temperature_sensor_,
                         (float) seplos_get_16bit(offset + 1 + (i * 2)) * 0.01f);
  }
  offset = offset + 1 + (temperature_sensors * 2);

Testing

Hi Syssi,
Great work on the project thus far. I tested your code on the Seplos BMS (15s) model 1101-ZH26 running Version 2.02. Connected to the WeMos via RS485.

I have attached my logs to help you advance your project. Look forward to upcoming changes and decoding on ESP8266 (if possible).

If you would like some assistance in testing and advancing this project further you may reach out.
logs_wemos-mini_upload.txt

Add mosfet control

Hi,

Can you add mosfet controll button in this implementations ?

Thank you,
Cristi

Decoding version 2.5 for bms TDT-6022

Hello and welcome.
I have a BMS as in the topic and it works with seplos ver2.0, but not everything is decoded correctly. Send data:
~25014642E00201FD30
answer:
~25014F4280800001 0E 0DD2 0DD2 0DD3 0DD3 0DCC 0DCC 0DCD 0DCD 0DCE 0DCF 0DCD 0DCE 0DCE 0DCE 06 0BE2 0BB1 0B9A 0B9A 0B9A 0BA2 0000 1354 395A 00 5B68 0000 5B68 133A 09BE 3F 0409 E092
bms is 14s. I have almost all the commands that are sent to the bms. If necessary, I can share the data. I have dump.pcap .
Please help.

Decode protocol version (`0x4F`) frame

Get protocol version ASCII 

Request:  ~2000464F0000FD9A\r
Response: ~260046000000FDAE\r
           ^^ protocol version 2.6

Request:  ~2000464F0000FD9A\r
Response: ~200046000000FDB4\r
           ^^ protocol version 2.0
0x20      VER
0x00      ADR
0x46      CID1
0x00      CID2
0x0000    INFOLEN
0xFDB4    CRC

Decode system parameters (`0x47`) frame

>>> "~200046470000FDA9\r"
<<< "~200046008152013C0DAC0D480B540BB80E420D480A280B540D1605DC151813BA10FE1194156313BA0F3C10FE189C17D40CD10C9F0ABF0ADD0D030C9F0A470AAB0CD10C9F0A470AC90D350C9F0A150AAB0AAB0B0F0CD10C9F0AAB0AC90D350CD10A470AAB0E2F0DFD0E930DFD2710251CD6FCD7C42AF8D5089E5807D0271013881B321E1E140A0F0A0A1E3C0505010A0A1EF0180F0560506409000D0008FFFFFF3FBF978F0F313130312D5A48323620B257\r"

>>> "~200046470000FDA9\r"
<<< "~200046008152013C0DAC0D480B540BB80E420D480A280B540D1605DC151813BA10FE1194156313BA0F3C10FE189C17D40CD10C9F0ABF0ADD0D030C9F0A470AAB0CD10C9F0A470AC90D350C9F0A150AAB0AAB0B0F0CD10C9F0AAB0AC90D350CD10A470AAB0E2F0DFD0E930DFD2710251CD6FCD7C42AF8D5089E5807D0271013881B321E1E140A0F0A0A1E3C0505010A0A1EF0180F0560506409000D0008FFFFFF3FBF978F0F313130312D5A48323620B257\r"

>>> "~200046470000FDA9\r"
<<< "~200046008152013C0DAC0D480B540BB80E420D480A280B540D1605DC151813BA10FE1194156313BA0F3C10FE189C17D40CD10C9F0ABF0ADD0D030C9F0A470AAB0CD10C9F0A470AC90D350C9F0A150AAB0AAB0B0F0CD10C9F0AAB0AC90D350CD10A470AAB0E2F0DFD0E930DFD2710251CD6FCD7C42AF8D5089E5807D0271013881B321E1E140A0F0A0A1E3C0505010A0A1EF0180F0560506409000D0008FFFFFF3FBF978F0F313130312D5A48323620B257\r"

>>> "~200046470000FDA9\r"
<<< "~200046008152013C0DAC0D480B540BB80E420D480A280B540D1605DC151813BA10FE1194156313BA0F3C10FE189C17D40CD10C9F0ABF0ADD0D030C9F0A470AAB0CD10C9F0A470AC90D350C9F0A150AAB0AAB0B0F0CD10C9F0AAB0AC90D350CD10A470AAB0E2F0DFD0E930DFD2710251CD6FCD7C42AF8D5089E5807D0271013881B321E1E140A0F0A0A1E3C0505010A0A1EF0180F0560506409000D0008FFFFFF3FBF978F0F313130312D5A48323620B257\r"
~200046008152013C0DAC0D480B540BB80E420D480A280B540D1605DC151813BA10FE1194156313BA0F3C10FE189C17D40CD10C9F0ABF0ADD0D030C9F0A470AAB0CD10C9F0A470AC90D350C9F0A150AAB0AAB0B0F0CD10C9F0AAB0AC90D350CD10A470AAB0E2F0DFD0E930DFD2710251CD6FCD7C42AF8D5089E5807D0271013881B321E1E140A0F0A0A1E3C0505010A0A1EF0180F0560506409000D0008FFFFFF3FBF978F0F313130312D5A48323620B257\r

Container: 
    CellHighVoltageLimit = 15.373
    CellLowVoltageLimit = 44.045
    CellUnderVoltageLimit = 18.443
    ChargeHighTemperatureLimit = 215.15
    ChargeLowTemperatureLimit = -184.18
    ChargeCurrentLimit = 169.09
    ModuleHighVoltageLimit = 18.442
    ModuleLowVoltageLimit = 10.251
    ModuleUnderVoltageLimit = 21.517
    DischargeHighTemperatureLimit = 56.37
    DischargeLowTemperatureLimit = -91.95
    DischargeCurrentLimit = 61.63

This doesn't look correct.

new code does not seem to work

I have not checked this for a while as my previous code was working as per #1.
Now I tried a new one https://github.com/syssi/esphome-seplos-bms/blob/main/esp8266-example.yaml but it does not work. My hardware has not changed so it is fine. Here are the things that do not look right to me:

  • the GPIOs are diferent should they not be tx_pin: GPIO1 rx_pin: GPIO3?
  • baudrate dropped from 19200 to 9600?

If I use the settings provided I get:

[20:45:11][D][uart_debug:158]: >>> "~20004642E00200FD37\r"

[20:45:13][D][uart_debug:158]: >>> "~20004642E00200FD37\r"

[20:45:15][D][uart_debug:158]: >>> "~20004642E00200FD37\r"

If I set GPIOs and baud rate the way it was I get

[20:41:15][D][uart_debug:158]: <<< "go7\xBF/�\xF7}\xBD\xB5u7\xB5\xB5\xFD\xFDuuo\xDF\xDF\xBA\xFC"
[20:41:15][D][uart_debug:158]: >>> "~20004642E00200FD37\r"
[20:41:15][W][seplos_modbus:086]: Invalid header.
[20:41:15][W][seplos_modbus:086]: Invalid header.
[20:41:15][W][seplos_modbus:086]: Invalid header.
[20:41:15][W][seplos_modbus:086]: Invalid header.
[20:41:15][W][seplos_modbus:086]: Invalid header.

Any ideas?

No response received

Hello,

i install the program on an ESP32 and try to use it with 3 batteries in parallel with V3.0 Seplos BMS. I tried with this yaml : https://github.com/syssi/esphome-seplos-bms/blob/main/esp32-seplos-v3-example-multiple-battery-banks.yaml to get only total voltage for starting but i already got this response in mqtt :
[0;36m[D][modbus_controller:043]: Modbus command to device=1 register=0x1000 countdown=0 no response received - removed from send queue[0m
[0;36m[D][modbus_controller:043]: Modbus command to device=2 register=0x1000 countdown=0 no response received - removed from send queue[0m
for each battery.

I try to change pin 1/2 with 7/8 but this has no effects. I saw the RS485 to TTL flashing led RXD and TXD but nothing on mqtt

Thank you for your response

Installation tutorial

Î already flashed the ESP via ESPHome and watched many youtube tutorial videos.
But how can i upload the Setting under "installation" to my ESP?
i am struggling here, can anyone help me or maybe link me to a suitable tutorial?
Via Python program and docker, or is there an easier way?
Sorry for all the noob questions.
Thank you.

Implement additional commands

CID2 Description
0x45 Telecontrol command
0x47 Acquisition of teleregulation information
0x49 Setting of teleregulation information
0x4F Acquisition of the communication protocol version number
0x51 Acquisition of device vendor information
0x4B Acquisition of historical data
0x4D Acquisition time
0x4E Synchronization time
0xA0 Production calibration
0xA1 Production setting
0xA2 Regular recording

https://github.com/Frankkkkk/python-pylontech/blob/master/pylontech/pylontech.py#L176-L207

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.