Native Homey app · public test
Plan energy use in Homey with prices and grid CO₂
Install Energy Price Forecast as a normal Homey app. It shows current values, builds reliable heat-pump and weekend-charging plans, and exposes the results as Flow cards—no HomeyScript required.
- Homey Pro, Homey Pro mini and Homey Self-Hosted Server
- up to 48 hours free, no account or API key required
- optional Private Pro: up to 120 hours and an earlier weekend plan
What the app gives you
A virtual forecast device combines price and grid-CO₂ data with plans that are ready to use in normal Homey Flows.
- Heat pump or boiler: choose the cheapest N individual hours inside each fixed X-hour block, so heating cannot be postponed indefinitely.
- EV charging: plan the weekend and start only in the selected cheap hours.
- Flexible loads: use the cheapest continuous price window or the greenest CO₂ window.
- Clear status: see the data source, forecast horizon and freshness directly on the device.
Install it in four steps
- Open the Homey Test page.
- Accept the Test-channel notice and install the app on your compatible Homey.
- Add the Price & CO₂ Forecast device and follow the guided setup.
- Select its Flow cards to switch, charge, heat or notify at the right time.
This version is not yet Homey-certified. It currently supports Homey Pro, Homey Pro mini and Homey Self-Hosted Server. Homey Cloud is not supported in this first Test release.
Without an API key, the app plans up to 48 hours ahead—including a Saturday-to-Sunday weekend plan. Private Pro extends the horizon to 120 hours and can prepare the weekend from Friday.
How the forecast is built
The price logic is not “forecast only”. It deliberately works in two stages so real market data always wins as soon as it exists.
Pairing, status values, plan logic and Flow cards are packaged in one guided Homey experience. HomeyScript is only needed below as an advanced fallback for custom raw API logic.
The API examples below remain useful when you need a value or calculation that the native app does not expose yet, or when you want to build completely custom logic.
The API supplies values and signals to HomeyScript and Flows. It does not overwrite dynamic prices in the native Homey Energy screen.
Advanced alternative: HomeyScript and raw API access
Most users should install the native app above. For custom scripts, Homey still gets its own summary path whose structure and naming are tuned for HomeyScript and Advanced Flow.
https://api.energypriceforecast.eu/api/v1/homey/summary?country=de&hours=48&window_hours=4flat.current_price for charging or switching decisions.flat.current_co2_g_kwh for greener automations.flat.is_cheapest_window_now and price.next_full_window.start for direct flow logic.Alternative: full price series for custom logic
If you want to compare prices yourself, calculate thresholds or select custom time windows instead of only using ready-made signals, use the Homey price series.
https://api.energypriceforecast.eu/api/v1/homey/prices?country=de&hours=48&mode=mixed&resolution=15mmode=mixed uses official day-ahead prices as soon as they are available and only fills the remaining horizon with forecast values. Real quarter-hour prices stay quarter-hourly; hourly forecasts are returned as four equal quarter-hour slots.
const API_KEY = '';
const url = 'https://api.energypriceforecast.eu/api/v1/homey/prices?country=de&hours=48&mode=mixed&resolution=15m';
const response = await fetch(url, {
headers: API_KEY.trim() ? { Authorization: `Bearer ${API_KEY.trim()}` } : {},
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
const next12Hours = data.entries.slice(0, 48);
const prices = next12Hours.map(slot => Number(slot.value)).filter(Number.isFinite);
if (prices.length === 0) throw new Error('No valid prices received');
return Math.min(...prices);
This example returns the lowest base price in the next twelve hours as a Number. Values are market prices without taxes and grid fees by default.
What the API actually returns
The Homey endpoint returns a compact automation view. That matters because in Homey you usually do not want to start with a full raw time series but with a few clear values for flows.
| Part | Content | Why it matters |
|---|---|---|
flat | Current price, current CO2, active best windows and remaining minutes. | Ideal for simple HomeyScript return values. |
price | Current price slot plus best_window and next_full_window. | For planning and future-oriented logic. |
co2 | Current CO2 slot plus CO2 windows. | For greener instead of cheaper automations. |
source | Metadata about day-ahead and forecast. | Important for interpretation and debugging. |
meta | API key state, allowed horizon and daily counters. | Useful for limits and troubleshooting. |
Time horizon and resolution
The examples use hours=48 and window_hours=4. That is a sensible starting point, but not the full product limit.
hours to define the requested horizon. Publicly, we currently communicate up to 120 hours for the price forecast.meta.allowed_horizon_hours.How to use it in Advanced Flow
- Install HomeyScript.
- In Advanced Flow, add a time trigger, for example every 15 minutes.
- Then add a HomeyScript card with return type
Number,Yes/NoorText. - Paste one of the copy-paste blocks below.
- Use the result tag in the next flow step.
Homey explicitly describes HomeyScript as a way to access website APIs. The examples below use exactly that with the Homey summary endpoint.
Example 1: return the current price as Number
Use this if you want to build threshold-based or comparison logic.
const API_KEY = '';
const url = 'https://api.energypriceforecast.eu/api/v1/homey/summary?country=de&hours=48&window_hours=4';
const response = await fetch(url, {
headers: API_KEY.trim()
? { Authorization: `Bearer ${API_KEY.trim()}` }
: {},
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
const price = Number(data.flat?.current_price);
if (!Number.isFinite(price)) throw new Error('No current price received');
return price;
Example 2: is the best price window active right now?
For real automations this is often more useful than only knowing the next start time.
const API_KEY = '';
const url = 'https://api.energypriceforecast.eu/api/v1/homey/summary?country=de&hours=48&window_hours=4';
const response = await fetch(url, {
headers: API_KEY.trim()
? { Authorization: `Bearer ${API_KEY.trim()}` }
: {},
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
return data.flat?.is_cheapest_window_now === true;
Example 3: return the next full start as Text
Useful for planning, dashboards or notifications.
const API_KEY = '';
const url = 'https://api.energypriceforecast.eu/api/v1/homey/summary?country=de&hours=48&window_hours=4';
const response = await fetch(url, {
headers: API_KEY.trim()
? { Authorization: `Bearer ${API_KEY.trim()}` }
: {},
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
return String(data.price?.next_full_window?.start || '');
Optional with API key
If you want to test more than the free horizon, place the key directly in the script. The API currently expects a Bearer header.
const API_KEY = 'YOUR_API_KEY';
const url = 'https://api.energypriceforecast.eu/api/v1/homey/summary?country=de&hours=120&window_hours=4';
In the end, the authoritative value is not just what you ask for in the URL, but what the server actually allows in meta.allowed_horizon_hours.
Typical Homey use cases
is_cheapest_window_now is true or the current price is below a threshold.Important meta fields for debugging
| Field | Meaning | Why relevant |
|---|---|---|
meta.api_key_state | missing, valid, inactive or another error state. | Check whether your Bearer token is really applied. |
meta.allowed_horizon_hours | Server-side allowed maximum horizon. | Important for 48h vs. 120h. |
meta.used_horizon_hours | Actually used horizon. | Shows whether a request was shortened. |
meta.used_calls_today | API calls used today. | Useful for observing real usage in tests. |
Help test the native Homey app
Install the Test release and share your Homey model, country and automation use case in the community topic. Reports about pairing, plan changes and Flow triggers are especially useful before certification.