Skip to content

Charger: tag templates with meter capability#29536

Merged
andig merged 4 commits intomasterfrom
feat/charger-meter-capability
May 5, 2026
Merged

Charger: tag templates with meter capability#29536
andig merged 4 commits intomasterfrom
feat/charger-meter-capability

Conversation

@andig
Copy link
Copy Markdown
Member

@andig andig commented May 1, 2026

Summary

  • Introduces a new meter template capability (util/templates/types.go)
  • Tags 99 charger templates whose Go implementation unconditionally exposes CurrentPower() — either via a direct struct method or a decorator that is always wired with a non-nil currentPower argument
  • Chargers that only conditionally provide CurrentPower (e.g., feature/register-detection, optional power: block, sponsor-gated, optional URL) are intentionally not tagged

Closes #11692

Categories of touched templates

  • Direct struct method: abb, abl-em4, alfen, alpitronic, amperfied, chargex, compleo (+ senec/neoom variants), dadapower, daheimladen (+ pro), delta, e3dc-rscp, easee, em2go (+ home/duo), eprowallbox, etrel (+ duo), evecube, evsemaster-udp, fronius-wattpilot, hardybarth-ecb1, heidelberg, hesotec, innogy-ebox, kathrein, kse, lektrico, mennekes-compact, mennekes-hcc3, mypv (ac-elwa-2/ac-thor/ac-elwa-e), nexblue, nrggen2, nrgkick (bluetooth/connect), openevse, openwb (+ 2.0/pro), pantabox, peblar, plugchoice, pulsatrix, raedian, schneider-evlink-v3, semp (+ semp-sma), shelly-topac, sigenergy, smaevcharger, smartevse, solax (+ g2), sungrow, tessie, twc3, v2c, versicharge, vestel, victron (+ evcs), voltie, volttime, webasto-next, weidmüller, zaptec
  • Switchsocket pattern with always-bound CurrentPower: fritzdect, homematic, homewizard, mystrom, shelly, tasmota, tapo, tplink, shelly-topac
  • EEBus chargers that always render meter: true: eebus, elli-2, elli-charger-pro, ghost, porsche-pmcc/pmcp/wallbox
  • Heatpump templates with always-rendered power: block: askoheat, idm, kermi, lambda-zewotherm, mtec
  • sgready: emsesp
  • Wallbe variants with meter.power: true always set: wallbe-meter, wallbe-pre2019-meter
  • smartwb (renders evsewifi with meter.power: true)

Skipped (conditional CurrentPower)

  • All OCPP variants (powerG only set on HasMeasurement(PowerActiveImport))
  • abl, bender (cc/icc), cfos, etek, hardybarth-salia, keba-modbus (+p40), keba-udp, pcelectric (+ garo), phoenix-charx/em-eth/ev-eth, smart-evse, vanilla wallbe.yaml/wallbe-pre2019, warp-* (tinkerforge/warp-ws/warp2/warp3), evsewifi
  • vaillant (depends on remote API response)
  • sgready templates without power: (daikin-homehub-air2air, daikin-homehub, glen-dimplex, lg-therma, luxtronik, nibe-s-series, stiebel-lwa, stiebel-wpm, viessmann, weishaupt-wpm), heatpump templates without power: (ochsner-bwwp, xtherma)
  • homeassistant.yaml (power is optional/advanced), homeassistant-switch (standbypower<0 disables it)

Skipped (no CurrentPower at all)

  • alphatec, evsedin, obo, openwb-native, phoenix-ev-ser, pracht-alpha, pulsares, sgready-relay, vehicle-api, switchsocket (generic), demo-charger, demo-heatpump, icharge-cion

Test plan

  • go build ./... clean
  • go test ./util/templates/... passes (capability validation lints all entries)
  • Verify the docs site picks up the new meter capability tag for filtering once make docs regenerates

…conditional

Adds a new "meter" template capability and tags every charger
template whose Go implementation always exposes CurrentPower (i.e.,
either via a direct struct method or a decorator that is always wired
with a non-nil currentPower). Chargers that conditionally provide
CurrentPower (depending on register/feature checks, optional config,
or sponsorship) are not tagged.

