DESS needs a rework from SCRATCH

Thanks, I will take a look; now it is easy to automate it in node-RED with a function with your particular case, with the help of AI. Yesterday I was working on it; there is an evaluation at 4:00 on night to charge the battery setting the neccesary SOC for 3 hours with the consumption and solar forecasts, and actual battery, and during the day it reevaluates every half hour if it is convenient to do little additional charges on cheap hours.

I will test it through the next months, adjusting if neccesary.

Technical summary:
This system uses Node-RED to implement a predictive control strategy for a Victron Multiplus II ESS, with the goal of minimizing grid energy costs.

The controller operates based on the following inputs:

  • Hourly forecasts for generation (solar_yield_forecast) and consumption (vrm_consumption_fc) obtained via API.
  • Real-time battery SoC from the Victron system.
  • A hardcoded Time-of-Use price schedule (Peak, Flat, Off-peak).

The control strategy is divided into two primary modes:


Weekday Strategy

The objective is to cover energy deficits with power purchased during the cheapest (Off-peak) period.

  1. Primary Charge (04:00): A main charge cycle is initiated based on the calculated net energy deficit for the next 24 hours (Total Consumption - Total Solar Production). A MinimumSocLimit is set to charge the required energy from the grid, respecting a dynamic, forecast-based solar margin (5-15%).
  2. Charge Maintenance (04:00-07:00): The system enters a non-interference state (return null) to allow the primary charge to complete without being interrupted by subsequent script executions.
  3. Predictive Adjustment (every 30 min, from 07:00): A simulation algorithm models the battery’s state of charge hour-by-hour until midnight. If the simulation predicts a point where the SoC would fall below the 20% base minimum, it calculates the required energy and sets a new MinimumSocLimit to preemptively charge in the most economical period before the deficit occurs.
  4. Peak Hour Protection: During the most expensive hours, the MinimumSocLimit is forced to 20% to maximize the use of stored energy.

Weekend Strategy

The objective shifts to maximizing direct solar self-consumption.

  • By default, the MinimumSocLimit is kept at 20% to maximize available battery capacity for free solar charging.
  • On days with a very low solar forecast (<4 kWh), the MinimumSocLimit is raised to 40% between 10:00 and 17:00 to provide (for battery health) an energy buffer.

Here you can find more info and the json archive, that I will update if there is any improvement:
flows.zip (3,9 KB)

1 Like

What great summary exactly what I found
I use my own algorithm which seems to work a node red routine
Unfortunately this community won’t let me attach the json file
But good look

1 Like

Attach json as zip file works

1 Like

Is there plan to make using a new parameter (do not sell when price is less than x €/kwh)?
Yes I know that I can fake that when I enter into my selling price (p-0.1) but then cost calculation will go wrong.
I would like to enter 0,1€/kWh the minimum price DESS can sell (I’m in Geen mode)

I ask because yesterday DESS did something that I did not liked. I have configured my battery cost 0,03€/kWh and it sold when price was 0,0312 and then it somehow bought (I think some internal problem) some back. And together I sold 6,8kWh for 0,2€ and bought 1,2kWh for 0,1€, so gain 0,1€ that is nothing :frowning:
I assume that it sold because DESS thought that battery will be full next day and it needed some room. But I do not want to sell when I do not get at least 0,1€/kWh. ANd if tomorrow is PV surplus I can always put it somewhere, to the EV or heat the water etc.


I just do not understand DESS decisions.
Yesterday evening at 21 selling price was 0,15€ and it did not sell. And if I looked then todays forecast then it was not going to sell today morning either.
But today waking up I saw that DESS sold at 04 and at 07 when price was 0,016€ and 0,045€.
Why the heck did it sell today when it decides not to sell yesterday with multiple times higher prices.

And if you would introduce a new parameter (do not sell less than x price) this all would have been prevented :slight_smile:

