Loadpoint: adapt UI for integrated and switch devices#30909
Conversation
Integrated devices have no charging session, so the charged energy value is no longer shown. Switch devices have no current control, so the Min+Solar mode and the charging current settings are hidden.
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Mode.vue now expects a
switchDeviceprop, but the diff doesn’t show it being passed from the parent (e.g. Loadpoint.vue), so please ensure this prop is wired through wherever<Mode>is used or the new Min+Solar logic will never activate. - The Playwright assertion
modal.getByText("Charging Current")is tightly coupled to the English label; consider using a data-testid (as done elsewhere) to make the test resilient to localization changes. - The code now uses
integratedDevice,switchDevice, andchargerFeatureSwitchDevice; it may be worth aligning the naming (or adding brief comments) to clearly distinguish these concepts and reduce confusion for future changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Mode.vue now expects a `switchDevice` prop, but the diff doesn’t show it being passed from the parent (e.g. Loadpoint.vue), so please ensure this prop is wired through wherever `<Mode>` is used or the new Min+Solar logic will never activate.
- The Playwright assertion `modal.getByText("Charging Current")` is tightly coupled to the English label; consider using a data-testid (as done elsewhere) to make the test resilient to localization changes.
- The code now uses `integratedDevice`, `switchDevice`, and `chargerFeatureSwitchDevice`; it may be worth aligning the naming (or adding brief comments) to clearly distinguish these concepts and reduce confusion for future changes.
## Individual Comments
### Comment 1
<location path="tests/heating.spec.ts" line_range="46-48" />
<code_context>
+ test("no current settings in loadpoint settings", async ({ page }) => {
+ const lp = page.getByTestId("loadpoint").first();
+ await lp.getByTestId("loadpoint-settings-button").last().click();
+ const modal = page.getByTestId("loadpoint-settings-modal").first();
+ await expectModalVisible(modal);
+ await expect(modal.getByText("Charging Current")).toHaveCount(0);
+ });
+});
</code_context>
<issue_to_address>
**suggestion (testing):** Use a more stable selector than plain text for the Charging Current setting.
Using `getByText("Charging Current")` ties the test to copy and localization. Prefer targeting this control via a test ID or a stable role/name (e.g., the form field’s accessible label) and assert that that specific control is absent for switch devices, so the test stays behavior-focused and less flaky.
Suggested implementation:
```typescript
test("no current settings in loadpoint settings", async ({ page }) => {
const lp = page.getByTestId("loadpoint").first();
await lp.getByTestId("loadpoint-settings-button").last().click();
const modal = page.getByTestId("loadpoint-settings-modal").first();
await expectModalVisible(modal);
// switch device has no current control in settings
await expect(
modal.getByTestId("loadpoint-settings-current-control"),
).toHaveCount(0);
});
});
```
To fully implement this change you will also need to:
1. Add a stable test id to the “Charging Current” control in the loadpoint settings UI, for example:
- `data-testid="loadpoint-settings-current-control"` on the form field wrapper (or the primary input element).
2. Ensure this `data-testid` is only rendered for devices that support configurable charging current so the test remains behavior-focused.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@naltatis this is pretty extensive- not sure you want to take a look? Feel free to close. |
|
This indeed mixes some topics from the heating epic, the mode redesign and the mini loadpoints (consumer) concept. I'll go through this and see if we can extract some quick wins as individual PRs. |
|
Fine if not, just need to update the issue then. |
|
Please hold your horses on this one: Reason: see |
|
The only thing minPV does is keep the switch active if there's no current control. It doesn't do anything for demand afaikt. |
For switch-devices (simple on/off devices), there is no difference between fast-mode or min+pv?! In fact, the min+pv behavior does not exist, because the device can only be switched on or off. |
|
Updated the implementation and PR description. Added screenshots. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@RenatusRo I was not able to verify this. For switch devices fast mode should give you the same behavior as minpv does. |
yes, neither was me - it looks like my mental model diverged from reality :-( |
What about battery hold? Is active in fast mode, but not in minpv. |
|
Thats more a coincidence than a feature… |
|
I have a question about this implementation: i thought the calculation of min power (for pv mode) is done via "standbypower = -2000" for instance? The disadvantage of this approach is, that i had to configure the dedicated energy meter, to measure the actual power. |
No.
Min Current is a property of the IEC protocol- depending on phases this means min power. |
|
But thats how it is described in the documentation: https://docs.evcc.io/de/smartswitches/ |
|
@florian240483 I extended the docs to make the different jobs of standby and mincurrent more clear evcc-io/docs#1091 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@naltatis good to merge? |
|
yes |
|
I like the changes a lot! My heat pump feels less like a car charger now. |
|
One more thought: for |
Yes, a rename is coming. Solar mode is also awkward for users with only a home battery. |
|
Is there a way to make the minPV (minimum solar charging) option reappear via a configuration entry if it has disappeared? I built a custom automation for this since my wallbox is not supported by evcc. |
|
Why would it disappear for a wallbox in the first place? |
|
With my wallbox itself, it is not possible to control the current regulation via evcc. However, the wallbox has its own 'min solar' mode, which I have been calling up via a Home Assistant automation as soon as I select the menu item in evcc. Therefore my question: is there a possibility to display this menu item again? |
fixes #30897
see docs evcc-io/docs#1091
Integrated devices (e.g. a heat pump on a switch socket) reused the regular charger UI, which exposed controls that do not apply to them. This adapts the loadpoint UI to the charger feature flags that the backend already publishes.
hide the charged energy value for integrated devices (no charging session)We swap with metrics data once stable (energy today, ...).current settingsmax current setting in loadpoint settings for switch devices. min current and phases are still required to calculate min power (pv mode)Screenshots
Config UI: switch device > no current control

Config UI: drop min/max current, charger type section

Main UI: no minpv mode for switch devices

Loadpoint Settings: drop max current

👮 Note: Dropping max current setting will force
minCurrentto stay under 16A (maxCurrentdefault, removed from UI). Still changeable via API.TODO
Out of scope
minCurrent(+phases?) by something likeminPower. @andig