Closes #11692

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
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 - I've left some high level feedback:

  • The PR description says Smart EVSE variants were intentionally skipped due to conditional CurrentPower, but smartevse.yaml is tagged with meter; please double‑check whether this template should really advertise an unconditional meter capability or adjust the description.
  • For many of the updated YAML templates the capabilities arrays now have a mixed order (e.g., `['mA', 'rfid', '1p3p', 'meter'] vs earlier patterns); consider standardizing the ordering (alphabetical or by importance) to keep future diffs smaller and the templates easier to scan.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The PR description says Smart EVSE variants were intentionally skipped due to conditional `CurrentPower`, but `smartevse.yaml` is tagged with `meter`; please double‑check whether this template should really advertise an unconditional meter capability or adjust the description.
- For many of the updated YAML templates the `capabilities` arrays now have a mixed order (e.g., `['mA', 'rfid', '1p3p', 'meter'] vs earlier patterns); consider standardizing the ordering (alphabetical or by importance) to keep future diffs smaller and the templates easier to scan.

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.

@andig andig added the infrastructure Basic functionality label May 1, 2026
Sort capabilities consistently as iso151182, mA, rfid, 1p3p, meter to
match the order in ValidCapabilities and keep future diffs stable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@andig andig requested a review from premultiply May 1, 2026 12:58
@andig andig added devices Specific device support needs documentation Triggers issue creation in evcc-io/docs labels May 1, 2026
@andig
Copy link
Copy Markdown
Member Author

andig commented May 1, 2026

Addressing the review feedback:

  • smartevse vs smart-evse: those are two separate chargers. smartevse.yaml renders type: smartevse (the modbus-based smartEVSE charger in charger/smartevse.go, which has CurrentPower as a direct struct method — unconditional). The skipped one is smart-evse.yaml rendering type: smart-evse (HTTP-based, conditional). The PR description's "smart-evse" entry was the one intended in the skip list.
  • Capability ordering: pushed a follow-up commit that sorts capabilities consistently as iso151182, mA, rfid, 1p3p, meter (matching the order in ValidCapabilities) across all 30 affected templates. New diffs in this area will stay stable from now on.

@andig andig requested a review from naltatis May 1, 2026 12:58
@@ -9,6 +9,7 @@ products:
description:
de: Pro (vor ~2019, ohne Strommessgerät)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@premultiply hier passt was nicht?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Die wallbe*-Implementierungen/Templates sind völlig veraltet und können ganz raus. Das läuft alles einheitlich über phoenix-ev-eth.

@andig
Copy link
Copy Markdown
Member Author

andig commented May 1, 2026

@copilot resolve the merge conflicts in this pull request

…capability

# Conflicts:
#	templates/definition/charger/eebus.yaml
#	templates/definition/charger/porsche-pmcc.yaml
#	templates/definition/charger/porsche-pmcp.yaml

Co-authored-by: andig <184815+andig@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 9f998f0. The conflicts were in eebus.yaml, porsche-pmcc.yaml, and porsche-pmcp.yaml — all from the same master commit that dropped the unused evcc: ["eebus"] requirement entries. The resolution keeps our meter capability additions while incorporating master's requirement cleanup.

Copilot finished work on behalf of andig May 1, 2026 16:11
@tolot27
Copy link
Copy Markdown
Contributor

tolot27 commented May 2, 2026

Would it be useful to implement a meter type attribute for standard, MID, Eichrecht? The later two could be suffixed with "-conform".

@andig
Copy link
Copy Markdown
Member Author

andig commented May 4, 2026

@copilot resolve the merge conflicts in this pull request

…capability

# Conflicts:
#	templates/definition/charger/openwb-2.0.yaml

Co-authored-by: andig <184815+andig@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in cf7c6cb. One real conflict in openwb-2.0.yaml (master intentionally removed rfid, we had added meter; kept meter, dropped rfid). Also added capabilities: ["meter"] to stiebel-wpm.yaml now that master's "Stiebel WPM: re-add power" commit restored its unconditional power: block.

Copilot finished work on behalf of andig May 4, 2026 18:41
Copy link
Copy Markdown
Member

@naltatis naltatis left a comment

Choose a reason for hiding this comment

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

LGTM

@andig andig merged commit 19cdc8b into master May 5, 2026
10 checks passed
@andig andig deleted the feat/charger-meter-capability branch May 5, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support infrastructure Basic functionality needs documentation Triggers issue creation in evcc-io/docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: add meter label for chargers

5 participants