Skip to content

How data updates work

This guide explains how HAEO keeps its recommendations current. Use it to understand where the data comes from, what prompts an optimization, and how to give the system a gentle nudge when needed.

How HAEO receives data

HAEO uses an intermediate input entity layer to receive data from external sensors. Each configuration field you set, whether to a constant or to sensors, creates a corresponding input entity (Number or Switch) in Home Assistant. These input entities load values from external sensors you select, transform them as needed, and make them available with a forecast attribute containing time-series data.

Input entities operate in one of two modes:

  • Editable: Constant value you configure directly (e.g., battery capacity)
  • Driven: Value loaded from an external sensor or forecast (e.g., electricity prices)

You can find input entities in Home Assistant's entity list with the config entity category. Their entity IDs combine the element's name with the field's display name, so the capacity of a battery named "Battery" is number.battery_capacity.

What triggers an optimization

HAEO runs a new optimization when either of the following happens:

  • An input entity's state changes (new data arrives from a tracked sensor).
  • The optimization horizon advances past a period boundary.

The system is event-driven with guaranteed updates when the horizon advances (for example, every minute with a preset horizon, or whenever a horizon sensor changes). When sensor data changes between boundaries, the corresponding input entity updates, which triggers a new optimization.

To avoid running multiple optimizations in quick succession, HAEO uses internal debouncing. Related updates that arrive close together are grouped, and optimization runs after activity settles.

Manual refresh options

Sometimes you want the latest recommendation right away. Run the haeo.optimize action to start a new optimization immediately. It skips the waiting period and runs even when the Auto optimize switch is off.

Troubleshooting stale data

If the values stop moving, first check your input entities:

  1. Navigate to Developer Tools → States
  2. Search for number. or switch. prefixed with your element names to find input entities
  3. Verify each input entity shows a valid state and has a forecast attribute with time-series data

If input entities show valid data but sensors still seem stale:

  • Confirm the upstream source sensors are still reporting
  • Check that HAEO is loaded without issues in the Integrations screen
  • A quick manual refresh tests whether the optimizer can run with available data

Persistent problems usually point to missing inputs or external services that need attention.

Monitor your system occasionally to ensure updates finish comfortably within the time windows that matter for your automations. Long optimization runs usually mean the problem has become quite large, so start by simplifying inputs before you shorten the planning horizon.

Debugging updates

Enable debug logging

To see detailed update information:

# configuration.yaml
logger:
  default: info
  logs:
    custom_components.haeo: debug

Logged information:

  • Update trigger sources
  • Data collection timing
  • Optimization solve time
  • Result processing steps
  • Error details and stack traces

Check coordinator status

Use developer tools to inspect the system state:

  1. Navigate to Developer Tools → States
  2. Find input entities (Number and Switch entities for your configured elements) and check their states and forecast attributes
  3. Find output sensors and check their states and attributes
  4. Check the optimization status sensor's error attribute for the cause of a failed optimization

Monitor with automations

Create automations to alert on persistent optimization failures:

automation:
  - alias: HAEO persistent failure alert
    trigger:
      - platform: state
        entity_id: sensor.optimizer_status
        to: failed
        for:
          minutes: 15
    action:
      - service: notify.persistent_notification
        data:
          title: HAEO optimization failing
          message: >
            HAEO has failed to optimize for 15 minutes.
            Check configuration and logs.

Using updated sensors in automations

HAEO sensors update automatically when new optimizations complete. Automations can trigger on state changes to respond to updated recommendations.

Automating your hardware explains how to turn each new plan into control of your inverter, with:

  • Rules for choosing your inverter's mode from the plan
  • Price guards for negative prices
  • A manual override and a safe fallback when no plan is available

Frequently asked questions

Why do sensors sometimes show "unavailable"?

Sensors become unavailable when:

  • Optimization fails to find a solution
  • Required data sources are offline
  • Configuration errors prevent optimization
  • Integration is initializing

Check the system logs for optimization error messages.

How can I speed up updates?

HAEO is event-driven, so optimizations run immediately when input data changes. To improve responsiveness:

  • Ensure your source sensors update frequently (check their polling intervals)
  • Choose a shorter planning horizon preset, or a forecast sensor with fewer periods, for faster solving
  • Simplify network topology when possible
  • Run the haeo.optimize action when you need immediate feedback

How do I inspect input entity data?

Input entities are visible in Home Assistant's entity list with the config entity category. Each input entity has a forecast attribute containing the time-series data used for optimization.

To inspect input data:

  1. Navigate to Developer Tools → States
  2. Search for your element names (e.g., number.battery_ or switch.solar_)
  3. Expand the forecast attribute to see the time-series data

See How HAEO receives data above for the two modes input entities work in.

Do I need to restart Home Assistant after configuration changes?

No. Configuration changes through the UI take effect immediately:

  • Element settings updates trigger optimization refresh
  • New connections rebuild network and re-optimize
  • Sensor changes detected automatically

Only changes to integration code (development) require restart.

Next steps

Focus on these areas to keep data updates reliable and useful.

  • Tune configuration settings

    Adjust horizon, period, and solver options to balance accuracy and speed.

    Configuration options

  • Monitor optimization performance

    Track solve duration and update frequency to spot bottlenecks.

    Performance tips

  • Automate responses to new data

    Trigger actions when HAEO publishes fresh recommendations.

    Automating your hardware

  • Resolve persistent issues

    Work through common problems when data updates fall behind.

    Troubleshooting tips