I am so glad I’m not the only one complaining. For me the gamble to set Target SoC to Minimum SoC lets me down too many times. Sometimes I use more than usual and minimum SoC kicks in at high prices. Victron should implement a target SoC window between which the dess tries to work, but is not limited to if forecasts are off. My battery reaches 100% SoC daily which is killing for cycle life, yet installers as Venematech call this normal. Ask any cell manufacturer, they say 20-90% gives good cycle life, 30-70% insanely good cycle life. Okay, going over these soft boundaries isn’t very bad or something, but consistently, daily doing this is just not what a DESS system should do.

Non public as far as I know. I’m of the opinion DESS is broken both on a systems level as well as organisational. Victron simply doesn’t have the resource to have their cake and eat it too, meaning: Keep core parts closed source such as the ā€˜assistants’ and the 'master scheduler backend a.k.a. the scheduling logic on their (cloud/VRM) computers while at the same time count on the open source/ community participation for field testing and providing actual real life use case requirements and feedback.
Not saying I’m not appreciative, just stating my opinion that we’d all be better off if Victron would open source the whole DESS toolchain and focus on facilitating active community participation instead of trying to cling to some ā€˜software as a service’ (saas) strategy that’s neither here or there.

Today is similar situation (like it was yesterday) that it could sell evening but has decided not to, even tomorrow clearly shows that it will be full.
Yesterday it did not sell evening and sold in the next morning with 3x less price.
Will copy screenshot here so I can compare it tomorrw :slight_smile:


Actually I’m ok when DESS does not sell in the evening, but I’m against when DESS decides instead to sell in the morning with 3x less price.

21 → 22 is over and yet again DESS acted weirdly

  1. It sold from 21:00 → 21:15 with 3kw power
  2. then from 21:15 → 21:30 it covered load from grid around 600w
  3. and from 21:30 it went to self consumption

Can’t understand why that sell for 15 minutes was nessesary with 3kw when it then bought next 15 minutes energy back with 600w???



So it sold for 0,1€ and then bought back energy for 0,05€ (why DESS … WHY)
What I have read is that 3.7 beta should do something for that behaviour?

@dognose can you explain DESS in this case (look my two previous posts where yesterday evening today night sales were not present)

And as I thought DESS decided to sell in today morning low prices instead of yesterday evening high prices :frowning: And my battery cost is 0,03€ but it still sold with 0,021€ price at 6AM.

So I have to turn DESS off because it is just wasting energy (and I’m in Green Mode)

I’m not doing the scheduling, what I would assume here:

  • Consumption was forecastet high at 1,2,3 (System Overview Graph shows that even for passed hours)
  • So the system kept the energy in the battery to support ā€œthisā€ expected consumption.
  • That consumption didn’t happen, so it decided to sell to grid instead, to empty the battery for the upcoming morning hours.

I always say: Looking back at ā€œhappenedā€ things and determine that wasn’t ideal is ā€œeasyā€ - but looking ahead and predicting what would be ideal is the tricky part.

If consumption would have happened as predicted, that plan would have been absolutely okay. But consumption was lower than predicted, so kinda Plan B was used to sell at somewhat ok prices before morning solar kicks in.

But that’s how green mode should work: Focus on cover own consumption, then just sell ā€œat best pricesā€ what’s left over.

You should rephrase that: There was no energy ā€œwastedā€, There was just ā€œlessā€ optimized profit than there could have been. Never the less still more than with DESS disabled - where you would have entered the morning on probably 70% Soc, leaving only 30% room to charge solar during unfavourable sell-price-hours.

2 Likes

And that is the reason i suggest a new parameter (do not sell less than this ā€œpriceā€ from battery) then it is in my control. Because some of us do not want to just move energy for practically nothing.

I went to sleep knowing that i have 65% of battery and wake up with only 45% of battery. And I have EV and plenty of water I can dump energy :slight_smile:

There are plenty of times when DESS solar forecast is overestimating. And then selling is not justified.
Also why did it sell with lower prices than my battery cost? When battery would be full then letting PV overflow to the grid would be more benefitial in this case :slight_smile:

PS! And I saw this coming yesterday when I posted my screenshots. So this is not after analyzis :slight_smile:

What brothers me most is that I can’t trust DESS plan at all.
Today morning I looket it and saw that selfconsumption pv to battery and evening sell from battery.
But then at 12:24 I saw that DESS is buying from grid with 6kw of power. That is strange because 7 day forecast is showing more pv than consumption


Here is what DESS did out of the blue and I have " Yes, enable charge* battery from grid restrictions" in weekdays from 7 to 22 Yes, so it ignored that.

Here is todays details, where you see that selling price is basically 0€

And here is log i’m recording about DESS.

interesting, how do you record those DESS logs?

1 Like

I have custom function node in node-red that is gathering all this data from flow and when ā€œdess_reactivestrategyā€ changes is writing it to text file. Then I can afterwards understand what was these values when reactivestrategy changed.

1 Like

nice! would you care to share the flow?

There is so many interconnected parts in that big DESS flow of my, so copyng it all here is pointless.

The info if feed in to first function node from:
com.victronenergy.system (0)
/DynamicEss/ReactiveStrategy

There is also change node that is changing topic to ā€œReactiveā€

First function that insures only changes are sent:

var previous = context.get(msg.topic);
//when deploy then it is undefined
if (previous == undefined) 
{
    // change the same we have right now
    context.set(msg.topic,msg.payload);
    previous = msg.payload;
    node.send({topic: msg.topic, payload: msg.payload});
}
if (msg.payload != previous)
{
       context.set(msg.topic,msg.payload);    
       node.send({topic: msg.topic, payload: msg.payload});
}
return;

second function after 500ms delay

if (msg.topic === 'Reactive') {
    // Build a JavaScript object using flow context
    let payloadObj = {
        dess_strategy: flow.get('dess_strategy'),
        dess_reactivestrategy: flow.get('dess_reactivestrategy'),
        dess_restrictions: flow.get('dess_restrictions'),
        dess_activerestrictions: flow.get('dess_activerestrictions'),
        dess_targetsoc: flow.get('dess_targetsoc'),
        dess_currentsoc: flow.get('dess_currentsoc'),
        dess_gridpower: flow.get('dess_gridpower'),
        dess_gridsetpoint: flow.get('dess_gridsetpoint')
    };

    // Convert object to JSON string
    let finaltext = JSON.stringify(payloadObj);

    // Get timestamps
    let utcTimestamp = new Date().toISOString();
    let localTime = new Date().toLocaleString('en-GB', {
        timeZone: 'Europe/Tallinn',
        hour12: false
    });

    // Create final payload
    msg.payload = `${utcTimestamp} (UTC) - ${localTime} (Local) - ${finaltext}\n`;
    return msg;
}

there are these change nodes where I write to flow all the parameter I need

2 Likes
1 Like

Not using any customs flows or HomeAssistant overrides, I can say that 15min pricing works pretty well with DESS!

Top graph: electricity price
Bottom graph: yellow = grid power in, blue = battery power in

(Dont be confused by that oscillation on the right - it’s caused by a switching load (electric oven))

The only gotcha you may run into is that VRM will not show forecasts and schedules on a 15min grid but 60mins. But in practice it’s running at 15min intervals as you can see in above where it’s charging from grid for a 15min period and also in the following graph where the strategy changes in 15min intervals:

Only the current DESS target SoC looks quite odd to me, it’s taken from venus/N/xxxxxxxxxxx/settings/0/Settings/DynamicEss/Schedule/0/Soc and looking into the future, the succeeding target SoCs (Schedule/1/SoC, etc) are the same until 1h later where it jumps.

what are your key performance parameters: battery capacity in kWh, battery power limits, grid power limits, charger/inverter power limits? any solar involved and running dess trade or dess green?