question

stanhausc avatar image
stanhausc asked

How to open setting values in Venus OS interface?

I'm trying to configure the interface of a Venus GX and also a CCGX, the idea is for the user to be able to set the values de Charge Voltage Limit (CVL), Charge Current Limit (CCL)and Discharge Current Limit (DCL), as in the image below:

whatsapp-image-2021-07-26-at-161009-2.jpeg

I started by copying an example:

exemplo-set-value.png

In your QML file, it looks like this:

MbSpinBox {
id: minSocLimit
description: qsTr("Minimum SOC (unless grid fails)")
enabled: userHasWriteAccess
show: hub4Mode.value !== hub4Disabled && stateItem.value !== batteryKeepCharged
bind: Utils.path(batteryLifePath, "/MinimumSocLimit")
numOfDecimals: 0
unit: "%"
min: 0
max: 100
stepSize: 5
}

I'm at the very beginning of my studies, as you can see, and I tried as follows:

MbSpinBox {
id: maxChargeVoltage
description: qsTr("Charge Voltage Limit (CVL)")
enabled: userHasWriteAccess
show: valid && showSetting(0)
bind: service.path("/Info/MaxChargeVoltage")
numOfDecimals: 0
unit: "%"
min: 0
max: 100
stepSize: 0.5
}

Could someone please direct me to where I should go, I believe I'm missing the path of bind, show, and property that is at the beginning of the file:

property string bindPrefix
property string bindPage: "/Settings/Battery/"
property string cgwacsPath: "com.victronenergy.settings/Settings/CGwacs"
property string settingsPrefix: "com.victronenergy.settings"
property string batteryLifePath: cgwacsPath + "/BatteryLife"
// Hub4Mode
property int hub4PhaseCompensation: 1
property int hub4PhaseSplit: 2
property int hub4Disabled: 3
// BatteryLifeState
property int batteryLifeStateDisabled: 0
property int batteryLifeStateRestart: 1
property int batteryLifeStateDefault: 2
property int batteryLifeStateAbsorption: 3
property int batteryLifeStateFloat: 4
property int batteryLifeStateDischarged: 5
property int batteryLifeStateForceCharge: 6
property int batteryLifeStateSustain: 7
property int batteryLifeStateLowSocCharge: 8
property int batteryKeepCharged: 9
property int batterySocGuardDefault: 10
property int batterySocGuardDischarged: 11
property int batterySocGuardLowSocCharge: 12

property VBusItemCheckValid maxVoltageCellId: VBusItemCheckValid {
bind: Utils.path(bindPrefix, "/System/MaxVoltageCellId")
}
property VBusItem systemType: VBusItem { bind: "com.victronenergy.system/SystemType" }
property VBusItem gridSetpoint: VBusItem { bind: "com.victronenergy.settings/Settings/CGwacs/AcPowerSetPoint" }
property VBusItem maxChargePowerItem: VBusItem { bind: Utils.path(cgwacsPath, "/MaxChargePower") }
property VBusItem maxDischargePowerItem: VBusItem { bind: Utils.path(cgwacsPath, "/MaxDischargePower") }
property VBusItem socLimitItem: VBusItem { bind: Utils.path(batteryLifePath, "/SocLimit") }
property VBusItem minSocLimitItem: VBusItem { bind: Utils.path(batteryLifePath, "/MinimumSocLimit") }
property VBusItem stateItem: VBusItem { bind: Utils.path(batteryLifePath, "/State") }
property VBusItem hub4Mode: VBusItem { bind: Utils.path(cgwacsPath, "/Hub4Mode") }
property VBusItem maxChargeCurrentControl: VBusItem { bind: "com.victronenergy.system/Control/MaxChargeCurrent" }
property string bindPrefix
property string bindPage: "/Settings/Battery/"
property bool locked: lock.valid && lock.value
property string cgwacsPath: "com.victronenergy.settings/Settings/CGwacs"
property string settingsPrefix: "com.victronenergy.settings"
property string batteryLifePath: cgwacsPath + "/BatteryLife"
// Hub4Mode
property int hub4PhaseCompensation: 1
property int hub4PhaseSplit: 2
property int hub4Disabled: 3
// BatteryLifeState
property int batteryLifeStateDisabled: 0
property int batteryLifeStateRestart: 1
property int batteryLifeStateDefault: 2
property int batteryLifeStateAbsorption: 3
property int batteryLifeStateFloat: 4
property int batteryLifeStateDischarged: 5
property int batteryLifeStateForceCharge: 6
property int batteryLifeStateSustain: 7
property int batteryLifeStateLowSocCharge: 8
property int batteryKeepCharged: 9
property int batterySocGuardDefault: 10
property int batterySocGuardDischarged: 11
property int batterySocGuardLowSocCharge: 12

property VBusItem systemType: VBusItem { bind: "com.victronenergy.system/SystemType" }
property VBusItem gridSetpoint: VBusItem { bind: "com.victronenergy.settings/Settings/CGwacs/AcPowerSetPoint" }
property VBusItem maxChargePowerItem: VBusItem { bind: Utils.path(cgwacsPath, "/MaxChargePower") }
property VBusItem maxDischargePowerItem: VBusItem { bind: Utils.path(cgwacsPath, "/MaxDischargePower") }
property VBusItem socLimitItem: VBusItem { bind: Utils.path(batteryLifePath, "/SocLimit") }
property VBusItem minSocLimitItem: VBusItem { bind: Utils.path(batteryLifePath, "/MinimumSocLimit") }
property VBusItem stateItem: VBusItem { bind: Utils.path(batteryLifePath, "/State") }
property VBusItem hub4Mode: VBusItem { bind: Utils.path(cgwacsPath, "/Hub4Mode") }
property VBusItem maxChargeCurrentControl: VBusItem { bind: "com.victronenergy.system/Control/MaxChargeCurrent"

Does anyone have any idea how I should proceed, or where do I find information about it?

Thank you!

Venus OSmodifications
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
markus avatar image
markus answered ·

Hi @stanhausc

You can override the the CVL in DVCC menu. There you can set a charging amps limit too.
BR.
Markus

1 comment
2 |3000

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

markus avatar image markus ♦♦ commented ·
The values in your screenshot are the parameters your battery sends to the system via CANbus.



0 Likes 0 ·
stanhausc avatar image
stanhausc answered ·

Hi @Markus, thanks for the answer.

For your tip, I created a new interface, with CCL and CVL, as in the image below.

1629223493359.png

However, it did not work for DCl, See the QML:

import QtQuick 1.1
import "utils.js" as Utils

MbPage {
property VBusItem maxChargeCurrent: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/SystemSetup/MaxChargeCurrent")}
property VBusItem maxChargeVoltage: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/SystemSetup/MaxChargeVoltage")}
property VBusItem maxDischargeVoltage: VBusItem {bind: Utils.path("com.victronenergy.settings", "/Settings/SystemSetup/MaxDischargeCurrent")}


Component {
id: mbOptionLoader

MbOption {}
}

model: VisualItemModel {
MbItemText {
text: qsTr("<b>CUIDADO:</b> Leia o manual antes de ajustar")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignLeft
show: dvccSwitch.userHasWriteAccess
}
MbSwitch {
function edit() {
maxChargeCurrent.setValue(maxChargeCurrent.value < 0 ? 50 : -1)
}

id: maxChargeCurrentSwitch
name: qsTr("Charge Current Limit (CCL)")
checked: maxChargeCurrent.value >= 0
enabled: userHasWriteAccess
show: dvccSwitch.checked
}

MbSpinBox {
id: startValue
description: qsTr("Charge Current Limit (CCL)")
bind: maxChargeCurrent.bind
unit: "A"
numOfDecimals: 0
stepSize: 1
min: 0
show: maxChargeCurrentSwitch.show && maxChargeCurrentSwitch.checked
}
MbSwitch {
function edit() {
maxDischargeCurrent.setValue(maxDischargeCurrent.value === 0 ? 50 : -1)
}

id: maxDischargeCurrentSwitch
name: qsTr("Discharge Current Limit (DCL)")
checked: maxDischargeCurrent.value >= 0
enabled: userHasWriteAccess
show: dvccSwitch.checked
}

MbSpinBox {
description: qsTr("Discharge Current Limit (DCL)")
bind: maxDischargeCurrent.bind
unit: "A"
numOfDecimals: 0
stepSize: 1
show: maxDischargeCurrentSwitch.show && maxDischargeCurrentSwitch.checked
}

MbSwitch {
function edit() {
maxChargeVoltage.setValue(maxChargeVoltage.value === 0.0 ? 55.0 : 0.0)
}

id: maxChargeVoltageSwitch
name: qsTr("Charge Voltage Limit (CVL)")
checked: maxChargeVoltage.value > 0
enabled: userHasWriteAccess
show: dvccSwitch.checked
}

MbSpinBox {
description: qsTr("Charge Voltage Limit (CVL)")
bind: maxChargeVoltage.bind
unit: "V"
numOfDecimals: 1
stepSize: 0.1
show: maxChargeVoltageSwitch.show && maxChargeVoltageSwitch.checked
}

}
}

Any suggestions, why the DCL doesn't work?



1629223493359.png (25.8 KiB)
1 comment
2 |3000

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

markus avatar image markus ♦♦ commented ·

If your ESS is running under „external control“ the DCL is ignored as far as I know.

I am no good programmer, so unfortunately I can’t really help you with your code.

0 Likes 0 ·

Related Resources

Victron Venus OS Open Source intro page

Venus OS GitHub (please do not post to this)

Experiments, Modifications and Adaptions. Mods (Modifications) can be made to Victron Software by the Community. Please use the modifications space for enthusiasts who want to push what is possible, without official Victron Support.