Skip to content

Conversation

@puni2k
Copy link
Contributor

@puni2k puni2k commented Dec 9, 2025

Added minSoc, maxSoc, maxchargepower and maxdischargepower.

Replaced hardcoded discharge limit in battery control with maxdischargepower setting. Use hardcoded value as new default.

@andig andig added devices Specific device support enhancement New feature or request labels Dec 9, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • The maxdischargepower parameter is marked as required: true but also given a default value; consider dropping either the required flag or the default to avoid confusion about how it should be configured.
  • For the new minsoc and maxsoc parameters, consider adding explicit defaults and/or validation (e.g., 0–100%) to guard against misconfiguration and make their expected range clearer.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `maxdischargepower` parameter is marked as `required: true` but also given a default value; consider dropping either the `required` flag or the default to avoid confusion about how it should be configured.
- For the new `minsoc` and `maxsoc` parameters, consider adding explicit defaults and/or validation (e.g., 0–100%) to guard against misconfiguration and make their expected range clearer.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@puni2k
Copy link
Contributor Author

puni2k commented Dec 9, 2025

Can the required flag be safely removed if a default value is given? Asking for a friend

@andig
Copy link
Member

andig commented Dec 9, 2025

@andig
Copy link
Member

andig commented Dec 9, 2025

Can the required flag be safely removed if a default value is given? Asking for a friend

Think so, but why? I‘d rather remove the arbitrary default;)

@puni2k
Copy link
Contributor Author

puni2k commented Dec 10, 2025

Seems https://github.com/evcc-io/evcc/pull/25929/files#diff-1408ce27b723146474f25d2a6bb01f07fd13a5fee41c1f2152bdf77a434426f7R212 should use charge power, too?

Don't know. There seems to be a register for setting it ( 0xE00E ). But since it is not used in the current template I'd omit it until someone actually has a usecase for it.
Just in case someone mentions § 14a EnWG; From my understanding this register limits the total battery charging power and not the share you charge from the grid. So you'd gimp yourself in scenarios where you have excess PV power available.

Can the required flag be safely removed if a default value is given? Asking for a friend

Think so, but why? I‘d rather remove the arbitrary default;)

So, according to this 5000W seems to be max Charge / Discharge Limit what 'most' SolarEdge hybrid inverters seem to be capable of.
And since this value is used for battery control my idea was to also use this value as default. Wouldn't there otherwise be an issue in an upgrade scenario where battery control would be buggy until the user updates his config?

@andig
Copy link
Member

andig commented Dec 10, 2025

Lets not invent fake values. If we don‘t need a default we shouldn‘t have one.

@puni2k
Copy link
Contributor Author

puni2k commented Dec 10, 2025

Fine with me.
Though it might be better to then declare this as a breaking change and tell users that they have to set these values after upgrading.

@andig
Copy link
Member

andig commented Dec 10, 2025

Sorry, I was only refering to the unused chargepower default! The other one is unfortunate but would indeed be breaking which is always a bad idea.

@puni2k
Copy link
Contributor Author

puni2k commented Dec 10, 2025

Ah ok :)
No problem, 'half a roll backwards' it is then

also removed the required flags for maxchargepower / maxdischargepower since no other template uses it for these parameters
@andig andig changed the title added minsoc/maxsoc/maxchargepower/maxdischargepower to SolarEdge Hybrid Template SolarEdge Hybrid: add min/max soc maxcharge/discharge power Dec 10, 2025
@andig andig enabled auto-merge (squash) December 10, 2025 08:53
@andig andig merged commit bb78ce2 into evcc-io:master Dec 10, 2025
7 checks passed
@puni2k puni2k deleted the solaredge_hybrid_add_parameters branch December 10, 2025 09:00
@meniku
Copy link

meniku commented Dec 21, 2025

Does this really work? I've set the minsoc: 25, but my battery discharges down to 0

@premultiply
Copy link
Member

You have to set it to the same value which is set in your inverter configuration.

@puni2k
Copy link
Contributor Author

puni2k commented Dec 21, 2025

Because that is not the intent behind this change.

It makes the parameters configurable so that the optimizer works with the actual inverter settings and not the default ones in evcc.

@meniku
Copy link

meniku commented Dec 21, 2025

Oh 😳
I'm not aware of that setting? Where can I find that in solaredge?

@meniku
Copy link

meniku commented Dec 22, 2025

What I have found now is the "Storage Backup reserved", which can be set via modbus. It looks like it does what I was searching.
Still I am a litttle bit confused why there's a separate setting in evcc. Couldn't the proper value be read from modbus?

@andig
Copy link
Member

andig commented Dec 22, 2025

Still I am a litttle bit confused why there's a separate setting in evcc. Couldn't the proper value be read from modbus?

Using templates, it can once we have #25908

@Oakside15
Copy link
Contributor

Hi,
I'm still not entirely sure whether the four values are only there so that the optimizer can work with the values from the inverter, or whether they also have a write function? In other words, so that the values entered by EVCC are transferred to the inverter?
The max soc value works, but with maxchargepower I can enter any number, but the storage unit always charges at the full 5 kW.

@puni2k
Copy link
Contributor Author

puni2k commented Jan 27, 2026

Look at what the template does.
The only parameter that has any effect on the inverter is maxdischargepower.

All other parameters are just there so that the optimizer knows about the inverters settings and uses these for its calculations instead of its default values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants