question

avukat38 avatar image
avukat38 asked

How can I program DESS?

Hello, I want to configure my system but I cannot succeed. First of all, I have the right to sell 10kwh to the grid. My total PV power is 18kwh and I have 25kwh battery. I want my system to work like this: 1st, home consumption, 2nd, selling up to 10kWh to the grid, and I want the remaining PV power to charge my battery. Because when the battery is charged in the morning, more than 10kWh of production is wasted towards noon. If the PV power is sold to the grid for up to 10kWh and charges the battery when the PV production exceeds 10kWh, I will be selling approximately 5kWh more electricity to the grid per day. I think this can be done with the red node, but there is nothing in this regard I don't know. VRM portal ID c0619ab4d09f

system design
2 |3000

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

5 Answers
matt1309 avatar image
matt1309 answered ·

Hi @avukat38

Not sure how to write this in the supported DESS/ie integrating next day forecast/pricing however to achieve the more simple version of what you're looking for in node red would be something like this:


If using old venus os you need to pass data into this function (but first set topics of msg based on which data node is used). If not you can probably read vars from global context


This function will calculate grid setpoint to be the total of solar - loads. And then export the excess above 0. You might want to add more safety mechanisms for event where data nodes go offline before issuing 0W.

//if you're using old venus os you need the below. if not you can just read these varibales from the global context
var acLoad = global.get('acLoad');
var acSolar = global.get('acSolar');
var dcSolar = global.get('dcSolar');
var gridSetpoint = global.get('gridSetpoint');
var exported= global.get('exported');
 
//setting soc variable depending on inputs from flows
if (msg.topic === "acLoad") {
  soc = msg.payload; // Extract payload from input 1
  global.set('acLoad', acLoad);
}
 
//setting soc variable depending on inputs from flows
if (msg.topic === "exported") {
  exported = msg.payload; // Extract payload from input 1
  global.set('exported', exported);
}
if (msg.topic === "acSolar") {
  acSolar = msg.payload; // Extract payload from input 2
  global.set('acSolar', acSolar);
}
 
if (msg.topic === "dcSolar") {
  dcSolar = msg.payload; // Extract payload from input 3
  global.set('dcSolar', dcSolar);
}
 
//this is used to check if gridsetpoint is already 0, if it is then we won't bother updating it.
if (msg.topic === "gridSetpoint") {
  gridSetpoint = msg.payload;
  global.set('gridSetpoint', gridSetpoint);
}
 
if (msg.topic === "acLoad") {
 
  acLoad = msg.payload; // Extract payload from input 2
 
  global.set('acLoad ', acLoad);
 
}



 
//The main logic. 
if (export < 10000) { 

    gridSetpoint = acLoads - acSolar + dcSolar;

} else {
  gridSetpoint = 0;
}
 
if (gridSetpoint !== global.get('gridSetpoint')) { // Check if gridSetpoint is going to change
  global.set('gridSetpoint', Math.min(gridSetpoint, 0));
  msg.payload = Math.min(gridSetpoint, 0);
  return msg;
}


2 |3000

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

avukat38 avatar image
avukat38 answered ·

First of all, thank you, I am using Venus 3.30, my buying and selling price is fixed. Does not change according to time and date

2 |3000

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

avukat38 avatar image
avukat38 answered ·

Unfortunately, I have no knowledge of what you are talking about. You need to explain how to do it and how to add it to the system as if you were explaining it to an idiot.

7 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.

matt1309 avatar image matt1309 commented ·

I can type something up over the weekend. But this guy had a similar idea but his exporting was based on time. Have a skim through comments on here and if it's still nonsense i can type something out this weekend

Schedule grid feed back using Node red - Victron Community (victronenergy.com)

0 Likes 0 ·
avukat38 avatar image avukat38 matt1309 commented ·

I hope you will write on Sunday.

0 Likes 0 ·
avukat38 avatar image avukat38 matt1309 commented ·

I guess you didn't have time to write

0 Likes 0 ·
matt1309 avatar image matt1309 avukat38 commented ·

Hi,


Definitely recommend youtubing some node red guides as the stuff I'll describe below is basic once you've done it once or twice. (And the videos will make it far easier than i can explain in text). And the code/setup isn't really victron specific so you can learn generic node red and then utilise that within victron system.


Here's a very brief description to hopefully get you started.

So you get the Nodes that output the data you need (these will all by victron nodes in blue on the left hand side of node red).


You need nodes that output AC Load, Solar production (ac and dc if you've got ac and dc coupled solar), gridsetpoint and then the amount exported.


Each data node will go into a change node that sets the topic of the message. This allows the function code above to tell what data it's receiving and handle it accordingly.


(If you're using a recent version of venus of you might be able to skip this step and just access the data via global context which is a new-ish feature. (More detail on that on the link i shared earlier))

https://community.victronenergy.com/questions/276456/node-red-programmer.html?childToView=277998#comment-277998


If you're using older venus and cannot use global context it'll look something like this:

Where blue are your data nodes then yellow is your change nodes.




Inside of a change node looks like this:


You need to repeat that for all data nodes. This sets the topic of msg which allows the function node to know what data it's receiving if you dont do this then the function node can't tell if it's received Solar information of Load information etc.

Once you've set this up for each node, you get the output of the changes nodes and all run into the function node which will include the code i provided above.

Looking something like this (however you'll have more input data so more blue and yellow nodes)


The funciton node will use the input data to calculate what the gridsetpoint needs to be set at. I suggest you pass the output of the function node into a debug node for now. This willl allow you to monitor the output to make sure the code is working as expected. If you're happy it's all working as it should be then you can replace the output of the function node from the debug node to the Node that lets you set gridsetpoint. This will then dynamicaly adjust gridsetpoint until export variable reaches greater than or equal to 10000


Worth noting as Nick mentioned this is not a standard setup and obviously has custom code so please make sure you fully understand it before implementing on a live system.


0 Likes 0 ·
avukat38 avatar image avukat38 matt1309 commented ·

unfortunately I couldn't

0 Likes 0 ·
ejrossouw avatar image ejrossouw commented ·

@avukat38 Maybe this DESS manual (WIP) is a good place to start.

0 Likes 0 ·
avukat38 avatar image avukat38 ejrossouw commented ·

I reviewed all the settings there many times, but the problem was not solved. The system starts charging the battery before PV production reaches 10kWh.tempimagefrqzbn.gif

0 Likes 0 ·
avukat38 avatar image
avukat38 answered ·

I would be very grateful if you write. I think I explained exactly what I wanted

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.

nickdb avatar image nickdb ♦♦ commented ·

If you don't have a development background and what was posted above makes no sense to you, then this is likely not an option for you. Not everyone wants to heavily customise a system and take on the loss of support this often leads to.

There is a sticky topic, shown at the top of the forum, for DESS. Start by reading that and asking questions there.

DESS isn't perfect, it continues to be improved, but a lot of people are using it, and chances are your question may already have been asked elsewhere.

What you're describing is probably better achieved with regular ESS, it doesn't sound like the specific use-case DESS was intended for - buying and selling power based on variable tarifs.

1 Like 1 ·
Duivert NL avatar image
Duivert NL answered ·

Im not yet familiar with DESS but you can use ESS with scheduled charging

If DESS has scheduled charging then maybe you can combine them

2 |3000

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

Related Resources

Additional resources still need to be added for this topic