This code works if you live in Estonia 🇪🇪, Lithuania 🇱🇻, Latvia 🇱🇹 or Finland 🇫🇮. Just change the country code in the API endpoint.
Make sure your Shelly device is connected to the Internet and accessible from LAN.
-
Login to the cloud ☁️
-
Device IP This should open in a new browser window with local access to Shelly's device.
-
Click on Debug button, Enable Mqtt debug: and Websocket debug then click on Script button
-
Open script
https://github.com/jeveli/shelly-spotprice/blob/58eee83dcfc41fec9947ae5b717a68cd90fb2f86/Finland%20Spot%20Price%20script
-
Copy the script and paste it into the editor and click on Save and run
Find api_endpoint
and change #COUNTRY_CODE#
to ee, lv, lt or fi
api_endpoint: "https://dashboard.elering.ee/api/nps/price/fi/current"
Find configuration value price_limit
will be set when your device turns on or off. Prices don’t include VAT and are measured in EUR/MWh
price_limit: 400
Will set toggling threshold for the device to 400 EUR/MWh (40cnt/Kwh
Editable Examples in the code:
switchId: 0, // ID of the switch to control
price_limit: 400, // EUR/MWh. Vat not included. All under this will activate the relay, default 400 EUR/MWh (40cnt/Kwh)
update_time: 60000, // 1 minute. Price update interval in milliseconds
reverse_switching: false // If true, switch will be turned on when price is over the limit, default 400 EUR/MWh (40cnt/Kwh). Default false /