shelly-elpris-dk-no is a Shelly script for controlling outputs based on Nord Pool spot prices in Denmark (DK1-DK2) and Norway (NO1-NO5).
The project is a regional adaptation of shelly-elprisSE, which itself is based on shelly-porssisahko v3.1.1 by Jussi Isotalo.
Version 3.1.5 shares the same internal architecture and logic as the SE release, but uses Danish and Norwegian price APIs and regional settings.
| Device | Gen 2 | Gen 3 | Gen 4 |
|----------|-------|-------|-------|
| Plus1 | OK | -- | -- |
| Plus1 PM | OK | -- | OK |
| Plus2 PM | OK | -- | -- |
| Pro 2 | OK | -- | -- |
| Pro 3 | OK | -- | -- |
| Plug S | OK | SI | -- |
| Mini PM | -- | SI | -- |
-- = Not tested , SI = Shows instability
Shelly Gen 3-4: - may work, - not fully tested
- memory constraints may cause instability
- Unified DK + NO support
Single build with automatic zone detection and correct API routing. - Improved UI
Refined Status, History, Setup and integrated Help tab. - Grid fee model
Clear weekday/weekend separation and time-of-day detection (where applicable). - Improved reliability
Fixes for day rollover, VAT calculation, override persistence and spot price display. - Optional H&T temperature addon
Dynamic adjustment of cheapest hours based on Shelly H&T sensor data.
Prices are fetched via regional APIs and delivered in a compact, Shelly-friendly format:
At the time of writing, both APIs provide hourly (24-interval) price data.
The script parses and operates on this format directly, without any internal aggregation.
The current implementation will continue to work as long as the APIs keep delivering 24-hour data.
If either API switches to 15-minute intervals in the future, the script will stop working until a new version is released that is adapted to the updated API format.
No transition date for such a change is currently known.
- Connect your Shelly device to the network.
- Update firmware to latest stable (>= 1.7.x recommended).

- Set timezone:
- Europe/Copenhagen (DK)
- Europe/Oslo (NO)
- Create a new script in Shelly Web UI.
- Paste the latest shelly-elpris-dk-no.js (ver. 3.1.5) build and save.
- Start the script and open the console.
You will see output similar to:
elpris: v.3.1.5_12
elpris: URL http://192.168.8.119/script/1
- Open the HTTP endpoint shown in the console.
Note:
/script/Ndepends on the script slot used on your device.
The Shelly device exposes a lightweight HTTP UI with four tabs:
| Tab | Description |
|---|---|
| Status | Current state, prices, outputs and active logic |
| History | Logged actions and state changes |
| Setup | Zone, VAT, tariffs, outputs and overrides |
| Help | Embedded documentation and usage notes |
- KVS structure changed in 3.1.5
Configuration slot #3 was removed. Old KVS keys from earlier versions should be deleted before first start. - The script assumes hour-based control logic though price input is 24-hour based.
An optional addon script can be loaded after the main script.
It uses temperature data from a Shelly H&T sensor to dynamically adjust the number of cheapest hours.
Addon documentation and examples are located in the SE addons/ directory.
Developed by @Soviet9773Red
Based on shelly-porssisahko by Jussi Isotalo
With additional ideas and JSON optimizations inspired by the community.
The public repository contains ready-to-use builds only.
Internal build tooling, sources and npm-based environment are currently not public.
Forks, adaptations or collaboration can be discussed via GitHub Issues.
Keeping the proxy infrastructure and APIs online costs time and money.
If this project saves you electricity or hardware headaches, support is welcome.
