ITex Services s.r.o.

[ ITexSpot · Loxone ]

Electricity spot price in Loxone

The Miniserver fetches the outlook on its own through a Virtual HTTP Input — no Node-RED, no scripts and no extra server. All you need is a key and the template.

Beta · free · read-only key

Czech bidding zone (CZ) only — prices in CZK, Czech distribution tariffs.

What you need

  • Miniserver Gen 2 or newer (the address is HTTPS only; Gen 1 cannot do HTTPS — use a bridge via Home Assistant or Node-RED).
  • Loxone Config.
  • An ITexSpot API key (its_…) — in the ITexLink app under My account, or by signing up for the beta.

1. Template

Download the Virtual HTTP Input template (VI_ITexSpot.xml). In Loxone Config, open Virtual Inputs in the periphery tree, choose Device Templates → Import Template in the toolbar and select the downloaded file. Then insert the template as a new Virtual HTTP Input.

We built the template following the manufacturer's templates; it is not in the Loxone Library yet. If the import fails in your version of Config, set up the input manually using the steps below.

2. Address and key

In the properties of the Virtual HTTP Input, set the address with the key in the path:

Address (recommended)
https://api.itexservices.cz/v1/k/its_YOURKEY/loxone.txt

Set the polling cycle to 300 s. The data changes three times a day and responses for an address with the key in the path go through our cache, so they are fast, and you stay well within the limit (60 requests per hour) even on the Free tier. A polling cycle shorter than one hour is required by the Spot Price Optimizer block (see below).

