Skip to content

Commit

Permalink
Merge pull request #59 from Spot-hinta-fi/Vesivaraaja-script
Browse files Browse the repository at this point in the history
New Finnish Vesivaraaja script
  • Loading branch information
Spot-hinta-fi authored Jan 21, 2024
2 parents eeba16b + c677eb9 commit 9863f43
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 20 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ Enjoy automatic control of your relays when the electricity price is cheap (or..

## Shelly scripts in this package

1. "Pikakoodi" - this script is for Finnish market to provide simple pre-defined rules for heating.
2. "Minimal heating" - this script is a minimal but still very versatile script for, for example water boiler heating
3. "SmartHeating" - this script is Smart! It can control heating based on outdoor temperature plus much more!
4. "Rank and Price limit" - this script can control two relays according to the fixed price, average price and also using the cheapest hours
5. "SmartMonitoring" - Stores history of relay status changes in spot-hinta.fi cloud. Monitors Internet connection and script executions.
6. "Street light" - Shows Green/Yellow/Red color led depending on electricity price. Only for Shelly Plus Plug S -device!
1. "Vesivaraaja" - This script is for Finnish market and designed especially for water boiler heating (night and afternoon hours)
2. "Pikakoodi" - this script is for Finnish market to provide simple pre-defined rules for heating.
3. "Minimal heating" - this script is a minimal but still very versatile script for, for example water boiler heating
4. "SmartHeating" - this script is Smart! It can control heating based on outdoor temperature plus much more!
5. "Rank and Price limit" - this script can control two relays according to the fixed price, average price and also using the cheapest hours
6. "SmartMonitoring" - Stores history of relay status changes in spot-hinta.fi cloud. Monitors Internet connection and script executions.
7. "Street light" - Shows Green/Yellow/Red color led depending on electricity price. Only for Shelly Plus Plug S -device!
8 changes: 4 additions & 4 deletions Scripts/Shelly-Minimal-Heating.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// You can support spot-hinta.fi service here: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2023-12-22
// Thank you for your support: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2024-01-21

// Change these settings as you like
let Region = "FI"; // Supported regions: DK1, DK2, EE, FI, LT, LV, NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4
let Relays = [0]; // Relays to control with this script. List relays as comma separated. For example: [0,1,2]
let Relays = [0]; // Relays to control. For example: [0,1,2]
let CheapestHours = "4"; // How many cheapest hours relay will be turned on? To ONLY use a price limit, put CheapestHours to "0".
let OnlyNightHours = false; // false == cheapest hours can be any during day. true == cheapest hours are only searched from the night hours (22:00 - 07:00)
let OnlyNightHours = false; // If true, cheapest hours are only searched from the night hours (22:00 - 07:00), false == all hours
let PriceAlwaysAllowed = "0"; // Below what hour price the relay can be always on (or off, if inverted)? Value is in full euro cents. Use "-999" to disable.
let BackupHours = [3, 4, 5, 6]; // If Internet connection is down, turn relay ON during these hours (0...23). Use [99], if you don't want any backup hours.
let Inverted = false; // If "true", relay logic is inverted (= relay is turned ON when price is too exepensive and OFF when cheap)
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Shelly-Pikakoodi.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Voit halutessasi tukea palvelun ylläpitoa täällä: https://www.buymeacoffee.com/spothintafi
// Tuetut Shelly laiteohjelmistoversiot: 1.0.3 - 1.1.0. Skriptin versio: 2023-12-22
// Kiitos tuestasi: https://www.buymeacoffee.com/spothintafi
// Tuetut Shelly ohjelmistot: 1.0.3 - 1.1.0. Skriptin versio: 2024-01-21

// Asetukset
let Pikakoodi = 103; // Hae sopiva pikakoodi: https://spot-hinta.fi/pikakoodit
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Shelly-PlusPlugS-StreetLight.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// You can support spot-hinta.fi service here: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2023-12-22
// Thank you for your support: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2024-01-21

// NOTE! This script works only with "Shelly Plus Plug S" -smart plug

Expand Down
4 changes: 2 additions & 2 deletions Scripts/Shelly-Rank-and-Price.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// You can support spot-hinta.fi service here: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2023-12-22
// Thank you for your support: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2024-01-21

// Region to use
let Region = "FI"; // Supported regions: DK1, DK2, EE, FI, LT, LV, NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Shelly-SmartHeating.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// You can support spot-hinta.fi service here: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2023-12-22
// Thank you for your support: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2024-01-21

// SmartHeating: outdoor temperature controlled heating with a possibility to control multiple relays with the same rules
// It is possible to configure the heating curve with a seven temperature points.
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Shelly-SmartMonitoring.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// You can support spot-hinta.fi service here: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2023-12-22
// Thank you for your support: https://www.buymeacoffee.com/spothintafi
// Supported Shelly firmwares: 1.0.3 - 1.1.0. Script version: 2024-01-21

// Common settings
const Region = "FI"; // Supported regions: DK1, DK2, EE, FI, LT, LV, NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4
Expand Down
20 changes: 20 additions & 0 deletions Scripts/Shelly-Vesivaraaja.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Kiitos tuestasi: https://www.buymeacoffee.com/spothintafi
// Tuetut Shelly ohjelmistot: 1.0.3 - 1.1.0. Skriptin versio: 2024-01-21

// ASETUKSET
let TUNNIT_YO = 3; // Yötuntien lukumäärä 22:00 - 06:59?
let TUNNIT_IP = 0; // Iltapäivätuntien lukumäärä 12:00 - 19:59?
let RELE = 0; // Mitä relettä ohjataan?

// KOODI
let url = "https://api.spot-hinta.fi/WaterBoiler/" + TUNNIT_YO + "/" + TUNNIT_IP; let hour = null;
print("WaterBoiler: Ohjaus käynnistyy 30 sekunnissa.");
Timer.set(30000, true, function () {
if (hour == new Date().getHours()) { print("WaterBoiler: Odotetaan tunnin vaihtumista."); return; }
Shelly.call("HTTP.GET", { url: url, timeout: 15, ssl_ca: "*" }, function (res, err) {
hour = (err != 0 || res == null || (res.code !== 200 && res.code !== 400)) ? null : new Date().getHours();
let on = hour ? res.code != 400 : true;
Shelly.call("Switch.Set", "{ id:" + RELE + ", on:" + on + "}", null, null);
print("WaterBoiler: Kytketty " + (on ? "päälle" : "pois päältä") + (hour ? "." : " (virhetilanne)."));
});
});
5 changes: 5 additions & 0 deletions Scripts/Shelly-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"fname": "Shelly-Vesivaraaja.js",
"title": "Suomenkielinen lämminvesivaraaja-skripti",
"description": "Todella helppo skripti lämminvesivaraajalle! Valitse kuinka monta halvinta tuntia varaaja lämmitetään yöllä ja iltapäivällä. (Finnish region only)"
},
{
"fname": "Shelly-Pikakoodi.js",
"title": "Suomenkielinen pikakoodi-skripti",
Expand Down

0 comments on commit 9863f43

Please sign in to comment.