syssi / esphome-pace-bms

ESPHome component to monitor and control a PACE Battery Management System (PACE-BMS) via RS485 (Modbus)
Apache License 2.0
23 stars 6 forks source link

Wrong Bitmask for status charging and discharging #20

Closed ThHanika closed 1 month ago

ThHanika commented 7 months ago

please correct your code example esp32-example.yaml :

binary_sensor:
  #  11  Status/Fault flag                     2 byte   R  uint16  Hex See ^3
  #      Bit 8: Status: Charging enabled/disabled
  - platform: modbus_controller
    modbus_controller_id: bms0
    name: "${name} charging"
    address: 11
    register_type: holding
    bitmask: 0x0100

  #      Bit 9: Status: Discharging enabled/disabled
  - platform: modbus_controller
    modbus_controller_id: bms0
    name: "${name} discharging"
    address: 11
    register_type: holding
    bitmask: 0x0200

BTW: This status is a working status. For enabled charging/discharging it is a better choice to use MOSFET-status

Your Example is tested and worked on Pace BMS P16S200A Firmwareversion 3.0 Full Version(Evaluated by esp32-example.yaml): P16S200A-21382-3.00T213822131800670H

syssi commented 7 months ago

Thanks for your feedback! Do you like to provide a pull request to contribute your improvement?

ThHanika commented 7 months ago

OK, I clone your project

syssi commented 1 month ago

Sorry for the delay. I've merged your contribution because it's already an improved. It can be polished over time.