Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create option to add custom name / keep name after reboot #100

Closed
Louisvdw opened this issue Mar 2, 2022 · 25 comments
Closed

Create option to add custom name / keep name after reboot #100

Louisvdw opened this issue Mar 2, 2022 · 25 comments
Labels
enhancement New feature or request

Comments

@Louisvdw
Copy link
Owner

Louisvdw commented Mar 2, 2022

Create option to add custom name.
This is useful if there are more than one BMS so you can name them to easily identify

@Louisvdw Louisvdw added the enhancement New feature or request label Mar 2, 2022
@pedrorampolla
Copy link

Any updates? I’m willing to help in testing; I have 3 JBD BMS.

@Louisvdw
Copy link
Owner Author

Louisvdw commented Oct 4, 2022

image
image

Should be in the next beta

@mr-manuel
Copy link
Collaborator

I think before this can be addresses, the pairing of the DeviceInstance and the serial to USB adapter has to be overthinked. Actually there is no unique value from where a specific BMS can be identified, if multiple BMS are connected from the same make. If then the DeviceInstance changes because the ID of the serial to USB adapter changes, than the mess is complete.

Maybe a possible solution would be to assign a device ID by serial number of the BMS. This would require:

  1. Extending all existing battery classes to read the serial number (biggest work)
  2. Checking, if the DeviceInstance is already in use
  3. Save the assigned pair of DeviceInstance and serial number somewhere, probably in the dbus
  4. Delete an assigned pair, if the BMS is not seen for x days (if needed)

@mr-manuel
Copy link
Collaborator

An easier way to identify batteries could be the battery capacity. It should not matter, if you have 10 batteries and change the battery by +/-5Ah to have an unique total capacity.

@teefixx
Copy link

teefixx commented Apr 15, 2023

