question

matthiasu avatar image
matthiasu asked

BMS: Some System parameters don't show up in the GUI

So I'm writing a BMS driver. I'm setting nice Dbus values:

# dbus -y com.victronenergy.battery.batt /System GetValue
{'MaxCellTemperature': 24.341449696978373,
 'MaxCellVoltage': 3.3502061086654664,
 'MaxTemperatureCellId': 4,
 'MaxVoltageCellId': 5,
 'MinCellTemperature': 21.298120999750154,
 'MinCellVoltage': 3.324489862728119,
 'MinTemperatureCellId': 0,
 'MinVoltageCellId': 0,
 'NrOfCellsPerBattery': 8,
 'NrOfModulesBlockingCharge': 0,
 'NrOfModulesBlockingDischarge': 0,
 'NrOfModulesOffline': 0,
 'NrOfModulesOnline': 1}
#

However, the cell IDs don't show up in the GUI:

screenshot-from-2022-08-06-21-38-54.pngAny ideas why that happens? I have verified with dbus-monitor that those IDs do get signalled:

signal time=1659814472.397015 sender=:1.296 -> destination=(null destination) serial=81 path=/; interface=com.victronenergy.BusItem; member=ItemsChanged
   array [
…
      dict entry(
         string "/System/MaxCellVoltage"
         array [
            dict entry(
               string "Value"
               variant                   double 3.35109
            )
            dict entry(
               string "Text"
               variant                   string "3.351V"
            )
         ]
      )
      dict entry(
         string "/System/MaxVoltageCellId"
         array [
            dict entry(
               string "Value"
               variant                   byte 5
            )
            dict entry(
               string "Text"
               variant                   string "5"
            )
         ]
      )

I tried changing the bytes to int16, or strings, doesn't matter.

BMS
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
fantail avatar image
fantail answered ·

the cell Ids as you call them are text strings in the web page and are not displayed if they have the wrong type . They must be defined as dbus strings and passed passed as strings. they work fine. you can define the text string as anything -- approx 8 char max text string

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

matthiasu avatar image matthiasu commented ·

What do you mean "as you call them"? Victron calls them that. Literally. "/System/MaxVoltageCellId".

Also, umm, sorry but you seem to have missed something: I did mention that sending the cell IDs as strings doesn't change anything. I just checked again.


      dict entry(
         string "/System/MaxVoltageCellId"
         array [
            dict entry(
               string "Value"
               variant                   string "5"
            )
            dict entry(
               string "Text"
               variant                   string "5"
            )
         ]
      )


0 Likes 0 ·
matthiasu avatar image matthiasu matthiasu commented ·

Anyway, [Page]BatteryDetails.qml doesn't appear to check for string-ness or anything, it just displays the text of the cell ID. Which I send in the same signal as the voltage (or temperature) in question and whose value isn't a string either but does get displayed.

0 Likes 0 ·
Louis van der Walt avatar image
Louis van der Walt answered ·

Cell ID is string value. That is why you do not see it in the UI.

Have a look at the dbus-serialbattery driver. It populates everything that is available in the GX display.

https://github.com/Louisvdw/dbus-serialbattery

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mike Dorsett avatar image Mike Dorsett commented ·

self._dbusservice['/System/MinVoltageCellId'] = None if min_cell is None else 'C' + str(min_cell + 1)

self._dbusservice['/System/MaxVoltageCellId'] = None if max_cell is None else 'C' + str(max_cell + 1)

Sending incorrect variable types by d-bus can really mess up the Victron GUI. asnoted above, the cell Id's need to be text.

ps the +1 for the cell value is because the code id's are zero based arrays.

0 Likes 0 ·
matthiasu avatar image matthiasu Mike Dorsett commented ·

*Sigh* I did say that sending the IDs as text didn't change anything.

Also (as I understand the GUI config files) nobody cares about the dbus value of these particular fields, it always displays the text.

NB, sometimes I randomly see one of the four cell IDs populated, despite the fact that I always update both the value and the ID.

0 Likes 0 ·
Mike Dorsett avatar image Mike Dorsett matthiasu commented ·
sending these from a dict array seems to be an overly complicated way of doing this. Sorry I missed the fine print, but last time I tried this using Louis' Dbus helper code, this all worked fine.
0 Likes 0 ·