Allow sensors to report forecast data #1357
Replies: 2 comments 1 reply
|
We've discussed this proposal in the architecture meeting. This proposal considers the application where the forecast always comes from the same provider as the data. There is another potential application where there are forecast providers that can forecast on input data from an arbitrary data provider. The conclusion from the meeting is that although this proposal looks very solid and solves the first application in a nice way, there is worry that this proposal is too rigid considering the second application. We need to get back to this topic. |
1 reply
|
Closing this one since the forecast conversation has moved onto a newer architecture proposal: #1360 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem / Need
Today, forecast-capable sensor integrations in Home Assistant are fragmented:
This leads to duplicated logic, poor interoperability, and no consistent UX for forecasted sensor values (for example energy-price curves).
Goals
sensorentities.Architecture
Use a sensor-domain native forecast API, aligned with existing Home Assistant entity-service patterns.
Sensor capability model
SensorEntityFeature.FORECAST.async_forecast()onSensorEntity.list[SensorForecast] | Nonewhere each point has:datetime(ISO datetime or datetime object)value(finite numeric, native UoM of the sensor)Unified entity action
Add
sensor.get_forecastsas entity service:supports_response=SupportsResponse.ONLYrequired_features=[SensorEntityFeature.FORECAST]{ "<entity_id>": { "forecast": [ ...points... ] } }Validation and normalization
Core validates and normalizes integration output:
valuemust be finite numeric.Noneforecast becomes[].Implementation Plan
Core (sensor domain)
SensorEntityFeaturewith initialFORECASTfeature flag.SensorForecasttyped contract.SensorEntity.async_forecast()defaulting toNone.sensor.get_forecastsin sensor component setup.services.yaml,strings.json, andicons.jsonmetadata entries.Frontend integration
sensor.get_forecasts).Integrations That Benefit
nordpoolamberelectrictibberpvpc_hourly_pricingenergyzeroeasyenergyAll reactions