Skip to content

Auto-discover forecast entities from Home Assistant integrations (Solcast, Forecast.Solar) #23

@markoceri

Description

@markoceri

When adding a Forecast Provider of type "Home Assistant Api", the user is required to manually fill in a large number of entity IDs for retrieving production forecast data. As shown in the screenshot, the configuration form presents many entity fields:

  • Entity Forecast Power Actual H
  • Entity Forecast Power Next 1H
  • Entity Forecast Power Next 12H
  • Entity Forecast Power Next 24H
  • Entity Forecast Energy Actual H
  • Entity Forecast Energy Next 1H
  • Entity Forecast Energy Today
  • Entity Forecast Energy Tomorrow

Manually looking up and entering each of these entity IDs from Home Assistant is tedious and error-prone, especially considering that popular Home Assistant integrations like Solcast and Forecast.Solar already expose these entities with predictable naming patterns.

Image

Current Pain Points

  • Too many fields to fill manually: The user must look up and copy 8+ entity IDs from Home Assistant one by one, switching back and forth between the two UIs.

  • Predictable entity naming: Integrations like Solcast and Forecast.Solar follow well-known naming conventions for their entities (e.g., sensor.solcast_pv_forecast_power_now, sensor.energy_production_today). These could be detected automatically.

  • High friction for new users: A new user setting up Edge Mining for the first time may not know which Home Assistant entities correspond to which forecast fields, making the configuration experience frustrating.

Proposed Changes

1. Auto-discover forecast entities from Home Assistant

When the user selects "Home Assistant Api" as the adapter type and links an external service, provide an "Auto-Discover Entities" button that:

  1. Queries the linked Home Assistant instance for known forecast integration entities (e.g., Solcast, Forecast.Solar).
  2. Matches discovered entities to the corresponding Edge Mining configuration fields based on known naming patterns.
  3. Auto-populates the entity fields with the matched entity IDs.

2. Support for known integrations

Implement discovery patterns for at least the following Home Assistant integrations:

Integration Example Entities
Solcast sensor.solcast_pv_forecast_power_now, sensor.solcast_pv_forecast_power_next_hour, sensor.solcast_pv_forecast_forecast_today, sensor.solcast_pv_forecast_forecast_tomorrow
Forecast.Solar sensor.energy_production_today, sensor.energy_production_tomorrow, sensor.power_production_now, sensor.energy_current_hour

The list of supported integrations should be extensible, so additional forecast providers can be added in the future.

3. User confirmation before applying

  • After auto-discovery, show the user a preview of the matched entities before populating the fields.
  • The user can accept, modify, or dismiss the suggestions.
  • Any fields that could not be matched remain empty for manual input.

Visual Reference

See the attached screenshot showing the "Add Forecast Provider" form with "Home Assistant Api" selected. All entity fields are currently empty and marked as optional, requiring manual input.

Acceptance Criteria

  • An "Auto-Discover Entities" button is available in the Forecast Provider configuration form when the adapter type is "Home Assistant Api" and an external service is linked.
  • Clicking the button queries the linked Home Assistant instance and attempts to match known forecast entities to the configuration fields.
  • Discovery supports at least Solcast and Forecast.Solar integration naming patterns.
  • Discovered entities are shown to the user for confirmation before auto-populating the fields.
  • Fields that could not be matched are left empty for manual input.
  • Auto-populated fields remain editable so the user can correct or override them.
  • The discovery mechanism is extensible to support additional Home Assistant forecast integrations in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions