question

Magnus Pernemark avatar image
Magnus Pernemark asked

Custom BMS driver - help preserve values in DBus

I am trying to do a custom BMS driver for a "dumb" BMS. The BMS has one way non-canbus communication and I can send data to Victron through DBus. Victron now knows the state of charge, voltage and temperature.

Now, I want to take it a step further. I want my driver to tell victron to reduce charging when voltage of an individual battery has hit its max, or when battery is about to hit max, reduce voltage.

I think I can do that by altering some DBus settings.

However, to my problem.

I need to set the limit alue manually in VenusOS GUI. Read those in my code and act upon them.


The question is: How to I make an input box in a qml file that preserves the value even efter a reboot.

I experimented with this

MbSpinBox {
description: qsTr("Stop discharge cell voltage")
bind: service.path("/Info/StopDischargeVoltage")
stepSize: 0.01
unit: "V"
writeAccessLevel: User.AccessUser
}

but on a restart of my program, the values are lost and default value of -1 is set

dbusservice.add_path('/Info/StopDischargeVoltage',   -1, writeable=True)


Where can I learn more about using values from GUI to interact with code?

Venus OS
2 |3000

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

0 Answers