Skip to content

Priorities

The priority list is the core of Hanergy's decision-making. It answers the question: when solar surplus is available, which devices should benefit from it, in what order, and to what degree?


The Waterfall Model

The priority list is an ordered sequence of entries, evaluated from top to bottom on every engine cycle:

  1. Starting with the highest-priority entry (position 1), the engine checks whether surplus is sufficient and whether the entry's conditions are met.
  2. If the entry can be activated, the engine allocates the required power and subtracts it from the remaining available surplus.
  3. The engine moves to the next entry and repeats with whatever surplus remains.
  4. Entries further down the list only receive power if everything above them has been satisfied or if surplus is large enough to serve multiple entries simultaneously.

Surplus flows from the top of the list downward — like water cascading through a series of buckets. Lower-priority devices only run if higher-priority devices are already running or already satisfied.


Priority Entry Fields

Each entry in the priority list links a device to a set of activation conditions:

Field Required Description
Device Yes The device this entry controls. Must match a configured device.
Min Surplus (W) Yes Minimum watts of surplus that must be available before this entry activates. Acts as a gate — even for the highest-priority entry, the engine will not activate it unless at least this many watts are available (after subtracting the surplus buffer).
Setpoint No Parameter value to use when this entry is active (dynamic devices only). If omitted, the engine calculates the optimal setpoint based on available surplus. Useful for locking a specific charge rate at a given priority position.
Threshold No Target value for the device's feedback entity. The engine considers this entry "satisfied" when the feedback reading meets or exceeds this value. Omit for devices that should run whenever surplus is available.
Enabled Yes Set to disabled to temporarily skip an entry without removing it from the configuration.

Load Shedding

When surplus decreases — due to cloud cover, increased household consumption, or production dropping toward sunset — the engine sheds devices in reverse priority order: the lowest-priority active device is shed first, preserving the operation of higher-priority devices for as long as possible.

The shedding process works differently depending on device type:

  • Dynamic devices are stepped down before being switched off. The engine first reduces the setpoint toward the minimum. If the reduced power still exceeds available surplus, the engine switches the device off entirely.
  • Fixed and deferred devices are switched off immediately when shedding reaches their priority entry.
  • The minimum on-time guard prevents a device from being shed if it was activated less than the configured minimum on-time ago. The engine skips it and continues to the next lower-priority device.

Stability in variable conditions

In rapidly changing conditions (e.g., intermittent cloud cover), lower-priority devices bear the brunt of the variability while higher-priority devices remain stable.


Multi-Level Priorities

One of the most powerful patterns in Hanergy is placing the same device at multiple positions in the priority list with different thresholds and setpoints. This expresses nuanced strategies: charge at a modest rate to meet a baseline target first, then charge at maximum rate to top up fully only when excess surplus is available.

Example Priority List

Consider a household with an EV charger, a home battery, a heat pump, and a pool pump:

Position Device Min Surplus Setpoint Threshold Goal
1 EV Charger 1,400 W 16 A 60% SOC Baseline charge to 60%
2 Home Battery 500 W 80% SOC Charge battery to 80%
3 Heat Pump DHW 1,000 W 50 °C Heat water to 50 °C
4 EV Charger 3,000 W 32 A 80% SOC Boost charge to 80%
5 Pool Pump 800 W Run when surplus allows
6 Home Battery 500 W 100% SOC Top up battery to 100%

Notice that both the EV Charger (positions 1 and 4) and the Home Battery (positions 2 and 6) appear twice — each time with a different threshold and, for the EV, a different setpoint.


Walking Through a Typical Solar Day

Using the priority list above, here is how the engine behaves as production changes throughout the day.

Early morning — Production: 500 W, Surplus: 200 W

Surplus is below every entry's minimum. No devices activate. The household runs from solar production alone.

Mid-morning — Production: 2,500 W, Surplus: 1,600 W

The engine evaluates entry 1 (EV Charger). Surplus (1,600 W) exceeds 1,400 W and the EV SOC is below 60%. The engine activates the charger at 16 A (~1,380 W). Remaining surplus: ~220 W.

Entry 2 (Home Battery) requires 500 W — not enough remaining. Evaluation stops.

Late morning — Production: 4,500 W, Surplus: 3,200 W

Entry 1 is still active (EV at 45% SOC). The charger consumes ~1,380 W at 16 A. Remaining: ~1,820 W.

Entry 2 (Home Battery) requires 500 W — activated. Battery charges at ~800 W. Remaining: ~1,020 W.

Entry 3 (Heat Pump) requires 1,000 W — just satisfied. Heat pump activates at ~900 W. Remaining: ~120 W.

Entries 4-6 require more surplus than is available. Not activated.

Solar peak — Production: 8,000 W, Surplus: 6,500 W

Entry 1: EV has reached 60% SOC — satisfied. No power allocated. The engine moves on.

Entry 2: Battery at 78% — still active. ~800 W allocated. Remaining: ~5,700 W.

Entry 3: Tank at 52 °C — satisfied. Heat pump stops. Remaining: ~5,700 W.

Entry 4: EV at 63%, below the 80% threshold. Surplus (5,700 W) exceeds 3,000 W. Engine activates the charger at 32 A. Remaining: ~2,700 W.

Entry 5: Pool pump requires 800 W — activated. Remaining: ~1,900 W.

Entry 6: Battery at 78%, threshold 100%. Engine directs remaining surplus to battery charging.

Afternoon decline — Production: 3,000 W, Surplus: 1,200 W

Shedding begins in reverse order. Entry 6 (battery top-up) sheds first. Then entry 5 (pool pump). Then entry 4 (EV boost). The engine works back up the list, preserving higher-priority devices for as long as possible.


Threshold Behavior

A priority entry with a threshold is considered "satisfied" when the device's feedback entity reading meets or exceeds the threshold value.

Once satisfied:

  • The engine does not allocate surplus to that entry.
  • The device may still be active if a different priority entry (at a lower position) referencing the same device is active.
  • The entry returns to "unsatisfied" if the feedback sensor drops below the threshold (e.g., the EV discharges overnight and the SOC falls below 60%), at which point the engine reactivates it on the next evaluation cycle.

Smoothing applies to thresholds

The EMA smoothing applied to sensor readings (via the smoothing alpha in engine settings) also applies before threshold comparisons. This prevents a single noisy sensor reading from causing premature satisfaction or reactivation.


Practical Tips

Start with conservative min surplus values

It is safer to start high and lower the threshold over time than to activate a device prematurely and cause grid import. Remember that the surplus buffer is subtracted first, so if the buffer is 100 W and min surplus is 1,400 W, the device will not activate until raw surplus exceeds 1,500 W.

Put critical loads at higher priority

Home batteries and EV chargers that need to reach a daily minimum SOC should sit at the top of the list. Pool pumps, supplementary heating, and "nice to have" loads belong lower.

Disable entries seasonally

In winter, solar production may not reach lower-priority entries at all. Rather than deleting those entries, disable them. Re-enable them in spring without reconfiguring from scratch.

Aim for 5-10 priority entries

More entries increase evaluation complexity and can make it harder to reason about what the engine will do. If you find yourself writing 15+ entries, consider whether some devices can share an entry or whether the goals can be simplified.

Test with small loads first

Add a pool pump or a small fixed load first, observe that the engine activates and sheds it correctly, then add more complex dynamic loads.