Skip to content

feat(controls): EMS export + flexi parity, RTC and active-power knobs#83

Merged
dewet22 merged 1 commit into
mainfrom
feat/ems-inverter-parity-knobs
May 31, 2026
Merged

feat(controls): EMS export + flexi parity, RTC and active-power knobs#83
dewet22 merged 1 commit into
mainfrom
feat/ems-inverter-parity-knobs

Conversation

@dewet22

@dewet22 dewet22 commented May 31, 2026

Copy link
Copy Markdown
Owner

EMS / inverter control parity

Surfaces the GE-Cloud control knobs the integration was missing — limited to those where givenergy_modbus provides both a setter and a readable model field (real state, no write-only controls).

Bumps the givenergy-modbus floor a8 → a11, which brings the two pieces this needed: the EMS export slot setters (modbus #143) and the Ems.plant_enabled boolean read-back (modbus #145, added in response to the parity handoff).

Added

  • Real Time Control switch — set_enable_rtc / inv.enable_rtc
  • Inverter Max Output Active Power % number — set_active_power_rate / inv.active_power_rate
  • EMS Export Slot 1–3 — start/end times (set_ems_export_slot_*) and target SoC (set_ems_export_target_soc), completing export parity with the charge/discharge slots; one-word extensions of the existing EMS time/number factories
  • Flexi EMS Control switch — set_ems_plant / ems.plant_enabled; adds EMS-scoped switch support, gated on coordinator.data.ems

Notes / not included

  • Battery Cutoff % already exists (as "Battery Discharge Min Power Reserve" → set_battery_power_reserve).
  • Export power limit deferred — the library only bounds it at the raw 0–65535 W; a sensible UI range needs GivTCP/Nick evidence.
  • _ac charge/discharge limit variants and a Set Date/Time service deferred as follow-ups.
  • The self-heating / winter-conditioning / EPS / export-priority knobs remain blocked on a hardware capture (modbus fix(sensor): floor e_consumption_today to 1 dp to prevent TOTAL_INCREASING dips #144) — no library register yet.

Source: GE Cloud portal "EMS setup" (EMS + 2-inverter plant) on #52. 149 tests pass; mypy-neutral; full suite green against a11.

🤖 Generated with Claude Code

Bumps the givenergy-modbus floor to 2.1.0a11 (brings the EMS export slot
setters from modbus #143 and the Ems.plant_enabled read-back from #145)
and adds the GE-Cloud control knobs they unlock, plus the inverter knobs
already available:

- Real Time Control switch (set_enable_rtc / inv.enable_rtc)
- Inverter Max Output Active Power % number (set_active_power_rate)
- EMS Export Slot 1-3: start/end times + target SoC, completing export
  parity with the charge/discharge slots (one-word extensions of the EMS
  time/number factories)
- Flexi EMS Control switch (set_ems_plant / ems.plant_enabled) — adds EMS
  switch platform support, gated on coordinator.data.ems

Source: GE Cloud portal "EMS setup" view (EMS + 2 inverters) on #52.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@dewet22, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 36 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 72e7a11c-2c2d-460a-bec2-67f416be76fb

📥 Commits

Reviewing files that changed from the base of the PR and between 08f71a0 and d5e49e6.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • custom_components/givenergy_local/manifest.json
  • custom_components/givenergy_local/number.py
  • custom_components/givenergy_local/switch.py
  • custom_components/givenergy_local/time.py
  • pyproject.toml
  • tests/test_ems.py
  • tests/test_number.py
  • tests/test_switch.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ems-inverter-parity-knobs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the "givenergy-modbus" dependency to version "2.1.0a11" and introduces several new entities and controls. Specifically, it adds support for EMS export slots (including start/end times and target SoC numbers), a new "Inverter Max Output Active Power" (active_power_rate) number entity, a "Real Time Control" (enable_rtc) switch, and a "Flexi EMS Control" (ems_plant_enable) switch. Corresponding unit tests have been added or updated to verify the behavior of these new entities. There are no review comments, so I have no feedback to provide.

@dewet22-codex dewet22-codex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. I reviewed the current head and do not have any actionable concerns. I ran uv run pytest -q (148 passed), uv lock --check, and targeted ruff on the changed files; the GitHub checks are also green.

@dewet22 dewet22 merged commit 433598a into main May 31, 2026
9 checks passed
@dewet22 dewet22 deleted the feat/ems-inverter-parity-knobs branch May 31, 2026 14:04
dewet22 added a commit that referenced this pull request Jun 4, 2026
… totals (#121)

* feat: dashboard PR A — Smart Load, AC-Coupled, mode controls, battery totals

Closes high-priority gaps between exposed entities and the generated dashboard:

- Smart Load slots 1–10 on Controls (`has_smart_load` kwarg; defaults
  open until givenergy-modbus exposes a capability we can gate on per
  #181 / 2.1.3 — wired through with a TODO).
- AC-Coupled card on Controls (export priority, EPS, AC charge/discharge
  limits) gated by `has_ac_config_block` from PlantCapabilities.
- Mode card additions: Real Time Control, Inverter Max Output Power.
- Energy → All-Time Totals: Battery Charged / Battery Discharged.
- Bumps DASHBOARD_VERSION to 8 so the Repairs prompt fires on existing
  installs. Refs #52, #76, #83, #89, #90, #106.

* fix: align has_ac_config_block gating with entity registration

Exclude three-phase systems from the AC-coupled card — switch.py and
number.py both gate AC-coupled entities on `not caps.is_three_phase`, so
the dashboard flag must match.  Also replace EN DASH characters in
docstrings with plain ASCII hyphens (ruff RUF002).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants