[#100/#102] Expose phase information to dashboard + strategies, optional assignment of batteries to phases - #139
Conversation
|
Thank you so much! |
|
Emoji straw-poll for anyone with opinions: 🚀 - let's add in current-monitor entities + plan to include the unit-conversions in the implemented strategies 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:
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 |
main re-exported both `01 start-flow.json` and `all-flows-in-one-file.json`
from Node-RED with entirely new node IDs (only 3 of 620 base IDs survive in
the combined file), so the textual conflicts were not meaningful. Both flow
files were resolved by taking main's export as the new baseline and
re-applying this branch's changes against the remapped IDs:
- 6 new nodes: Phase template, Phase, Max phase power,
Normalize phase limit, Phase grid power, Normalize phase power
- "Mapping": normalize + emit battery.phase
- "Loop end": clean up msg.battery_phase / msg.template
- "Energy max" -> Phase template (phase lookup ahead of Mapping)
- "Export limit" -> Max phase power (phase chain ahead of Battery Strategy)
- group "Peak shave settings": +4 members, widened to 1642
Verified main made no semantic change to any node this branch touches, so
the remap is the whole conflict.
house_battery_control.yaml: kept the new phase-assignment binary sensor and
accepted main's removal of the dynamic-v1 "Is below threshold cheapest
period tariff" sensor (nothing references it anymore).
.gitignore: union of both sides, de-duplicated .DS_Store.
contribute/check.ps1 passes.
"Phase template" and "Phase" carried g="Loop" (the battery information loop) but were never listed in that group's nodes[], and sat outside its bounds. Node-RED drives the runtime from the wires, so this was editor-only: the nodes did not move or collapse with the group. Add both to the group and widen it from 1612 to 1942, keeping the group's existing 96px right padding. The parent "Get batteries information" group grows 1678 -> 2008 so it still contains the nested group with its original margin; no other group on the tab is overlapped. Applied to both 01 start-flow.json and all-flows-in-one-file.json.

Summary
Added optional manual battery-to-phase assignment for Marstek M1-M6:
UnassignedL1L2L3Added dashboard support:
Marstek M1 - Phase 1Battery Phase Interactionoverview for liveL1/L2/L3battery powerMax phase powersetting for future/custom phase-aware strategies (defaults to 5500W / 25A @ 220V nominal)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_powerAdded 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_powerUpdated Node-RED flows to expose:
battery.phasemsg.grid_power_limit_phasemsg.grid_power_phase.L1/L2/L3Adds 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:
jqpwsh -File contribute/check.ps1passed withALL CHECKS PASSEDScreenshots:
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