evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Site: add smart feed-in disable (aka zero feed-in)

Open andig opened this issue 6 months ago • 19 comments

Fix https://github.com/evcc-io/evcc/issues/21747, depends on https://github.com/evcc-io/evcc/pull/21813 Also fixes https://github.com/evcc-io/evcc/issues/21832

Disable solar feed-in when feed-in becomes expensive for the user (i.e. network restriction visible due to feed-in tariff). Implemented by restricting the PV inverter to 0W feed-in power. Requires supported inverter.

💸 add feed-in visualization to forecast modal 👇 proper handling of negative prices (aligned 0-axis)

TODO

  • [x] UI @naltatis
  • [ ] finalise api, look into https://github.com/evcc-io/evcc/discussions/19422#discussioncomment-13817712
  • [x] do we need to control batteries or only pv? Batteries shouldn't feed-in, so no?
  • [x] add e2e tests @naltatis
  • [x] highlight affected time slots @naltatis
  • [x] implement correct price options @naltatis

/cc @Maschga wenn Du magst könntest Du hier branchen und einen PR für RCT erstellen und testen.

Out of scope

  • Migrate "battery grid charge" feature to forecast modal
  • Make forecast a top-level page (not a modal) > introduce bottom bar app nav

grid feedin.webm

Bildschirmfoto 2025-08-25 um 16 59 31 Bildschirmfoto 2025-08-25 um 16 59 39 Bildschirmfoto 2025-08-25 um 17 07 59 Bildschirmfoto 2025-08-25 um 17 08 02 Bildschirmfoto 2025-08-25 um 17 08 20

andig avatar Jun 14 '25 09:06 andig

@naltatis diesmal ein neuer Fehler:

·

  1) [chromium] › tests/config-loadpoint.spec.js:420:3 › loadpoint › user-defined charger ──────────

    Error: Timed out 5000ms waiting for expect(locator).toContainText(expected)

    Locator: getByTestId('charger-modal').getByTestId('test-result')
    Expected string: "Status: successful"
    Received string: "Status: failedvalidateyaml: line 14: mapping values are not allowed in this context"
    Call log:
      - expect.toContainText with timeout 5000ms
      - waiting for getByTestId('charger-modal').getByTestId('test-result')
        9 × locator resolved to <div errorline="14" data-v-f8692870="" data-testid="test-result" class="test-result my-4 p-4">…</div>
          - unexpected value "Status: failedvalidateyaml: line 14: mapping values are not allowed in this context"


      453 |     await expect(restResult).toContainText("Status: unknown");
      454 |     await restResult.getByRole("link", { name: "validate" }).click();
    > 455 |     await expect(restResult).toContainText("Status: successful");
          |                              ^
      456 |     await expect(restResult).toContainText(["Status", "charging"].join(""));
      457 |     await expect(restResult).toContainText(["Enabled", "yes"].join(""));
      458 |     await expect(restResult).toContainText(["Power", "11.0 kW"].join(""));
        at /home/runner/work/evcc/evcc/tests/config-loadpoint.spec.js:455:30

Vmtl. aus https://github.com/evcc-io/evcc/pull/21813?

andig avatar Jun 14 '25 10:06 andig

@andig hier kommst scheinbar beim Ersetzen der YAML-Vorlage durch den eigentlichen Code zur Fehlverhalten. Aber immer unterschiedlich. Ich schau mal was hier die Ursache ist.

Bildschirmfoto 2025-06-14 um 19 30 06 Bildschirmfoto 2025-06-14 um 19 30 32 Bildschirmfoto 2025-06-14 um 19 30 22

naltatis avatar Jun 14 '25 17:06 naltatis

@naltatis kannst du mit dem Merge helfen?

andig avatar Jun 27 '25 07:06 andig

UI pack ich nicht…

andig avatar Jun 27 '25 07:06 andig

@andig resolve the conflict - mostly. I've left one for you :D

naltatis avatar Jun 27 '25 13:06 naltatis

do we need to control batteries or only pv? Batteries shouldn't feed-in, so no?

yes, for me it's an pv feature. Requirements for showing it in the ui: dynamic tariff + controllable pv inverter Makes placement of the feature a little tricky since it does not fit in the existing "Battery settings" model. Guess we need a dedicate "Solar settings" modal only for this feature.

naltatis avatar Jun 27 '25 13:06 naltatis

@naltatis back over to you?

andig avatar Jul 02 '25 07:07 andig

Added the option/limit to the forecast dialog since we dont have a global place for pv-based settings. In a future iteration we should promote forecast (together with other charts) to a top level page and also move battery grid charge there. So one place to see all your forecasted data (production, price, ...) and can make decisions based on this. Future optimizer hints or effects could also live there.

naltatis avatar Aug 20 '25 15:08 naltatis

@andig magst du den Konflikt hier auflösen?

naltatis avatar Aug 25 '25 13:08 naltatis

Done

andig avatar Aug 25 '25 13:08 andig

Done

But broken

naltatis avatar Aug 25 '25 14:08 naltatis

Should be fixed now.

naltatis avatar Aug 25 '25 14:08 naltatis

Added highlighting of affected time slots. See updated screenshots and video in description 👆

naltatis avatar Aug 25 '25 15:08 naltatis

Matching limit options:

Bildschirmfoto 2025-08-26 um 17 07 06

naltatis avatar Aug 26 '25 15:08 naltatis

Reflect active limit in energy flow

Bildschirmfoto 2025-08-27 um 14 44 36

naltatis avatar Aug 27 '25 13:08 naltatis

@andig all done from my side

naltatis avatar Aug 27 '25 13:08 naltatis

I have a question/maybe a complication about this, currently doing this function from home assistant if evcc isn't active solar and the feed in price is negative (ie: paying to export power to grid) then I flip the load following register on my solar inverter, But from evcc I set the export price to 0 always as I consider evcc to be consuming solar power which has no value and not a negative value.

See the example below the export price is actually -2.9c a kwh but in evcc by using custom forecast the current period is set to 0 just so the charging sessions cost is increasing in price and not decreasing. image

So in relation to this pr, if evcc can prevent export costing $$ then consideration probably should be given that this is actually 0 in value when calculating charging sessions cost. I'm not seeing anything related to the charging sessions cost in the pr.

jeffborg avatar Oct 01 '25 23:10 jeffborg

See the example below the export price is actually -2.9c a kwh but in evcc by using custom forecast the current period is set to 0

Why? Forecast wrong? Seems OT here.

andig avatar Oct 02 '25 05:10 andig

Why? Forecast wrong? Seems OT here.

No -2.9c is the actual feedin price for the current 5 minute interval (IE you pay to export), I just use some jq on the feedin forecast to ensure evcc never sees negative prices for the current feedin interval as that mucks up the charging session cost calculations. (car is not earning money by charging because if it wasn't charging the solar would be automatically curtailed and I wouldn't be paying to export - hence being calculated as 0 is correct) Might be better off discussed on #21747

jeffborg avatar Oct 02 '25 05:10 jeffborg