The alternative is Basic Auth in the address (https://its_YOURKEY@api.itexservices.cz/v1/loxone.txt). It works, but it is slower: a response to an authenticated request is never stored in the cache, so every request goes all the way to the computation and counts toward the limit. Use it only if the key in the path does not work for some reason.

3. Commands (what the input reads)

The response is plain text, one value per line, with a decimal point. Each Virtual HTTP Input Command gets a command recognition in the form \icena_ted=\i\v. No name is contained in another one, so the values never get mixed up. The field names are part of the API contract and stay in Czech.

loxone.txt
stav_kod=0
stav=ok
cena_ted=4.012
spot_ted=2.31
levno_ted=1
uroven_ted=1
okno3_za_min=185
okno3_cena=3.41
drahe3_za_min=125
drahe3_cena=6.9
pockat_uroven=1
zaporna_dnes_p=0
stari_min=42
poradi_ted=3
v_n_nejlevnejsich=1
nejl_dnes_base=13
nejl_dnes_peak=13
nejl_dnes_offpeak=3
nejl_zitra_base=12
nejl_zitra_peak=12
nejl_zitra_offpeak=2
h00=4.012
h01=4.105
…
h47=3.88
r00=4.012
r01=4.105
…
r23=3.95
Command recognitionMeaning
\istav_kod=\i\v0 = OK, 1 = stale data, 401 = invalid key, 429 = limit, 503 = outage
\icena_ted=\i\vcurrent price in CZK/kWh (final price if the key has a tariff; otherwise spot)
\ispot_ted=\i\vcurrent spot price, excluding VAT and distribution
\ilevno_ted=\i\v1 = cheap or negative hour (digital input)
\iuroven_ted=\i\v0 negative, 1 cheap, 2 normal, 3 expensive
\iokno3_za_min=\i\vminutes until the cheapest 3-hour window starts (0 = running now)
\iokno3_cena=\i\vaverage price of that window
\idrahe3_za_min=\i\vminutes until the most expensive 3-hour window starts — when not to consume
\ipockat_uroven=\i\vbeta: 0/1/2 = low/medium/high chance that prices will be lower in the coming days
\izaporna_dnes_p=\i\vhighest probability of a negative price until the end of the day, in %
\istari_min=\i\vage of the data in minutes
\iporadi_ted=\i\vrank of the current hour within the day by price, 1 = cheapest
\iv_n_nejlevnejsich=\i\v1 = the current hour is among the N cheapest hours of the day (N = 4, otherwise ?n=… in the address)
\inejl_dnes_base=\i\vcheapest hour of today, 0–23 (whole day); _peak = 8 am–8 pm, _offpeak = 8 pm–8 am
\inejl_zitra_base=\i\vthe same for tomorrow (_peak, _offpeak); -999 until tomorrow is known
\ih00=\i\v … \ih47=\i\vhourly prices from the current hour (h00) 48 hours ahead
\ir00=\i\v … \ir23=\i\v24 prices for the Spot Price Optimizer in relative mode (+0 … +23)

A missing value is -999, not zero — zero could look like a real price. The exception are the r00–r23 lines (below). Prices are final prices if the key has a stored tariff, otherwise the plain spot price; after the published hours, our forecast continues (p50, or according to ?strategie= in the address).

4. Spot Price Optimizer block (relative mode)

The Spot Price Optimizer block can download known day-ahead market prices on its own. ITexSpot adds a forecast for the following hours and your final price according to the tariff stored with the key. Switch the block to relative mode and connect the commands r00 to r23 to its inputs +0 to +23: r00 to +0 (current hour), r01 to +1 and so on up to r23 to +23.

  • The polling cycle must be shorter than one hour. The block only accepts prices that were updated within the current hour and reloads its inputs at every full hour. With 300 s this is met with plenty of margin.
  • An unknown hour is 999 in these lines (not -999). The block would treat -999 as the cheapest hour of the day and schedule consumption into it; 999 means “unusably expensive”, so the block avoids it. In practice, hours are only missing when our forecast is unavailable.
  • The unit is CZK/kWh with a decimal point; the commands have “Signed” enabled because of negative prices.

Safe behavior during an API outage

The API may stop responding for a while, return an error or return stale data. Your home automation has to expect this — build it so that an outage breaks nothing:

  • The relay stays in its last safe state. Without valid data, do not switch anything on because of a “cheap hour”. Return devices to the behavior the house would have without ITexSpot (boiler on a time schedule, inverter without export limiting, battery in normal mode).
  • Fallback window. For loads that must run (boiler, charging), keep a fixed window in usually cheap hours, for example 1–5 am. When the data is not valid, run by that window.
  • Detect invalid data. Always check the data status. In JSON it is stav (ok, stara_data = stale data, limit, neplatny_klic = invalid key, nedostupne = unavailable), in the Loxone text output stav_kod: 0 = OK, 1 = stale data, 401 key, 429 limit, 503 outage. Then stari_min (age in minutes): the data changes three times a day, so overnight it is routinely up to about 16 hours old. A value above 1,800 minutes (30 h) means no new data is being produced.
  • A lost connection may not show in the values. Loxone and other systems keep the last value they read when the server is unreachable. stari_min, however, grows with every successful request. When it stops changing, requests are not getting through.
  • On a 429 or 503 error, wait as long as the Retry-After header says and do not retry immediately.
Loxone — logic (in words, wire the blocks to suit your project)
valid   = (stav_kod = 0) AND (stari_min < 1800) AND (stari_min changed within 20 min)
boiler  = valid ? levno_ted : fallback_window   ← fallback window = time schedule 1–5 am
export  = valid ? limit by price : DO NOT LIMIT (inverter default behavior)

Verified / known limitations

  • The template has not been verified by import yet. We took its structure from the manufacturer's templates, but we have not yet tried importing it into Loxone Config or running it on a Miniserver. If the import fails, set up the input manually using the steps above and let us know which version of Config you use.
  • Miniserver Gen 1 is not supported directly. The API runs on HTTPS only and Gen 1 cannot do HTTPS. Use a bridge via Home Assistant or Node-RED.
  • Negative prices. The price can drop below zero, so the price commands in the template have “Signed” enabled (Signed). Enable it as well when setting up the input manually, otherwise a negative price will be read incorrectly.
  • A missing value is -999 — handle it in your logic the same way as an outage (see Safeguards).
The forecast is indicative information, not a guarantee. Your home automation must cope with the API not responding for a while — set a sensible default and watch the age of the data. Details are in the API terms.