Skip to content

HEMS: add custom implementation - #32187

Open
andig wants to merge 1 commit into
masterfrom
feat/hems-custom
Open

HEMS: add custom implementation#32187
andig wants to merge 1 commit into
masterfrom
feat/hems-custom

Conversation

@andig

@andig andig commented Jul 27, 2026

Copy link
Copy Markdown
Member

fixes #32182

Adds a custom HEMS that sources its limits from plugins instead of fixed config values, so an external logic (http, mqtt, modbus, gpio, …) can supply them at runtime:

hems:
  type: custom
  maxconsumptionpower: # total load limit (W), 0 = no limit
    source: http
    uri: http://steuerbox.local/api/limit
    jq: .maxPower
  curtailedpercent: # allowed feed-in (0..100), 100 = uncurtailed
    source: mqtt
    topic: hems/curtail/percent
  productionnominalmax: 10000 # nominal production power (W), required with curtailedpercent
  interval: 10s

Both plugins are optional, at least one is required. Values are polled every interval and mapped onto api.HEMS the same way fnn does it — curtailedpercent drives both CurtailedPercent() and MaxProductionPower() so the two cannot contradict each other. Dim and curtail sessions are recorded via smartgrid.UpdateSession like the existing integrations.

Note on the original request: getmaxcurrent has no equivalent in api.HEMS, which is watt-based only, so only power limits are covered.

Failsafe behaviour is deliberately left out pending the semantics discussion — a failing plugin read is logged and the previous limit is retained. Out-of-range values (negative power, percent outside 0..100) are rejected the same way.

🤖 Generated with Claude Code

@andig andig added the enhancement New feature or request label Jul 27, 2026
@andig

andig commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

@naltatis need to decide how to present the custom choices and which one should be default.

@andig

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Build finished.

@SolarPower2024

SolarPower2024 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

thanks for helping it build with Github Bot.

tested and confirm that it´s working.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR add getmaxpower / getmaxcurrent to HEMS

3 participants