Skip to main content

Amber Electric smart home integration, free and open source

Amber Electric integration for Gladys Assistant

Live and forecast Amber Electric prices, price spikes and renewables, for your scenes.

This integration connects Gladys to your Amber Electric account (Australia) and brings in the price of your electricity, live and forecast, so your scenes can run the pool pump, the hot water or the car charger when power is cheap, and stop them before a price spike.

It talks to the Amber cloud only (it is tagged cloud): there is nothing to install on your network.

What you get​

  • One device per Amber site (one meter, shown with its NMI), with:
    • the electricity price you pay right now, in $/kWh;
    • the wholesale spot price;
    • the controlled load price, if your meter has a controlled load (hot water, for instance);
    • the feed-in price, if you export solar: what you earn per kWh exported. It is negative when exporting costs you money;
    • the renewable share of the grid, in %.
  • Three scene triggers, two scene actions and a dashboard widget (Gladys 5.1 or later).

Before you start​

You need an Amber Electric account with at least one active site, and a personal API token.

Create your API token​

  1. Log in to the Amber web app: app.amber.com.au.
  2. Open the Developers page (app.amber.com.au/developers).
  3. Click Generate a new token, give it a name (for example Gladys) and copy it. Amber shows it only once.

The token only gives read access to your sites and prices. You can revoke it on the same page at any time.

Configuration​

  1. Open the Configuration tab of the integration.
  2. Paste the token in Amber API token.
  3. Site: leave it empty to follow every active site of the account. To follow only one, type its Amber id or its NMI (the Test the connection button lists them).
  4. Refresh interval: 300 seconds (5 minutes) by default. Amber publishes a new price every 5 minutes and limits the number of calls: there is no point going faster, and one minute is the minimum.
  5. Forecast horizon: how many hours of forecast prices are read, for the chart of the widget and the cheapest window. 12 hours by default.
  6. Save, then press Test the connection: it lists your sites and shows the price right now.
  7. Open the Discovery tab and add your site: its features start filling in at the next refresh.

Reads are aligned on Amber's intervals (a few seconds after :00, :05, :10…), so the price in Gladys changes at the same time as in the Amber app.

The devices​

FeatureUnitWhat it is
Electricity price$/kWhWhat you pay now, network fees and GST included
Wholesale spot price$/kWhThe NEM market price behind it
Controlled load price$/kWhOnly if your meter has a controlled load
Feed-in price$/kWhWhat you earn per kWh exported (negative = it costs)
Renewables in the grid%Share of renewable power in your region right now

The features keep their history: the standard Gladys charts show how the price moved over the day. A value is only sent to Gladys when it changes (and every 30 minutes otherwise).

You can use these features in the standard device state trigger of the scenes: "when the electricity price goes above 0.30 $/kWh…".

Scenes​

The integration adds its own cards to the scene editor (Gladys 5.1 or later), under the Integrations category.

Triggers​

  • The electricity price level changes — fires when Amber's price level moves: extremely low, very low, low, average, high or spike. Optionally pick the site and the new levels that should start the scene. The following actions can read {{triggerEvent.data.level}}, {{triggerEvent.data.previous_level}} and {{triggerEvent.data.price}}.
  • A price spike is possible, starts or ends — fires when the spike status moves between none, possible and spike in progress. Pick "spike possible" to get ready (pre-cool the house), "no spike (ended)" to resume.
  • Exporting to the grid starts or stops paying — fires when the feed-in price crosses zero: exporting solar starts to cost money (curtail the inverter, charge the battery, run the pool pump) or pays again.

A trigger fires once per change, never on every refresh. The first read after the integration starts only records the current state: a restart does not replay the triggers.

Actions​

  • Read the current electricity price — gives the following actions the price now (price), the spot price, the level (level), the spike status (spike_status), the renewable share, whether the price is still an estimate, and the tariff period. Choose the price to read: electricity bought, controlled load or feed-in. available is false when the site has no such channel.
  • Find the cheapest time to run — give a run time (60 minutes by default) and a horizon (the next 12 hours by default): the action answers starts_in_minutes, start_time and end_time (UTC), and the average_price of that window. found is false when the forecast is too short. Example: "every evening at 21:00, find the cheapest 2 hours in the next 10 hours, then send me a message: start the dishwasher in starts_in_minutes minutes".

Dashboard​

Add the Amber prices widget to a dashboard. It shows:

  • the price now, the feed-in price and the renewable share, in c/kWh as in the Amber app, colored by price level;
  • the forecast chart, with the cheapest hour and the spikes marked;
  • the price level, the spike status and the tariff period;
  • a Refresh button that reads the prices again at once.

In the widget settings, pick the site to show (the first one when left empty).

Troubleshooting​

  • "Amber refused the API token": the token was revoked or mistyped. Create a new one on the Developers page and paste it again.
  • "No site of this Amber account has the id typed in the Site field": empty the field, or copy an id given by Test the connection.
  • "This Amber account has no active site yet": Amber does not supply your meter yet (the site is pending). Prices appear once it is active.
  • "Amber limits the number of calls": the reads pause for a few minutes. If it keeps happening (another tool uses the same token), raise the refresh interval.
  • The features stay empty: add the site from the Discovery tab first.
  • For more detail, turn on Detailed logs in the configuration and look at the integration logs. Your token is never written to the logs.

Configuration settings​

These are the settings Amber Electric asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Getting startedsectionNoThis integration reads your Amber Electric prices from the Amber cloud. Create a personal API token in the Amber web app (Developers page, Generate a new token), paste it below and save: your sites show up in the Discovery tab.
Amber API tokensecretYesThe personal token created on app.amber.com.au/developers. It only reads your sites and prices.
SitestringNoLeave empty to follow every active site of the account. To follow only one, its Amber id or its NMI: "Test the connection" lists them.
Refresh interval (s)numberNoHow often the prices are read, in seconds. Amber publishes a new price every 5 minutes (300 s) and limits the number of calls: one minute at least.
Forecast horizon (h)numberNoHow many hours of forecast prices are read, for the dashboard chart and the cheapest window.
Detailed logs (debug)booleanNoLog every call to Amber and every price read. The API token is never logged.

How to install Amber Electric in Gladys​

  1. In Gladys, open Integrations: Amber Electric appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/prohand/gladys-amberelectric:1.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/prohand/gladys-amberelectric.

Amber Electric requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Amber Electric is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by prohand, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