Get price forecast

Use this action to retrieve the forecast wholesale price for the half hours ahead at one of your connection points. The forecast comes from the market’s published price schedules, so how far ahead it reaches changes during the day, and it is a forecast, not a promise of the price you will pay.

This action returns its result in a response variable, which you can use in later steps of the same automation or script, for example to start a heat pump or charge a battery in the cheapest forecast half hour.

The action asks the ecosmart API each time it runs, and each run counts against the same per-minute request allowance as the spot price sensor. Run it when you need a fresh forecast, for example every 30 minutes when the short schedule is republished, rather than every minute.

Using this action from the user interface

If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.

To get the price forecast from an automation or a script:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation or script, or select Create automation > Create new automation.
  3. If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
  4. In the Then do section, select Add action.
  5. From the search box, search for and select ecosmart: Get price forecast.
  6. Select the Connection point to forecast. Each connection point on your key is its own device, named after the ICP number on your bill.
  7. In the Response variable field, enter a name to store the forecast in, such as forecast. You’ll use this name to read the forecast in later steps.
  8. Select Save.

This action does not support targets. You choose the connection point in its own field instead of by area, entity, or label.

Options in the UI

Connection point (Required)

The connection point (ICP) to get the price forecast for. Each ICP on your key is its own device, named after the ICP number on your bill. Prices are set per grid exit point, so connection points that share one get the same forecast.

Using this action in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required. For how an automation or a script is built in YAML, refer to Automations in YAML and Scripts.

In YAML, refer to this action as ecosmart.get_forecasts. Store the result in a response variable so you can use it in later steps:

ActionAn action makes Home Assistant do something, for example, turn on a light, send a notification, or activate a scene. Automations and scripts run a list of actions. [Learn more]
action: ecosmart.get_forecasts
data:
  device_id: <id>
response_variable: forecast

This fetches the price forecast for that connection point. The easiest way to get the device ID is to pick the connection point in the UI editor and then switch to YAML.

Options in YAML

device_id string Required

The ID of the connection point (ICP) device to get the price forecast for.

Response data

The response contains forecasts: a list of forecast half hours, earliest first. It is empty when no forecast is published for your grid exit point. How far ahead it reaches changes during the day and is usually far less than a week.

Each forecast half hour includes the following fields:

  • start_time: The start of the half hour, in UTC.
  • price: The forecast wholesale price in cents per kWh including GST, the same unit as the spot price sensor. It can be negative.
  • price_excl_gst: The same price excluding GST.

A shortened example of the response looks like this:

forecasts:
  - start_time: "2026-08-24T15:00:00+00:00"
    price: 3.8238
    price_excl_gst: 3.325
  - start_time: "2026-08-24T15:30:00+00:00"
    price: 0.2289
    price_excl_gst: 0.199

Try it yourself

Ready to test this? Open Settings > Tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.

Still stuck?

To test the action on its own, run it in the automation editor with Run action, and check the message that it shows. To see what the action did when the automation ran, open the trace of that run. For details, refer to Testing automations. For common problems and their solutions, refer to Troubleshooting automations.

If that doesn’t help, the Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.