The Czech National Bank (CNB) publishes official CZK exchange rates daily for 30 foreign currencies. These rates are the official fixing rates used as a reference across the Czech financial system.
The TapHome template fetches all 30 exchange rates from the public CNB REST API (api.cnb.cz) via HTTP Packet Parser. Each currency is exposed as a separate read-only sensor showing its current CZK rate. The API is completely public — no authentication, API key, or registration is required. Rates are updated every hour.
Configuration
The template connects to api.cnb.cz over HTTPS (port 443). No IP address, credentials, or API key are needed — the endpoint is a fully public government API.
There are no user-configurable variables. The only custom variable (responsejson) is an internal HTTP response cache used by the template scripts — it does not need to be modified.
How it works
The module sends a single HTTP GET request once per hour (3,600,000 ms polling interval):
| |
The response is a JSON object containing a rates[] array with all 30 currency entries. Each entry includes the currency code, country name, amount, and rate. The module stores the full JSON response in the responsejson variable.
Each currency device then parses its rate from the cached response using PARSEJSON(responsejson, "$.rates[N].rate"), where N is the fixed array index for that currency. The device poll interval is 15 seconds, but since all devices read from the cached responsejson, no additional API calls are made between hourly refreshes.
The template uses
lang=CZin the API request. This is critical because therates[]array is sorted alphabetically by country name in the selected language. Changing tolang=ENwould produce a different sort order and break all array index mappings.
Device capabilities
The template provides 30 read-only sensor devices, one for each currency. All values are in CZK.
Major currencies
The most commonly tracked rates include EUR (Euro), USD (US Dollar), GBP (British Pound), CHF (Swiss Franc), and PLN (Polish Zloty). These are quoted per 1 unit of foreign currency — for example, a USD rate of 21.315 means 1 USD = 21.315 CZK.
Multi-unit currencies
Eight currencies use multi-unit rates due to their low per-unit CZK value:
| Currency | Amount | Meaning |
|---|---|---|
| HUF (Hungarian Forint) | 100 | Rate per 100 HUF |
| INR (Indian Rupee) | 100 | Rate per 100 INR |
| ISK (Icelandic Krona) | 100 | Rate per 100 ISK |
| JPY (Japanese Yen) | 100 | Rate per 100 JPY |
| KRW (South Korean Won) | 100 | Rate per 100 KRW |
| PHP (Philippine Peso) | 100 | Rate per 100 PHP |
| THB (Thai Baht) | 100 | Rate per 100 THB |
| TRY (Turkish Lira) | 100 | Rate per 100 TRY |
| IDR (Indonesian Rupiah) | 1000 | Rate per 1000 IDR |
The template reads the raw rate value from the API without dividing by the amount. For example, a JPY rate of 13.328 in TapHome means 100 JPY = 13.328 CZK, not 1 JPY = 13.328 CZK.
Complete currency list
All 30 currencies: AUD, BRL, CAD, CHF, CNY, DKK, EUR, GBP, HKD, HUF, IDR, ILS, INR, ISK, JPY, KRW, MXN, MYR, NOK, NZD, PHP, PLN, RON, SEK, SGD, THB, TRY, USD, XDR (IMF Special Drawing Rights), ZAR.
Automation examples
Notify on rate threshold
Use a currency sensor in a smart rule condition to receive notifications when a rate crosses a threshold:
- Condition: EUR value crosses above 25.00
- Action: Send push notification
Rate-based switching
Trigger actions based on exchange rate movements — for example, switch display indicators or control outputs when a monitored currency reaches a target range.
Troubleshooting
All devices show zero or no data
- Check internet connectivity on TapHome Core — the template requires outbound HTTPS access to
api.cnb.cz - Verify the API is responding — open
https://api.cnb.cz/cnbapi/exrates/daily?date=2026-03-28&lang=CZin a browser - New exchange rates are published every working day around 14:30 CET. On weekends and holidays, the API returns the last valid rates
Values seem incorrect for some currencies
Check the multi-unit rates table above. Currencies like JPY, HUF, KRW, and IDR are quoted per 100 or 1000 units, not per 1 unit. This is the standard CNB convention, not a template error.
Data stops updating
The template polls the API once per hour. If rates appear stale, verify that TapHome Core has internet access and that the CNB API is reachable. The API has no documented rate limits, but prolonged connectivity issues will prevent updates.