Forecasting missing predicted datapoints

Hi all,

I currently have a GridPrices API that retrieves day-ahead grid prices for the next day. For my EMS setup, I need forecasts for the next 7 days. My plan was to combine the day-ahead data from the API with Prophet to fill in the missing days at the end of the predicted series.

However, I’m running into a problem: when I use the forecaster with WEA, it seems to overwrite the day-ahead data from the API. The new “ML Forecaster” service also doesn’t seem to allow forecasting only the missing data points.

Has anyone tackled this problem before? I’m looking for a way to:

  1. Keep the API’s day-ahead data intact.
  2. Extend the forecast for the remaining days (up to 7).

Any suggestions or recommended approaches would be greatly appreciated!

Thanks in advance,
Lennard

To make it a bit clearer:
I currently use a GridPrices API that provides day-ahead grid prices for the next day. For my EMS setup, I need a 7-day forecast. My idea was to combine the API’s day-ahead data with Prophet to predict the remaining days.

However, I’ve run into an issue: when I use the forecaster with WEA, it seems to overwrite the API’s day-ahead values. The new “ML Forecaster” service also doesn’t appear to support forecasting only for the missing days.

Has anyone encountered this before? I’m looking for a way to:

  1. Keep the API’s day-ahead data unchanged.
  2. Extend the forecast to cover the remaining days (up to 7 total).

Hi Lennard,

You can do the following:

  • Have 1 attribute with the GridPrices day-ahead forecast.
  • Have 1 attribute with the 7-day forecast.
  • Combine the two forecasts with a custom Groovy Rule and send the resulting forecast to a new attribute.

You can use ‘PredictedDatapoints’ within Groovy rules, example:

import org.openremote.manager.rules.RulesBuilder
import org.openremote.model.attribute.AttributeRef
import org.openremote.model.datapoint.query.AssetDatapointAllQuery
import org.openremote.model.datapoint.query.AssetDatapointQuery
import org.openremote.model.rules.Assets
import org.openremote.model.rules.HistoricDatapoints
import org.openremote.model.rules.PredictedDatapoints

import java.util.logging.Logger

Logger LOG = binding.LOG
RulesBuilder rules = binding.rules
Assets assets = binding.assets
HistoricDatapoints historicDatapoints = binding.historicDatapoints
PredictedDatapoints predictedDatapoints = binding.predictedDatapoints

String assetId = "assetId"
String attributeName = "attributeName"

boolean triggerRuleOnce = true

rules.add()
        .name("Trigger rule once")
        .when({ facts ->
            return triggerRuleOnce
        })
        .then({ facts ->
            triggerRuleOnce = false

            long currentMillis = facts.clock.currentTimeMillis

            long startMillis = currentMillis
            long endMillis = currentMillis + 60 * 60 * 1000

            AttributeRef attributeRef = new AttributeRef(assetId, attributeName)
            AssetDatapointQuery assetDatapointQuery = new AssetDatapointAllQuery(startMillis, endMillis)
            def points = predictedDatapoints.getValueDatapoints(attributeRef, assetDatapointQuery)
        })