Louisvdw / dbus-serialbattery

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

Show all Cells within the battery on console detail screen #68

Closed ddarek2000 closed 2 years ago

ddarek2000 commented 3 years ago

My current BMS can either be connected to BT or Serial connection to VenusOS. I get to see all cell voltages in BMS , but would like to have the BMS sending the low and high cell to the VenusOS to control charge / discharge of the battery.

I would like to display all 16 cells in the detail, and have this accessible using the Console.

I have decided to return my current BMS and replace with one that supports dual connection. This functionality would still be very useful for single connection devices.

Louisvdw commented 3 years ago

What benefit do you see in having all the cell voltages available vs. just the min/max cell voltages that VenusOS currently support? I know it will be nice to see. I am just trying to guage priority and if this is only a nice to have or has some benifit not currently available elsewhere.

ddarek2000 commented 3 years ago

The detail about batteries don't have concrete benefits. I find it is easier to see if the min/max when compared to the average. It is easier for me to interpret the state of each battery cell that way. Even with lower priority , I might take this one up on myself to complete.

Louisvdw commented 2 years ago

The Chargery BMS driver has support to display all the cells. The QML will need to be changed to add to the display (see gui\qml). In Victron land anything that is None will not be displayed, and this would be preferred as the driver support batteries with few to many cells (3-32 mostly). Also if we bring in the extra battery banks then this will complicate the display more. Something to keep in mind.

neoneddy commented 2 years ago

+1 .. one of the things I look a the most in the BMS app right now (about to actually connect this to Venus soon) is individual cell voltages. it let's you know if a particular cell is going rogue, or is it just .05v deviation from the rest.

With the QML, are you saying if someone wanted that data, just add the pointers / references in the QML and it will work?

Louisvdw commented 2 years ago

@neoneddy , The VenusOS only contain the min/max cell voltages. If you have a rogue cell you can see it as either the min or the max will have larger differenaces from the other. This is also there the BMS min/max cell graph come in.

However, if we would want to show all the cell voltages, then these will need to be populated as non standard extra fields on VenusOS, and we also need to create/edit a view to display them with the QML.

So no, it will not work only adding QML.

image

neoneddy commented 2 years ago

@Louisvdw Ok, makes sense. I think the min/max will work fine.

Jaco-TTT commented 2 years ago

Showing the Delta between the cells, can be a very useful visual indicator of a brewing problem.

piapiacz commented 2 years ago

@Louisvdw, I had the same need as @ddarek2000, so I added this feature. The pull request #87 is in queue. Updated files are : battery.py (making available individual cell voltages + cell balancing), dbushelper.py (publishing cell voltages to /Voltages/ and balancing to /Balances/), PageBattery.qml (added submenu for Cell Voltages, if available) and new file PageBatteryCellVoltages.qml. 4 cells are visible per line. When the cell is balancing the background on the cell turns red. Venus - Cell Voltages

neoneddy commented 2 years ago

This is awesome! I love the Red balancing background.

Jaco-TTT commented 2 years ago

@Louisvdw, I had the same need as @ddarek2000, so I added this feature. The pull request #87 is in queue. Updated files are : battery.py (making available individual cell voltages + cell balancing), dbushelper.py (publishing cell voltages to /Voltages/ and balancing to /Balances/), PageBattery.qml (added submenu for Cell Voltages, if available) and new file PageBatteryCellVoltages.qml. 4 cells are visible per line. When the cell is balancing the background on the cell turns red. Venus - Cell Voltages

What if one uses 18 cells on 48v system? Is that possible, today being the exception, slowly becoming a viable option between 16/17 and 18 cells.

piapiacz commented 2 years ago

@neoneddy thanks. I am just giving back to the community. @Jaco-TTT the backend publishes 24 cells, so all you need to do is to edit the gui file - /opt/victronenergy/gui/qml/PageBatteryCellVoltages.qml

after the line :

   property VBusItem _b16: VBusItem { bind: service.path("/Balances/Cell16") }

add :

   property VBusItem _b17: VBusItem { bind: service.path("/Balances/Cell17") }
    property VBusItem _b18: VBusItem { bind: service.path("/Balances/Cell18") }

after the line :

   property string c16: _b16.valid && _b16.text == "1" ? "#ff0000" : "#ddd"

add :

   property string c17: _b17.valid && _b17.text == "1" ? "#ff0000" : "#ddd"
    property string c18: _b18.valid && _b18.text == "1" ? "#ff0000" : "#ddd"

and after the :

       MbItemRow {
            description: qsTr("Cells (13/14/15/16)")
            values: [
                MbTextBlock { item { bind: service.path("/Voltages/Cell13") } width: 70; height: 25; color: c13 },
                MbTextBlock { item { bind: service.path("/Voltages/Cell14") } width: 70; height: 25; color: c14 },
                MbTextBlock { item { bind: service.path("/Voltages/Cell15") } width: 70; height: 25; color: c15 },
                MbTextBlock { item { bind: service.path("/Voltages/Cell16") } width: 70; height: 25; color: c16 }
            ]
        }

you need to add :

       MbItemRow {
            description: qsTr("Cells (17/18)")
            values: [
                MbTextBlock { item { bind: service.path("/Voltages/Cell17") } width: 70; height: 25; color: c17 },
                MbTextBlock { item { bind: service.path("/Voltages/Cell18") } width: 70; height: 25; color: c18 }
            ]
        }

the file can be edited using for example this command :

nano /opt/victronenergy/gui/qml/PageBatteryCellVoltages.qml
then you need to restart the gui using these commands :

svc -d /service/gui
svc -u /service/gui
Louisvdw commented 2 years ago

Nice work @piapiacz Thanks for sharing your changes. I'll review the PR as soon as I can

piapiacz commented 2 years ago

@Louisvdw ok, thanks.