Skip to content

Soviet9773Red/shelly-elpris-dk-no

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DK/NO Nord Pool spot price control for Shelly devices

shelly-elpris-dk-no (v3.1.5)

License: AGPL v3

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.


Version 3.1.5 primary supports Shelly platform Gen2

| 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

Key features (3.1.5)

  • 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.

Price data sources

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.


Getting started

  1. Connect your Shelly device to the network.
  2. Update firmware to latest stable (>= 1.7.x recommended).
  3. Set timezone:
    • Europe/Copenhagen (DK)
    • Europe/Oslo (NO)
  4. Create a new script in Shelly Web UI.
  5. Paste the latest shelly-elpris-dk-no.js (ver. 3.1.5) build and save.
  6. 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
  1. Open the HTTP endpoint shown in the console.

Note: /script/N depends on the script slot used on your device.


Built-in web interface

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

Important 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.


H&T temperature addon

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.


Background and credits

Developed by @Soviet9773Red
Based on shelly-porssisahko by Jussi Isotalo
With additional ideas and JSON optimizations inspired by the community.


Source code and build system

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.


Support the project

Keeping the proxy infrastructure and APIs online costs time and money.
If this project saves you electricity or hardware headaches, support is welcome.

Big Mac

About

DK1-2 / NO1-5 Nordpool spotprice control for Shelly devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published