Skip to content

Failed to generate forecast: No historical data available for sensor #21

@F21

Description

@F21

System Health details

System Information

version core-2026.1.0
installation_type Home Assistant Container
dev false
hassio false
docker true
container_arch amd64
user root
virtualenv false
python_version 3.13.11
os_name Linux
os_version 6.6.87.2-microsoft-standard-WSL2
arch x86_64
timezone Australia/Melbourne
config_dir /config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
HAEO
error failed to load: unknown
Dashboards
dashboards 2
resources 0
views 0
mode storage
Network Configuration
adapters lo (disabled), eth0 (enabled, default, auto)
ipv4_addresses lo (127.0.0.1/8), eth0 (172.18.0.2/16)
ipv6_addresses lo (::1/128), eth0 ()
announce_addresses 172.18.0.2
Recorder
oldest_recorder_run January 9, 2026 at 2:11 AM
current_recorder_run January 16, 2026 at 1:48 PM
estimated_db_size 46.80 MiB
database_engine sqlite
database_version 3.49.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues.

Describe the issue

I am using HAFO to estimate a sensor for my eletrical load. The sensor is derived from another sensor using a template and works correctly.

This is the configuration for that sensor in my configuration.yaml:

template:
  - sensor:
    - name: "House Load"
      state: "{{ state_attr('sensor.homekit_homekit_gw_homekit_no_serial', 'load') }}"
      unit_of_measurement: "W"

I can see that it generates the correct data and it is visible when plotted in history:
Image

I have HAFO set to use 3 days for history and to use the house load sensor as its source:
Image

But it doesn't seem to produce any data:

Image

In my logs I see the following:

home-assistant  | 2026-01-16 04:13:46.295 INFO (MainThread) [custom_components.hafo] Setting up forecaster: House Load
home-assistant  | 2026-01-16 04:13:46.307 WARNING (MainThread) [custom_components.hafo.forecasters.historical_shift] Failed to generate forecast: No historical data available for sensor.house_load
home-assistant  | 2026-01-16 04:13:46.307 DEBUG (MainThread) [custom_components.hafo.forecasters.historical_shift] Finished fetching hafo_01KF2G4RDQ7ARWNN3BH3DCF7MZ data in 0.012 seconds (success: True)
home-assistant  | 2026-01-16 04:13:46.307 INFO (MainThread) [homeassistant.components.sensor] Setting up hafo.sensor
home-assistant  | 2026-01-16 04:13:46.307 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.hafo entity: sensor.house_load_forecast
home-assistant  | 2026-01-16 04:13:46.308 INFO (MainThread) [custom_components.hafo] Forecaster setup complete: House Load

Reproduction steps

  1. Create a sensor derived from another sensor
  2. Set up HAFO to use that sensor as the source.
  3. HAFO forecast sensor is unknown and does not produce any data.

Debug logs

See: https://gist.github.com/F21/0e1ef9d757e2d29ec53fa8b3e885d4f6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions