question

matt1309 avatar image
matt1309 asked

Looking for example of custom device settings

Hi Folks,

I've been digging around the Victron github pages in the hopes of creating my own custom settings menu in venus os. I can see snips of python code examples but wondered how people tend to implement that in amongst other code/drivers or if anyone had an example of something similar/best practices.


GitHub - victronenergy/localsettings: D-Bus settings manager that interfaces between xml file on disk and D-Bus


I've dabbled with adding dummy drivers but only for devices that already exist (tanks/temp sensors) in the past and populating the data via mqtt but nothing that required a settings menu be made.


My reason for asking:

I want to add further settings for EVCS, currently i have the additional features i want setup in node red, but it's a bit of a pain explaining to family which flows to edit to change said criteria, plus I'd quite like a project to help learn the ins and outs of venus os more. (I find with a project I learn better/dont give up as easy).


Settings for my dummy EVCS_addon:

"auto mode down to SoC": yes/no

"min SoC": 0-100%

"charge_current_setting": 6-32


I was hoping to read those settings in a dummy driver template and if auto mode down to SoC is enabled then the EVCS will work as auto mode normally does however rather than using excess power use battery down to min SoC.


Pseudo Code:

I need to work out an IF for normal auto mode as I'll prefer to use that when excess solar is available.

Then if not excess solar but battery SoC is above min set in settings above I'd put the below pseudo code in mainloop


if (SoC > min SoC) && (auto mode down to SoC enabled) {

if (Loads < max inverter output) {

set EVCS amps = min(loads - max inverter output, charge_current_setting)

turn on EVCS charging

}else{

turn off EVCS

}

}else if (auto mode down to CS enabled) {

turn off EVCS

}

And loop the above if statements so that EVCS adjusts as loads move, until Min SoC reached.



evcsdriverpythonlocalsettingsvelib
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

Related Resources

Additional resources still need to be added for this topic