HAFO (Home Assistant Forecaster) is a custom integration that creates forecast helper sensors using various forecasting engines. It transforms data from different sources into future predictions, making it easy to forecast values for sensors that don't have native forecast support.
HAFO follows the Unix philosophy: do one thing and do it well.
- โ Forecast generation from multiple forecasting engines
- โ Helper sensor creation with forecast attributes
- โ Integration with Home Assistant's sensor ecosystem
HAFO focuses exclusively on forecasting and will not add features outside this scope:
- โ Energy optimization - Use HAEO for that
- โ Device control - Use Home Assistant automations
- โ External API integrations - Use dedicated integrations for external forecast services
This focused approach means:
- Better integration with the HA ecosystem
- Simpler, more maintainable codebase
- Users can choose best-in-class solutions for each component
- HAFO does forecasting exceptionally well
Read the full documentation โ
- Installation Guide - Get started with HAFO
- Configuration Guide - Set up your forecasters
- Forecasters - Available forecasting engines
- Developer Guide - Contribute to HAFO
- Multiple Forecasting Engines: Choose the best algorithm for your data
- Helper-based Design: Easy to add and configure via the UI
- HAEO Compatible: Output format matches HAEO for seamless integration
- Recorder Integration: Leverage Home Assistant's built-in statistics
- Extensible Architecture: Add new forecasting engines easily
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/hass-energy/hafo - Select "Integration" as the category
- Click "Add"
- Search for "HAFO" and click "Download"
- Restart Home Assistant
- Download the latest release from the releases page
- Extract the
hafofolder to yourcustom_componentsdirectory - Restart Home Assistant
Projects past patterns into the future by shifting historical data forward. Best for data with repeating patterns (daily, weekly cycles).
- Fetches hourly statistics from the recorder
- Shifts data forward by configurable number of days
More forecasting engines coming soon!
HAFO creates forecast helper sensors that:
- Load Data: Retrieves data from the configured source
- Apply Forecaster: Runs the selected forecasting engine
- Generate Output: Creates forecast points in HAEO-compatible format
- Update Regularly: Refreshes the forecast hourly
- Load Forecasting: Predict home power consumption from historical patterns
- Temperature Patterns: Forecast indoor temperatures based on past data
- Usage Prediction: Estimate resource usage (water, gas) from history
- Integration with HAEO: Provide load forecasts for energy optimization
HAFO is designed to work seamlessly with HAEO (Home Assistant Energy Optimizer). Use HAFO to generate load forecasts, then configure HAEO to use those forecasts for optimal energy management:
- Create a HAFO forecast helper for your load sensor
- Configure HAEO to use the HAFO sensor as its load forecast source
- HAEO will use the forecast to optimize battery charging, grid import/export, and more
See the HAEO documentation for details on energy optimization.
- Go to Settings โ Devices & Services โ Helpers
- Click Create Helper
- Search for Forecast and select it
- Configure your forecast helper:
- Source Entity: The sensor to generate a forecast for
- History Days: Number of days of history to use (for historical forecasters)
- Forecast Type: The forecasting engine to use
The sensor provides forecast data in HAEO-compatible format:
state: 2.5 # Current/nearest forecast value
attributes:
source_entity: sensor.home_power
history_days: 7
last_forecast_update: '2025-01-15T10:00:00+00:00'
forecast:
- time: '2025-01-15T10:00:00+00:00'
value: 2.5
- time: '2025-01-15T11:00:00+00:00'
value: 3.1
# ... more forecast pointsContributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.