Jump to content

External Control scripts for Victron ESS program


Guest

Recommended Posts

Hi Blue Team, please could someone assist me. I'd like to set the Victron Multiplus 3KVA SOC value every hour (see Fig a below)

My questions are

 

Fig a

100                                                                     x

90                                                                  x       

80                                                             x             x

70                                                                                 x

60                                                        x                            x

50                                                                                           x   x   x                      

40                                                   x                                                     x   x   x

30 x   x   x    x                            x                                                                      

20                     x   x   x    x   x                                                                       

10                                                                                                                      

     01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

 

 

Link to comment
Share on other sites

11 minutes ago, EDP said:

Hi Blue Team, please could someone assist me. I'd like to set the Victron Multiplus 3KVA SOC value every hour (see Fig a below)

Just write it to /Soc on the vebus service. Eg:

dbus -y com.victronenergy.vebus.ttyO1 /Soc SetValue 55

The above assumes you're running a CCGX, otherwise the service name will differ. Eg on a venus-gx it's on ttyO5, on a raspberry pi it will be on some ttyUSB port.

The other option is to fake a battery monitor. If you have a BMV or a battery with a BMS, the CCGX will sync the Soc of the multi with whatever the battery says. You can select a battery service under System Setup on the CCGX (usually you set it to Auto and it selects the first battery service). You can hook into this and write your own battery service, and the CCGX will automatically sync the Soc with the rest of the system.

For example python scripts, see here:

https://github.com/victronenergy/dbus-systemcalc-py/blob/master/scripts/dummybattery.py

There is also this one that proxies another battery service, but allows adding paths, I sometimes use this to turn a plain battery into a fake BMS:

https://github.com/victronenergy/dbus-systemcalc-py/blob/master/scripts/proxybattery.py

I hope that helps.

Link to comment
Share on other sites

Hi Plonkster, thanks so much for the reply. Am a serious newbie when it comes to the Venus and its programming, so please bear with my questions.

  • I dont have a CCGX but rather a Venus GX.
  • Can I talk to the Venus without a MK3 cable (which i dont have). Meaning can I talk to the Venus using Firefox or is there another tool I can use? Also speaks to the question of how do I get the script onto the Venus
  • The login and password to get to the OS, would that be on the sticker of the Venus?
  • Am I correct in my thinking that the ESS would need to be set to "external control"?
  • Is there a document / resource that is good for beginners to read?

Thanks

 

Link to comment
Share on other sites

Hi Plonkster, so I did some more research and....good news😁

  • Discovered how to get root access to the Venus, have connected using Putty. That answers my question of how I get to the OS and what the login and password is.
  • Have found some good resources which I'm reading. Any advice is still appreciated though
  • Tried dbus -y com.victronenergy.vebus.ttyO5 /Soc SetValue 55 and that is not the register I'm looking for. Am looking for the ESS "Minimum Discharge SoC (unless Grid Fails)". From research looks like I need to dbus -y com.victronenergy.settings /Settings/CGwacs/BatteryLife/MinimumSocLimit Setvalue 45. Is this correct to change the ESS SOC value?
  • If I now have the correct setting, what do I do to get the script running on the Venus?
Link to comment
Share on other sites

17 hours ago, EDP said:

Tried dbus -y com.victronenergy.vebus.ttyO5 /Soc SetValue 55 and that is not the register I'm looking for. Am looking for the ESS "Minimum Discharge SoC (unless Grid Fails)". From research looks like I need to dbus -y com.victronenergy.settings /Settings/CGwacs/BatteryLife/MinimumSocLimit Setvalue 45. Is this correct to change the ESS SOC value?

Nice! Yes, that's right. Just keep in mind there are two values, there's MinimumSocLimit, and SocLimit. When you run optimised with BatteryLife, then the higher value of the two is used. Each day the battery reaches the low point, the SocLimit is increased by5%, and each time it passes 85% it is decreased again. Additionally it decreases another 5% if you charge above 95%. The effect is that the system automatically determines a lower SoC such that it still recharges fully the next day. Reason you have to keep it in mind is that setting just the one might not be enough, the BatteryLife "active limit" may override your setting.

