Louisvdw / dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
MIT License
541 stars 165 forks source link

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

Closed Louisvdw closed 1 year ago

Louisvdw commented 2 years ago

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

pedrorampolla commented 2 years ago

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

Louisvdw commented 2 years ago

image image

Should be in the next beta

mr-manuel commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

mr-manuel commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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

teefixx commented 1 year ago

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

thank you

transistorgit commented 1 year ago

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 commented 1 year ago

Sure! Is this field empty by default?

transistorgit commented 1 year ago

hm, cant remember...

transistorgit commented 1 year ago

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

mr-manuel commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

This is all I need, thanks

mr-manuel commented 1 year ago

Is there no other feedback for this most wanted feature?

mr-manuel commented 1 year ago

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

lfhoward commented 1 year ago

Hello @mr-manuel,

Thanks for the nightly version. I completed the installation using (3) nightly and (2) dev. I then rebooted the system.

Unfortunately Venus cannot see the BMS anymore. It is not in the device list.

Should I have uninstalled the previous version before reinstalling the beta version over it? Or is there a setting I need to change once it boots? What am I missing?

Thanks

EDIT: I tried adding BMS_TYPE = LltJbd to config.ini in case the BMS was disabled, but it did not help. I followed these instructions for Driver version >= v1.0.20230611beta "Add your BMS to the setting BMS_TYPE in the config.ini. This way you don't have to enable your BMS after every update."

EDIT#2: After a few hours the BMS showed up in the device list! I was able to rename it. Thank you, I think it has now worked.

mr-manuel commented 1 year ago

Should I have uninstalled the previous version before reinstalling the beta version over it? Or is there a setting I need to change once it boots? What am I missing?

No, an uninstallation is not needed before updating.

Please check the issues, there you see that there are currently problems with the latest nightly and LLT/JBD BMS. Try the latest beta.