[#100/#102] Expose phase information to dashboard + strategies, optional assignment of batteries to phases
Summary
-
Added optional manual battery-to-phase assignment for Marstek M1-M6:
UnassignedL1L2L3
-
Added dashboard support:
- Overview battery headings now show assigned phase, e.g.
Marstek M1 - Phase 1 - Added
Battery Phase Interactionoverview for liveL1/L2/L3battery power - Phase selectors live only on the Config/Advanced tab
- Added shared
Max phase powersetting for future/custom phase-aware strategies (defaults to 5500W / 25A @ 220V nominal)
- Overview battery headings now show assigned phase, e.g.
-
Added Home Assistant helpers/sensors:
input_select.marstek_m1_phasethroughinput_select.marstek_m6_phaseinput_number.house_battery_control_max_phase_powersensor.house_battery_l1_powersensor.house_battery_l2_powersensor.house_battery_l3_power
-
Added optional install-specific per-phase grid power aliases in
house_battery_control_config.yaml:sensor.p1_meter_l1_powersensor.p1_meter_l2_powersensor.p1_meter_l3_power
-
Updated Node-RED flows to expose:
battery.phasemsg.grid_power_limit_phase- nullable
msg.grid_power_phase.L1/L2/L3
-
Adds a .gitignore for .DS_Store, for any contributors running MacOS
Closes #100
Closes #102
Notes:
The new phase data is exposed for dashboards, future logic, and adventurous custom strategy authors. Built-in strategies do not yet use per-phase limits or perform phase-aware balancing. Doc updates + more extensive testing will be needed before it's safe to actually use this information.
Testing:
- Deployed to my HomeAssistant install & validated that flows behave as expected
- YAML parse passed
- Node-RED JSON validation passed with
jq pwsh -File contribute/check.ps1passed withALL CHECKS PASSED
Screenshots:
Home Page - Shows phase info in headers + adds a "total battery phase interaction" block:
Home Page - Batteries with unassigned phase have old headers:
Config Page - Adds setting for "max power per phase" (currently not included in any strategies) + phase assignments
Timeline
- Between work & family commitments, it's tough to find an hour or two every now and then to progress the PR & it may sit idle for a while (or will require co-authors to jump in)
Thank you so much! I greatly appreciate your work and invested time and I hope the phase based balancing and phase overload protection functionality will someday be realized. A small improvement proposal; the transition in the EU from 220V to 230V started in 1989 and was completed in 2004. The default max phase power could be safely raised to 25A x 230V = 5750W. Is this important, well no, but I regularly max out (and beyond) all 3 phases when my car and ESS batteries are charging simultaneously because price valleys usually only last a few hours, so every amp/watt counts 😀.
The default max phase power could be safely raised to 25A x 230V = 5750W.
IMO, we might want the default set to 5500W to allow for some amount of safety margin for the average user, and people comfortable with running at exactly the rated limit (or having short periods above the current rating of their fuse) can always adjust as needed.
More correctly:
- Overall power limits are likely a concern for Belgian users that don't want to pay a higher CAPTAR rate.
- Per-phase current limits are probably more of a universal concern for NL/BE/DE users, but it's yet another entity to expose + pass through + support, and we'd have to sprinkle in unit conversions to a ton of strategies
My personal phase-monitoring dashboard is oriented more towards current, since that's what the fuse is rated on. IIRC, it's also what Zaptec uses for their charger throttling as well.
Emoji straw-poll for anyone with opinions:
🚀 - let's add in current-monitor entities + plan to include the unit-conversions in the implemented strategies 🎉 - Let's stick to using the simpler power-based entities + calculation
I'm fine going with either approach, but I'm not keen on adding complexity without others wanting it.
Controlling based on current is certainly the intention, although I prefer this to be the calculated current, based on actual voltage and power of each phase, since the p1 meter does not provide decimals for the amperes per phase. I would like to participate in your poll but do not sufficiently understand what you mean by both options. It is my fault, so don't take it personally.
I did some additional reading:
- DSMR meters report wattage in 1W increments & amperage in whole (1A) increments.
- P1 readers like the Homewizard generally will present amperage as a derived
power / voltagevalue, rather than what the meter exposes
If we did eventually support amperage-based phase protection, it's therefore probably best to stick to power entity inputs, additionally collect voltage entity inputs, and then add a "max phase current" setting.
Thanks for implementing this!!
Ideally, I would also like a "max phase current" setting. The main circuit breaker trips on to much current, not power.
Voltage fluctuates a lot here, I see 235V to 245V (and more) regulary while PV is injecting current.
TODO: AC Power should be used for the phase-aggregates in the dashboard, rather than battery power.
Defer to another PR, at another time: Also consider exposing the P1 power readings so that it's possible to see at a glance how loaded each phase is AND what the batteries are doing.
Ready for review / merge