17 hours ago, EDP said:

If I now have the correct setting, what do I do to get the script running on the Venus? 

The easiest is to create a cron job. Just create a new file in /etc/cron.d without funny characters in the name, eg: /etc/cron.d/soclimits. In this file use standard crontab syntax, eg:

00 13 * * * root dbus -y com.victronenergy.settings /Settings/CGwacs/BatteryLife/MinimumSocLimit Setvalue 45

Google is your friend if you want to know more about contabs (system and user ones, there is a tiny difference, above I used a system one).

Remember that the system time on Venus is UTC, so adapt for your timezone. For me, the above line would run at 3PM, since I'm in UTC+2.

Also remember that when Venus updates, you lose anything you added in /etc. Only /data is preserved. So remember to backup this file so you can restore it after an upgrade. I usually also turn off automatic updates for this reason.

Link to comment
Share on other sites

Hi Plonkster,

  • I assume the cronjob will not interfere with the normal ESS setting if I for example set ESS to "Keep batteries charged". I figure that the setting the MinSocLimit (even through a script) is pretty much the same as doing this manually in the Remote Console interface
  • In the same vein, I gather I wont have to set the ESS into "External Control" cause in reality all I'm setting (via script) is the MinSocLimit
  • Where on the Venus can I keep files safe from an upgrade? Do I need to make my own directory? I do vaguely recall there is a place on the Venus that is safe from upgrades.

Lastly, thanks so much for the assistance. I will report back once I have made the changes and its run for a few days.

 

Thanks

 

Link to comment
Share on other sites

39 minutes ago, EDP said:

I assume the cronjob will not interfere with the normal ESS setting if I for example set ESS to "Keep batteries charged". I figure that the setting the MinSocLimit (even through a script) is pretty much the same as doing this manually in the Remote Console interface

Correct. The ESS mode is set in /Settings/CGwacs/BatteryLife/State (basically 9 is Keep Batteries Charged, and 1 is Optimised with battery life, you can figure out the rest yourself :-) ).

 

41 minutes ago, EDP said:

In the same vein, I gather I wont have to set the ESS into "External Control" cause in reality all I'm setting (via script) is the MinSocLimit

Correct. If you really want to use external control, well then those settings we discussed are all ignored. Then it is your own job to control the Multi. See section 6 here. You have to continously write the setpoint(s) of the Multi, either via dbus or by using modbus-TCP.

43 minutes ago, EDP said:

Where on the Venus can I keep files safe from an upgrade? Do I need to make my own directory? I do vaguely recall there is a place on the Venus that is safe from upgrades.

/data is never touched during an update. So you can create your own directory under /data and keep files there. What is more, if you create an executable shell script called /data/rc.local (ie a text file with the commands, which you make executable with chmod +x), that file is always executed at boot time. You can use that to restore files, eg you can keep a copy of the cron job discussed previously in /data, and copy it to /etc/cron.d using rc.local. It happens on each boot, which is perhaps a little overkill, but it will do the job perfectly.

Final hint: Now that you have rooted the device. Run the command "dbus-spy". You're welcome :-)

Link to comment
Share on other sites

  • 2 weeks later...

Hi Plonkster, herewith update

  • From 1600-1700 Min SOC set at 95%. Ensures that the battery is charged and that I have a good charge going into the night. Same same as the new ESS setting that stop when a SOC has been reached in a timeframe.
  • At 1700 Min SOC drops to 50%, you can see it being kept there from about 2400 till 0200. Kept at 50% to ensure I have enough battery power to last till sunrise should the grid fail
  • At 0200 Min SOC goes to 40%
  • At 0400 Min SOC goes to 20%

In the end I get about 20% (+-1.4KWH) more use from my batteries.

BatteryDischarge.PNG.3a43b1c82a9b8e3db672dc0858ffb348.PNG

Love the dsub-spy by the way.

Thanks

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...