Hanergy vs EMHASS: Simple Priorities vs Linear Programming
Hanergy vs EMHASS: Simple Priorities vs Linear Programming
The Home Assistant community has two main approaches to solar surplus management: Hanergy’s priority cascade and EMHASS’s linear programming optimizer. Both are capable tools, but they solve the problem in fundamentally different ways. This article provides an honest comparison to help users choose the right fit.
Two Different Philosophies
Hanergy uses a priority cascade. The user defines an ordered list of loads. Every 10 seconds, the engine checks available surplus and works through the list top to bottom: if there is enough surplus for load 1, activate it. If surplus remains, move to load 2. When surplus drops, shed loads in reverse order. The logic is deterministic and inspectable — every decision maps directly to the priority list.
EMHASS (Energy Management for Home Assistant) uses linear programming with cost functions. The user defines cost functions for each load, provides production forecasts (typically from Solcast), and configures electricity tariff schedules. A solver then computes an optimal schedule that minimizes total cost over a planning horizon — typically 24 hours.
Configuration Complexity
This is where the two tools diverge most sharply.
Hanergy configuration requires three things per load: the Home Assistant entity, the load type (dynamic, fixed, or deferred), and its position in the priority list. Optional settings include power thresholds, anti-cycling timers, and feedback sensors. Most users complete setup in under 10 minutes.
EMHASS configuration requires defining cost functions for each deferrable and non-deferrable load, setting up a Solcast or weather API account for production forecasts, configuring electricity tariff schedules (potentially with time-of-use rates), and tuning optimizer weights. The initial setup typically takes several hours, and fine-tuning can extend over days or weeks.
Real-Time vs. Planned Control
Hanergy operates in real time. Every 10 seconds, it reads current sensor values and makes allocation decisions based on actual conditions. If a cloud passes, the response is near-instant. If someone turns on the oven, surplus recalculation happens within 10 seconds.
EMHASS operates on a planning horizon. The solver runs periodically (typically every 5-30 minutes) and produces a schedule based on forecasted production and consumption. Between solver runs, the schedule is static. Real-time deviations from the forecast are not automatically corrected until the next solver run.
This difference matters most in climates with variable cloud cover, where solar production changes rapidly throughout the day.
Forecasting Dependency
Hanergy requires zero external APIs or forecasts. It works entirely with real-time data from Home Assistant sensors — solar production, grid import, grid export, and optionally total consumption. This means it works offline and has no dependency on third-party services.
EMHASS depends on accurate production forecasts for optimal performance. Poor forecasts lead to suboptimal schedules. Solcast provides reliable forecasts in many regions, but accuracy varies and the free tier has API call limits. Users in regions with poor forecast coverage may find EMHASS less effective.
Where EMHASS Excels
EMHASS has clear advantages in specific scenarios:
- Complex tariff optimization. When electricity pricing varies significantly throughout the day (time-of-use tariffs, dynamic pricing, negative pricing), EMHASS can schedule loads to coincide with the cheapest periods. Hanergy does not consider electricity pricing — it allocates surplus as it appears.
- Day-ahead scheduling. For loads that benefit from advance planning (e.g., “charge the battery tonight because tomorrow will be cloudy”), EMHASS can incorporate weather forecasts into its decisions. Hanergy responds only to current conditions.
- Global optimization. The linear programming solver can find globally optimal solutions that consider interactions between all loads simultaneously. Hanergy’s greedy cascade evaluates loads sequentially, which can miss opportunities that a global optimizer would catch.
Where Hanergy Excels
Hanergy has clear advantages in other scenarios:
- Rapid response. The 10-second evaluation cycle means decisions are made on actual data, not predictions. Cloud transients, sudden consumption changes, and production ramps are handled in near real time.
- Simplicity. The priority list is self-documenting. “EV charges first, then heat pump, then pool pump” is immediately understandable. Debugging means reading the decision timeline, not interpreting solver output.
- No external dependencies. No Solcast account, no weather API keys, no internet requirement. Hanergy works on an air-gapped Home Assistant instance.
- Predictability. Given the same inputs, Hanergy always makes the same decision. There is no optimizer randomness, no solver convergence issues, and no sensitivity to forecast accuracy.
Can Both Run Together?
Yes, and some users find this combination effective. EMHASS handles day-ahead planning — determining optimal time windows for each load based on forecasts and tariffs. Hanergy handles real-time allocation within those windows — dynamically adjusting charge rates and activating loads based on actual surplus.
This approach provides strategic scheduling from EMHASS and responsive real-time control from Hanergy, covering scenarios that neither tool handles optimally alone.
Choosing the Right Tool
Choose Hanergy if: real-time response matters, simplicity is valued, external API dependencies are undesirable, or the setup needs to be completed quickly.
Choose EMHASS if: complex tariff optimization is the primary goal, day-ahead scheduling provides significant value, or global cost minimization across all loads is more important than real-time responsiveness.
Choose both if: strategic scheduling and real-time control are both important, and the additional configuration effort of running two systems is acceptable.
Further Reading
- Hanergy vs EMHASS comparison page — at-a-glance comparison table
- Get started with Hanergy — installation and setup guide
- View pricing — free tier includes 2 devices
- EMHASS documentation — official EMHASS docs