good idea
Tried this, but didn‘t work for daly, as, at least at my test, the capacity was not read out :-(

@mr-manuel
Copy link
Collaborator

@teefixx thats true. Some Daly don't provide this value. Is there any other data we can use from daly to create a unique identifier?

@teefixx
Copy link

teefixx commented Apr 15, 2023

Did not find one...
Anyway... thanks for your help. If I solve it I'll male a post for ither users, which have probably the same oroblem.

@mr-manuel
Copy link
Collaborator

mr-manuel commented May 3, 2023

@teefixx with the latest nightly Daly also provides this value.

@teefixx
Copy link

teefixx commented May 3, 2023

@mr-manuel got it already, installed your nightly ble branch.

thank you

@transistorgit
Copy link
Contributor

just read this again.
for my daly, there is a battery production date field that can be set by daly app.
I added it to the hardware version string. So you can use different dates for your batteries to mark them. maybe better than adjust capacity?
image

@mr-manuel
Copy link
Collaborator

Sure! Is this field empty by default?

@transistorgit
Copy link
Contributor

hm, cant remember...

@transistorgit
Copy link
Contributor

at least I set it myself to the date I built my battery... so it should be usable.
If someone wants to try: mr-manuel/venus-os_dbus-serialbattery#5

@mr-manuel
Copy link
Collaborator

It's now in the latest jkbms_ble branch. Custom BMS fields for Daly (battery code field) and JK BMS (User Private Data field) are shown on the "GUI -> SerialBattery -> Device" page as "Device Name".

@seamaster101
Copy link

@mr-manuel I understand that you guys fixed that one, but I tested again after update to V 1.0.0-jkbms_ble (20230505)
image
still reverts to the default name after reboot
image
what could be causing that?

@mr-manuel
Copy link
Collaborator

It's not fixed. But the value that you insert in "User Private Data field" in the JKBMS app is shown in the device page.

@gurkc006
Copy link

gurkc006 commented Jun 7, 2023

Only to be shore not missing something: I updated to Version 1.0.20230531. The custom name still doesn't seem to be saved correct, is that right? After reboot I still see the default name. Any idea, when this will be fixed? Can I help with debugging?
Thanks

@mr-manuel
Copy link
Collaborator

Since this is not that easy as it seams, it will take time. There are a few options to set the name via Node-RED for example, so it will persist reboot and Venus OS update, but not if the VRM ID changes, which is currently the biggest issue.

@mr-manuel mr-manuel changed the title Create option to add custom name Create option to add custom name / keep name after reboot Jun 10, 2023
mr-manuel added a commit to mr-manuel/venus-os_dbus-serialbattery that referenced this issue Jun 10, 2023
@mr-manuel
Copy link
Collaborator

mr-manuel commented Jun 10, 2023

Please try the nightly from the dev branch with all possible setups you have. The name currently is fixed to the port. If the port changes, the name disappears or the wrong one is loaded.

For this I added an unique identifier, which is displayed in the driver logs and in the remote console/GUI under Device -> Serial. Please check, if this value is different, if you have multiple BMS. If the value is not different, please increase/decrease the installed capacity on your BMS by 1 until all BMS have another capacity. In this way you can have 11 unique batteries with a deviation of +/- 5 Ah.

See this page on how to install.

@gurkc006
Copy link

Hi mr-manuel,
thanks a lot for the new beta version. I tested you new version (but I only have one BMS) and it works quite well. Assigned a new name, rebooted and name still ok. So for me that's fine now! Serial number says "Battery1_JK-B2A24S15P". If you need any other information, leave me a message. Thanks!!!

@mr-manuel
Copy link
Collaborator

This is all I need, thanks

@mr-manuel
Copy link
Collaborator

Is there no other feedback for this most wanted feature?

@mr-manuel
Copy link
Collaborator

This is included in the latest beta and will be in the next stable release.

@lfhoward

This comment was marked as off-topic.

@mr-manuel

This comment was marked as off-topic.

Louisvdw pushed a commit that referenced this issue Nov 25, 2023
* Update reinstall-local.sh: Fixed charge current parameter

Update reinstall-local.sh: Corrected charge current parameter for  initial config.ini

* Exclude devices from driver startup
This prevents blocking the serial port

* implement callback function for update

* fix comments to reflect new logic

* update changelog

* set soc=100% when charge mode changes to float, apply exponential smoothing on current readout

* remove scan for devices

the scan for devices and check if the BMS to test is present doesn't add value
if the device is not within range (or the MAC is wrong), then the subsequent start_scraping call will either fail or fail to produce usable data

* JKBMS_BLE driver fixes

* added Bluetooth signal strenght, increased debug

* Optimized reinstallation procedure
- Changed: Optimized restart sequence for the bluetooth installation
- Changed: Run serial part first and then bluetooth part. This allows the serial driver to get operative faster
- Removed: $DRIVERNAME variable for clearer paths
- Removed: Bluetooth system driver restart, since the devices get disconnected by the service before starting the dbus-serialbatterydriver

* Improved Jkbms_Ble error handling

* optimized disable procedure

* small fixes

* save custom name and make it restart persistant
#100

* changed unique identifier from string to function
function can be overridden by BMS battery class

* fix typo

* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: Manuel <[email protected]>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

---------

Co-authored-by: Holger Schultheiß <[email protected]>
Co-authored-by: Stefan Seidel <[email protected]>
Co-authored-by: Bernd Stahlbock <[email protected]>
Co-authored-by: seidler2547 <[email protected]>
Co-authored-by: ogurevich <[email protected]>
Co-authored-by: wollew <[email protected]>
Co-authored-by: Oleg Gurevich <[email protected]>
Co-authored-by: peterohman <[email protected]>
Co-authored-by: Strawder, Paul <[email protected]>
Co-authored-by: Paul Strawder <[email protected]>
Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: Samuel Brucksch <[email protected]>
Co-authored-by: ArendsM <[email protected]>
Co-authored-by: Meik Arends <[email protected]>
ppuetsch pushed a commit to ppuetsch/dbus-serialbattery that referenced this issue Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants