• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

YamBMS JK-BMS-CAN with new Cut-Off Charging Logic (open-source)

@Sleeper85

I would be grateful for an explanation how to drop the lower range of bulk and float?
I tried changing 'min_value' and recompiling, but the previous values remain in HA.
As it turns out, without the Lux SNA built-in functionality to export from the battery, I can achieve some battery export by lowering these values below the current battery levels.
1741274554342.png

And some ideas for improvement. Is it possible to:
  • display the current countdown status of 'bms_cutoff_timer' and 'yambms_cutoff_timer' in HA dashboard?
  • create a switch that forces the system into float mode? Similar to 'Force Bulk (top bal)'?
 
@Sleeper85

I would be grateful for an explanation how to drop the lower range of bulk and float?
I tried changing 'min_value' and recompiling, but the previous values remain in HA.
As it turns out, without the Lux SNA built-in functionality to export from the battery, I can achieve some battery export by lowering these values below the current battery levels.
View attachment 282844

And some ideas for improvement. Is it possible to:
  • display the current countdown status of 'bms_cutoff_timer' and 'yambms_cutoff_timer' in HA dashboard?
  • create a switch that forces the system into float mode? Similar to 'Force Bulk (top bal)'?
I like these ideas.

Cut off timer countdown would be great to know if it's reseting
 
@Sleeper85

I would be grateful for an explanation how to drop the lower range of bulk and float?
I tried changing 'min_value' and recompiling, but the previous values remain in HA.
As it turns out, without the Lux SNA built-in functionality to export from the battery, I can achieve some battery export by lowering these values below the current battery levels.
View attachment 282844

And some ideas for improvement. Is it possible to:
  • display the current countdown status of 'bms_cutoff_timer' and 'yambms_cutoff_timer' in HA dashboard?
  • create a switch that forces the system into float mode? Similar to 'Force Bulk (top bal)'?

Min/max values are defined at the top of the YAML in this section depending on the chemistry used.

YAML:
# Execute once
esphome:
  on_boot:
    then:
      - lambda: |-
          //
          // Source : https://batteryuniversity.com/article/bu-216-summary-table-of-lithium-based-batteries
          //
          if (${yambms_battery_chemistry} == 1) // LFP
          {
            // LFP
            id(${yambms_id}_cell_mominal_v) = 3.20;
            id(${yambms_id}_cell_min_charge_v) = 3.37; // Fully charged at rest
            id(${yambms_id}_cell_max_charge_v) = 3.65;
            id(${yambms_id}_cell_max_discharge_v) = 3.00; // Not used
          }
          else if (${yambms_battery_chemistry} == 2) // Li-ion
          {
            // Li-ion
            id(${yambms_id}_cell_mominal_v) = 3.60;
            id(${yambms_id}_cell_min_charge_v) = 3.90;
            id(${yambms_id}_cell_max_charge_v) = 4.20;
            id(${yambms_id}_cell_max_discharge_v) = 3.20; // Not used
          }
          else if (${yambms_battery_chemistry} == 3) // LTO
          {
            // LTO
            id(${yambms_id}_cell_mominal_v) = 2.40;
            id(${yambms_id}_cell_min_charge_v) = 2.55; // Fully charged at rest
            id(${yambms_id}_cell_max_charge_v) = 2.85;
            id(${yambms_id}_cell_max_discharge_v) = 2.00; // Not used
          }
          int cell_count = ${yambms_cell_count};
          // Bulk V.
          id(${yambms_id}_bulk_voltage).traits.set_min_value(round(cell_count * id(${yambms_id}_cell_min_charge_v) * 10) / 10);
          id(${yambms_id}_bulk_voltage).traits.set_max_value(round(cell_count * id(${yambms_id}_cell_max_charge_v) * 10) / 10);
          // Float V.
          id(${yambms_id}_float_voltage).traits.set_min_value(round(cell_count * (id(${yambms_id}_cell_min_charge_v) - 0.1) * 10) / 10);
          id(${yambms_id}_float_voltage).traits.set_max_value(round(cell_count * (id(${yambms_id}_cell_min_charge_v) + 0.1) * 10) / 10);
          // Rebulk V.
          id(${yambms_id}_rebulk_voltage).traits.set_min_value(round(cell_count * id(${yambms_id}_cell_mominal_v) * 10) / 10);
          id(${yambms_id}_rebulk_voltage).traits.set_max_value(round(cell_count * id(${yambms_id}_cell_min_charge_v) * 10) / 10);
 
Is it possible to connect Victron Smarthunt to this duo via UART? If I remember correctly, it requires soldering an additional wire. But I can't find where the details are
 

Attachments

  • Solution_M5stack_AtomS3_CAN_base_RS485_unit.png
    Solution_M5stack_AtomS3_CAN_base_RS485_unit.png
    1.6 MB · Views: 1
Hi, I have a problem compiling Lilygo t-can485.

can some help me?

INFO ESPHome 2025.2.2
INFO Reading configuration /config/esphome/yambms.yaml...
INFO Updating https://github.com/Sleeper85/esphome-components.git@main
INFO Detected timezone 'Europe/Berlin'
Failed config

light.esp32_rmt_led_strip: [source /config/esphome/packages/board/board_ESP32_LilyGo-T-CAN485.yaml:76]
platform: esp32_rmt_led_strip
id: esp_light
rgb_order: GRB
pin: 4
num_leds: 1

This feature is not available for the IDF framework version 5.
rmt_channel: 0
chipset: ws2812
entity_category: config
default_transition_length: 0ms
 
Normally, it should be sufficient to solder only GND and TX from the shunt to the CAN board, correct? Since the VE.Direct of the SmartShunt operates at 3.3V, it should work without issues—unless I’m overlooking something?

Yes maybe, I don't have a Smartshunt to confirm it 100% but I think I've already read that somewhere.
 
When i have 4 JK PB2A16S20P inverter bms, is it correct understod it only need one RS485 to one batteri and get that way from the other batteries
 
Sleeper85, The algorithm for calculating SOC when using multiple batteries with different capacities can be improved. The current method based on the average formula gives overly optimistic values when using battery sets with varying capacities..

Example:
  • Current algorithm: (73%+72%+50%+43%) / 4 = 59%
  • Algorithm accounting for battery capacities: (0.73*136ah+0.72*136ah+0.50*304ah+0.43*304ah)/(136ah*2+304ah*2) = 55%
1741767954505.png

I would appreciate feedback on the possibility of implementing these options:
  • display the current countdown status of 'bms_cutoff_timer' and 'yambms_cutoff_timer' in HA dashboard?
  • create a switch that forces the system into float mode? Similar to 'Force Bulk (top bal)'?
 
Last edited:
Sleeper85, The algorithm for calculating SOC when using multiple batteries with different capacities can be improved. The current method based on the average formula gives overly optimistic values when using battery sets with varying capacities..

Example:
  • Current algorithm: (73%+72%+50%+43%) / 4 = 59%
  • Algorithm accounting for battery capacities: (0.73*136ah+0.72*136ah+0.50*304ah+0.43*304ah)/(136ah*2+304ah*2) = 55%
View attachment 284234

I would appreciate feedback on the possibility of implementing these options:
  • display the current countdown status of 'bms_cutoff_timer' and 'yambms_cutoff_timer' in HA dashboard?
  • create a switch that forces the system into float mode? Similar to 'Force Bulk (top bal)'?


1) Regarding the SoC average calculation, I will analyze that.
2) Regarding the timers, seeing the countdown would be something complicated to do, if I take a 60s counter it would be necessary to cut it into 60 1s counters and update a sensor between each delay.
3) For Force Float you can do it by importing the yambms_custom.yaml that I just uploaded to Github.


1741780191114.png
 
@Sleeper85 I'm still running v1.5.1 over BLE with Victron shunt using Atom S3/display. Not having any issues. Are there any major improvements using the latest version? Looking for a reason to upgrade.
 
Last edited:
@Sleeper85 I'm still running v1.5.1 over BLE with Victron shunt using Atom S3/display. Not having any issues. Are there any major improvements using the latest version? Looking for a reason to upgrade.

Only if you want or need to take advantage of the latest changes.

Markdown (GitHub flavored):
* YamBMS 1.5.4 :
  * New low SoC corrected at each BMS level (the corrected SoC is the one transmitted to YamBMS)
  * New BMS dashboard
  * New end of charge logic at each BMS level, the charge switch turns off when the cells are equalized (disabled by default)
  * Fixed `errors_bitamsk` for JK-PB RS485, test OK with YamBMS (forked component)
* YamBMS 1.5.3 :
  * Broadcasting JK-PB settings to all BMS set to OFF by default
  * Reorganizing the `board` folder and YAMLs (device_base.yaml moved to board.yaml)
  * `device_base.yaml` should no longer be part of `YamBMS_main.yaml`
  * New `RGB LED status` light effects (red, green, blue, cyan) as an `options` packages for `board.yaml`
  * Increased CPU frequency to `240Mhz` as an `options` packages for `board.yaml`
  * Added `ESP32 Generic`, `LilyGo T-CAN485`, `LilyGo T-Connect` and `XIAO` boards
  * Fixed SoC logic (low SoC will be detected at BMS level and no longer at YamBMS level)
  * Simplified combination logic (removal of the combine switch) + dashboard update
  * Check `Battery Capacity` is `> 0` before combining info (see [issue #14](https://github.com/Sleeper85/esphome-yambms/issues/14))
  * Improved alarm logic with a common `YamBMS errors bitmask` for all BMS models (see OTP vs UTP bug reported by @ChrisG)
  * Added [PR #7547](https://github.com/esphome/esphome/pull/7547) regarding publishing entities via the API
  * Removed `captive_portal` because it increases the `loop time` too much
  * `PSRAM` will no longer be enabled by default as this has a bad impact on `BLE BMS`
* YamBMS 1.5.2 :
  * Added shunt `Online Status` binary_sensor
  * Shunt combine condition based on the new binary_sensor `Online Status`
  * Logger `baud_rate: 0` by default (frees the 3rd UART and avoids some bugs like "WK2168 with canbus" or "BLE client with RS485 modbus")
  * Changed names of `bms` and `shunt` YAMLs for modbus `multi-node` solution
  * Added shared configuration file to simplify main YAML (centralization of parameters)
  * Simplification (fewer options) when importing `BMS / Shunt` YAMLs
  * New `multi-node` solution using `RS485 modbus` to communicate information to YamBMS
  * New board `espBerry` with `2-CH-CAN HAT`
 
3) For Force Float you can do it by importing the yambms_custom.yaml that I just uploaded to Github.
Thanks. Tested. Charging status didn't change to float despite active "Force Float" switch.
1741792024147.png

Update: I edited the conflicting rebulk values, and now everything works. Float is activating 🙏.
 
Last edited:

diy solar

diy solar
Back
Top