Skip to content

Add configurable dynamic PV curtailment#28538

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/support-solaredge-modbus-write
Draft

Add configurable dynamic PV curtailment#28538
Copilot wants to merge 4 commits intomasterfrom
copilot/support-solaredge-modbus-write

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

SolarEdge inverters support active power limiting via Modbus register 0xF001 (0–100% of nominal), but evcc had no write path yet for applying curtailment using templates. Additionally, many PV installations have a statutory feed-in cap (e.g. 60% of kWp) that must be respected even when curtailment is not active.

Generic curtailment support (meter/meter.go)

New optional fields on any custom PV meter:

Config key Go field Default Purpose
curtail Curtail *plugin.Config FloatSetter wired to the inverter's power-limit register
curtailed Curtailed *plugin.Config FloatGetter reading the current limit
curtaillimit CurtailLimit float64 0 Value written (%) when curtailment is active
feedinlimit FeedInLimit float64 100 Value written (%) when curtailment is lifted; also the Curtailed() threshold

The curtailMeter wrapper implements api.Curtailer:

  • Curtail(true) → writes curtailLimit
  • Curtail(false) → writes nominalLimit (feedinlimit)
  • Curtailed()currentLimit < nominalLimit

This ensures that an installation running at its legal cap (e.g. 60%) is not considered curtailed, and that lifting curtailment restores to 60%—not 100%.

Template params (util/templates/defaults.yaml)

curtaillimit and feedinlimit added as first-class global params (usages: ["pv"], advanced: true) with en/de descriptions and help text, so any future template can reference them without inline definitions.

SolarEdge templates

Both solaredge-inverter.yaml (pv usage) and solaredge-hybrid.yaml (pv usage) gain:

curtail:
  source: modbus
  # ... modbus connection ...
  register:
    address: 0xF001  # Active Power Limit (0–100 %)
    type: writesingle
    encoding: uint16
curtailed:
  source: modbus
  # ... modbus connection ...
  register:
    address: 0xF001
    type: holding
    decode: uint16
curtaillimit: 0    # % when curtailed   (advanced, default 0)
feedinlimit: 100   # % when uncurtailed (advanced, default 100)

Prerequisite: StorageConf_CtrlMode (0xE004) must be set to 4 (Remote) on the inverter — already noted in the hybrid template requirements.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 224.0.0.251
    • Triggering command: REDACTED, pid is -1 (packet block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Support SolarEdge Modbus write for PV curtailment (Smart Feed-in)</issue_title>
<issue_description>### Summary
Add support for controlling SolarEdge inverters via Modbus TCP to enable PV curtailment, allowing EVCC Smart Feed-in functionality.

Background

SolarEdge hybrid inverters (e.g. SE4000H) support active power limiting via Modbus registers. This allows external systems to dynamically reduce PV output, which is essential for avoiding feed-in during negative electricity prices.

Currently, EVCC can read data from SolarEdge via Modbus TCP, but does not support writing power limits. Because of this, the Smart Feed-in feature is not available for SolarEdge users.

Problem

In regions with dynamic tariffs (e.g. Belgium, Netherlands), feed-in prices can become very low or even negative. Without PV curtailment, users are forced to inject power at a loss.

EVCC already supports Smart Feed-in, but only for systems where inverter control is available. SolarEdge users are currently excluded from this feature.

Proposed solution

Extend the SolarEdge Modbus integration to support writing the active power limit register.

Key requirements:

  • Enable remote control mode (StorageConfCtrlMode = 4)
  • Allow setting active power limit (in % or W) -> using register 61441 (Active Power Limit) to set a percentage (0-100%) of maximum power
  • Integrate with existing Smart Feed-in logic
  • Apply limits dynamically based on price signals

Benefits

  • Enables Smart Feed-in for SolarEdge users
  • Prevents negative revenue from PV injection
  • Improves EVCC’s dynamic tariff optimization
  • Aligns with growing need for grid-friendly behavior

Example use case

  • Electricity price becomes negative
  • EVCC detects this via tariff provider
  • EVCC reduces inverter output to prevent feed-in
  • EVCC prioritizes local consumption (EV charging, battery)

Additional context

  • Tested with SolarEdge SE4000H (Modbus TCP enabled)
  • PV curtailment is already supported by SolarEdge hardware
  • Only missing piece is Modbus write support in EVCC

References

SolarEdge Modbus documentation:
https://www.solaredge.com/sites/default/files/sunspec-implementation-technical-note.pdf

using register 61441 (Active Power Limit) to set a percentage (0-100%) of maximum power

EVCC Smart Feed-in docs:
https://docs.evcc.io/en/docs/features/dynamic-prices#smart-feed-in

SEE: WillCodeForCats/solaredge-modbus-multi#683
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add SolarEdge Modbus write support for PV curtailment Add SolarEdge Modbus write support for PV curtailment (Smart Feed-in) Mar 24, 2026
Copilot AI requested a review from premultiply March 24, 2026 21:45
Copilot AI and others added 2 commits March 24, 2026 21:55
Copilot AI changed the title Add SolarEdge Modbus write support for PV curtailment (Smart Feed-in) SolarEdge Modbus: PV curtailment (Smart Feed-in) with configurable power limits Mar 24, 2026
@premultiply premultiply added enhancement New feature or request infrastructure Basic functionality devices Specific device support labels Mar 24, 2026
@premultiply premultiply changed the title SolarEdge Modbus: PV curtailment (Smart Feed-in) with configurable power limits Add configurable dynamic PV curtailment Mar 24, 2026
@CiNcH83
Copy link
Contributor

CiNcH83 commented Mar 25, 2026

I want to implement that for Huawei as well, see interface here. So I guess that the "installer"/user will have to set the Active Power Control Mode to Limited Power Grid (%) via inverter configuration:

image

Or shall we set the mode programmatically on every call?

evcc will only write a percentage based on the maxacpower param? So this param will be mandatory then?

Unlike hold and charge modes, this will not have a watchdog?

@CiNcH83 CiNcH83 mentioned this pull request Mar 25, 2026
1 task
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 infrastructure Basic functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support SolarEdge Modbus write for PV curtailment (Smart Feed-in)

3 participants