question

Peter avatar image
Peter asked

"Scheduled charging" and Node-Red

How can I change "Scheduled charging" in Node-Red?


eg: /settings/0/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc to 80%?

Node-RED
2 |3000

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

13 Answers
pulquero avatar image
pulquero answered ·

Assuming this is referring to the local settings service com.victronenergy.settings then an exec node with

dbus-send --system --print-reply --dest=com.victronenergy.settings /settings/0/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc com.victronenergy.BusItem.SetValue variant:int32:80
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.

Andrew Ellis avatar image Andrew Ellis commented ·

Hi, thanks for this. It's exactly what I needed. I had to use the slightly amended command to make it work on my Cerbo GX

  1. dbus-send --system --print-reply --dest=com.victronenergy.settings /Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc com.victronenergy.BusItem.SetValue variant:int32:80
0 Likes 0 ·
usernamepasswordbs avatar image
usernamepasswordbs answered ·

Would you be able to give me a couple of pointers on how to adapt this code to allow me to enable a scheduled charge via Node-Red?

Basically to enable a scheduled charge when SoC drops below a certain level, at a certain time of day.

Thanks in advance.

2 |3000

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

Dirk-Jan Faber (Victron Energy) avatar image
Dirk-Jan Faber (Victron Energy) answered ·

From node-red-contrib-victron version 1.4.33 and onwards you can also use the ESS control node to do this (https://github.com/victronenergy/node-red-contrib-victron/wiki/Available-nodes#ess), using Schedule 1: State of charge (%).

2 |3000

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

usernamepasswordbs avatar image
usernamepasswordbs answered ·

@Dirk-Jan Faber Thanks very much. I will have a try at that.

2 |3000

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

usernamepasswordbs avatar image
usernamepasswordbs answered ·

Hi again, I have looked via Node-red "manage palette" but the latest version seems to be only 1.4.32. and I'm not totally sure how to install new nodes nodes via Github. Do I download from Github and import the JSON file only (doesn't seem a big enough file) or is it more complicated than that ?

2 comments
2 |3000

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

Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦ commented ·

The node-red-contrib-victron version is updated with the Venus firmware. The latest candidate firmware ships with version 1.4.33.

So updating the Venus OS will take care of the package. Manually updating node-red-contrib-victron is not recommended.

0 Likes 0 ·
usernamepasswordbs avatar image usernamepasswordbs Dirk-Jan Faber (Victron Energy) ♦ commented ·
Thanks again for replying.
0 Likes 0 ·
grua avatar image
grua answered ·

Hi, where can I find these both in Node-RED? I looked for it, but didn't find...

1. Read the scheduled charching state:
1700826765992.png

2. Write activate/deacitvate scheduled charging:
1700826841331.png


1700826765992.png (23.2 KiB)
1700826841331.png (16.2 KiB)
2 |3000

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

pulquero avatar image
pulquero answered ·

You will probably need to send dbus commands from nodered using exec node. Use dbus-spy from the shell to locate the service names and appropriate dbus paths for those settings.

e.g. I set the logging interval with an exec node with command:
dbus-send --system --print-reply --dest=com.victronenergy.settings /Settings/Vrmlogger/LogInterval com.victronenergy.BusItem.SetValue

and append the msg payload containing the interval.



2 |3000

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

grua avatar image
grua answered ·

Thanks, I'll have to read up on the matter first. I'm still an absolute Node-RED newbie, I haven't dealt with dbus commands yet...

2 |3000

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

grua avatar image
grua answered ·

But it's a pity that dbus commands seem to be required for this, because all the settings for scheduled charching are directly accessible via Victron Node-RED nodes (target SOC, start time and duration, etc...), but these two values are obviously not ...

@Dirk-Jan Faber (Victron Energy) there really isn't an easier way?

6 comments
2 |3000

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

Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦ commented ·

The easiest way at the moment is using the custom output node. With that node you can just select the service and path to read from or write to.

The Node-RED implementation of Dynamic ESS (https://github.com/victronenergy/dynamic-ess) project uses the same system for writing the schedule.

1 Like 1 ·
grua avatar image grua Dirk-Jan Faber (Victron Energy) ♦ commented ·
thx!
0 Likes 0 ·
grua avatar image grua Dirk-Jan Faber (Victron Energy) ♦ commented ·

@Dirk-Jan Faber (Victron Energy), I have now managed to read out the status of whether scheduled loading is currently active using a custom input node:

1701160531129.png

But I still can't find the appropriate custom output node to activate/deactivate a schedule.

I also looked at https://github.com/victronenergy/dynamic-ess for this. But with these custom output nodes the schedule is only parameterized, but not actually activated?:

1701160959434.png

But how do I activate/deactivate such a parameterized schedule, i.e. change this setting via a custom output node?:

1701161476775.png


0 Likes 0 ·
1701160531129.png (3.6 KiB)
1701161476775.png (16.0 KiB)
Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦ grua commented ·

Well, the Dynamic ESS system is using its own schedule, on another place on the dbus. And it also is activated on a different way. So these should not be mixed.

For normal ESS you should use the 'ESS control' node and write a positive value to the day field for activating it. Writing a negative value to that path will disable that schedule.

Valid days fields are:

  • 0 - Sunday
  • 1 - Monday
  • 2 - Tuesday
  • 3 - Wednesday
  • 4 - Thursday
  • 5 - Friday
  • 6 - Saturday
  • 7 - Every day
  • 8 - Weekdays
  • 9 - Weekends

So write `7` for an activated daily schedule and `-7` for a de-activated daily schedule.

I'll clarify that in the documentation of the node too.

1 Like 1 ·
grua avatar image grua Dirk-Jan Faber (Victron Energy) ♦ commented ·
thank you very much - tested it and it works fine!
1 Like 1 ·
Peter avatar image Peter Dirk-Jan Faber (Victron Energy) ♦ commented ·


There is also value -10 :-)


0 Likes 0 ·
pulquero avatar image
pulquero answered ·

You could probably modify this
https://github.com/victronenergy/node-red-contrib-victron/blob/master/src/services/services.json
to add the missing values. It should be somewhere lurking around on the filesystem.

2 comments
2 |3000

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

Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦ commented ·

There is no longer a need for editing that file if you use the custom input/output node.

Eventually most dbus paths will end up in the specific nodes. While they are not there yet, use the custom nodes. See https://github.com/victronenergy/node-red-contrib-victron#custom-nodes for more info on those.

0 Likes 0 ·
pulquero avatar image pulquero Dirk-Jan Faber (Victron Energy) ♦ commented ·
Ahhh, looks like I need to update.
0 Likes 0 ·
grua avatar image
grua answered ·

Thanks, but unfortunately I'm completely overwhelmed with that... I use the Victron nodes, but unfortunately modifying them is too much for me

2 |3000

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

usernamepasswordbs avatar image
usernamepasswordbs answered ·

Me too!

What is the Node-Red way to "activate scheduled charge no.4 at 10pm if battery is below x% SoC" with a standard Victron node (no coding required) ?


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.

Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦ commented ·

I've put an example up on https://gist.github.com/dirkjanfaber/941e34378733a668fbb4bb645f4b3fdc

At least that is one way of doing it.

0 Likes 0 ·
usernamepasswordbs avatar image
usernamepasswordbs answered ·

Great, I will have a go with that.

Thanks,

2 |3000

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