GithubHelp home page GithubHelp logo

syssi / esphome-lolan-bms Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 159 KB

ESPHome component to monitor a Lolan Battery Management System via BLE

License: Apache License 2.0

Python 40.82% C++ 59.00% Shell 0.19%
bluetooth esphome esphome-component

esphome-lolan-bms's Introduction

esphome-lolan-bms

GitHub actions GitHub stars GitHub forks GitHub watchers "Buy Me A Coffee"

ESPHome component to monitor a Lolan Battery Management System via BLE

Supported devices

  • Lolan Smart BMS, 20240511003, 8S 45A advertised via BLE as LOLAN8S45A

Requirements

Installation

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

external_components:
  - source: github://syssi/esphome-lolan-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-lolan-bms.git
cd esphome-lolan-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
esphome run esp32-example.yaml

Example response all sensors enabled

TBD.

Protocol

TBD.

Known issues

None.

Debugging

If this component doesn't work out of the box for your device please update your configuration to increase the log level to see details about the BLE communication and incoming traffic:

logger:
  level: VERY_VERBOSE
  logs:
    esp32_ble: DEBUG
    esp32_ble_tracker: VERY_VERBOSE
    lolan_bms_ble: VERY_VERBOSE
    scheduler: DEBUG
    component: DEBUG
    sensor: DEBUG
    mqtt: INFO
    mqtt.idf: INFO
    mqtt.component: INFO
    mqtt.sensor: INFO
    mqtt.switch: INFO
    api.service: INFO
    api: INFO
    api: INFO

References

None.

esphome-lolan-bms's People

Contributors

syssi avatar

Stargazers

Cen Linze avatar

Watchers

 avatar

esphome-lolan-bms's Issues

Add CRC check of the settings frame

CRC16 polynom:

[
  0, 50585, 52907, 2866, 55503, 7510, 5732, 54269, 62471, 12702, 15020, 65333, 
  11464, 59729, 57955, 10234, 44439, 26638, 25404, 42661, 30040, 45249, 48115, 
  32362, 22928, 39945, 38715, 21154, 33119, 17606, 20468, 35437, 23342, 40631, 
  38277, 20508, 33761, 18040, 19786, 35027, 44841, 27312, 24962, 42011, 30694, 
  45695, 47437, 31956, 63161, 13088, 14354, 64907, 11894, 60399, 57565, 9540, 
  702, 50983, 52245, 2444, 55921, 8168, 5338, 53571, 62405, 13916, 15726, 63735, 
  11018, 61075, 58785, 8248, 1986, 49755, 51561, 3312, 57101, 6804, 4518, 54335, 
  24146, 39883, 37113, 21856, 34461, 17156, 18486, 36271, 43605, 28620, 25854, 
  41319, 29338, 46851, 48177, 31144, 43243, 28018, 26176, 41945, 28708, 46525, 
  48783, 31510, 23788, 39285, 37447, 22494, 33827, 16826, 19080, 36625, 1404, 
  49381, 52183, 3662, 56755, 6186, 4888, 54913, 61819, 13538, 16336, 64073, 10676, 
  60461, 59167, 8838, 41491, 26506, 27832, 43297, 31452, 48965, 46199, 29166, 
  22036, 37773, 39103, 23846, 36571, 19266, 16496, 34281, 3972, 51741, 49455, 
  1206, 55115, 4818, 6624, 56441, 64387, 15898, 13608, 61617, 9036, 59093, 60903, 
  10366, 63805, 15524, 14230, 61967, 8690, 58475, 61273, 10944, 3386, 51363, 
  50065, 1544, 54773, 4204, 7006, 57031, 21674, 37171, 39425, 24472, 35941, 18940, 
  17102, 34647, 41133, 25908, 28166, 43935, 30818, 48635, 46793, 29520, 20950, 
  37967, 40829, 23268, 35097, 19584, 18354, 33323, 42449, 24648, 27514, 44771, 
  32030, 47239, 46005, 30252, 64577, 14808, 13034, 63347, 9358, 57623, 59941, 
  12220, 2118, 52703, 50925, 884, 53385, 5392, 7714, 56251, 2808, 53089, 50259, 
  458, 53815, 6062, 7324, 55557, 65279, 15206, 12372, 62925, 9776, 58281, 59547, 
  11522, 42863, 25334, 27076, 44125, 32672, 47673, 45323, 29842, 21352, 38641, 
  40387, 22618, 35751, 20030, 17676, 32917
];

Add switch entities to control the mosfets

D8:D8 + Password      Charging Switch on
D9:D9 + Password      Charging Switch off

85:85 + Password       Discharging switch on
86:86 + Password       Discharging switch off
860000bc614e , turn off discharge
855500bc614e , turn on discharge
d88800bc614e , turn on charge
d90000bc614e , turn off charge

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.