@energiok/node-red-contrib-pricecontrol-thermal 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DASHBOARD-TEMPLATE-3-MODES.md +4 -4
- package/package.json +1 -1
- package/src/strategy-smart-thermal-functions.js +246 -157
- package/src/strategy-smart-thermal.js +2 -0
- package/test/strategy-smart-thermal-functions.test.js +258 -94
- package/test/strategy-smart-thermal-node.test.js +36 -58
- package/test-3day-prices.js +0 -96
- package/test-cold-weather.js +0 -43
- package/test-day-transition.js +0 -161
- package/test-find-params.js +0 -78
- package/test-hourly-alignment.js +0 -114
- package/test-price-analysis.js +0 -77
- package/test-runway.js +0 -118
- package/test-saturday-peak.js +0 -132
- package/test-step-by-step.js +0 -213
- package/test-temp-scaling.js +0 -62
- package/test-thermal-budget.js +0 -174
- package/test-timezone.js +0 -83
- package/test-utc-machine.js +0 -90
package/test-3day-prices.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
const { createSchedule } = require('./src/strategy-smart-thermal-functions.js');
|
|
2
|
-
|
|
3
|
-
const prices = [{"price":97.41,"currency":"EUR","area":"NO1","timestamp":"2026-01-14T23:00:00Z"},{"price":95.18,"currency":"EUR","area":"NO1","timestamp":"2026-01-14T23:15:00Z"},{"price":92.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-14T23:30:00Z"},{"price":90.1,"currency":"EUR","area":"NO1","timestamp":"2026-01-14T23:45:00Z"},{"price":94.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T00:00:00Z"},{"price":92.32,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T00:15:00Z"},{"price":90,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T00:30:00Z"},{"price":88.44,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T00:45:00Z"},{"price":90.22,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T01:00:00Z"},{"price":86.96,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T01:15:00Z"},{"price":84.8,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T01:30:00Z"},{"price":84.1,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T01:45:00Z"},{"price":83.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T02:00:00Z"},{"price":83.11,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T02:15:00Z"},{"price":81.99,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T02:30:00Z"},{"price":80.98,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T02:45:00Z"},{"price":80.33,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T03:00:00Z"},{"price":80.33,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T03:15:00Z"},{"price":80.96,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T03:30:00Z"},{"price":81.73,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T03:45:00Z"},{"price":81.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T04:00:00Z"},{"price":82.47,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T04:15:00Z"},{"price":84.17,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T04:30:00Z"},{"price":86.6,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T04:45:00Z"},{"price":88.49,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T05:00:00Z"},{"price":92.15,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T05:15:00Z"},{"price":93.8,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T05:30:00Z"},{"price":95.54,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T05:45:00Z"},{"price":95.2,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T06:00:00Z"},{"price":98.28,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T06:15:00Z"},{"price":101.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T06:30:00Z"},{"price":103.04,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T06:45:00Z"},{"price":98.12,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T07:00:00Z"},{"price":99.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T07:15:00Z"},{"price":99.67,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T07:30:00Z"},{"price":99.31,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T07:45:00Z"},{"price":107.96,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T08:00:00Z"},{"price":104.01,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T08:15:00Z"},{"price":100.59,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T08:30:00Z"},{"price":98.28,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T08:45:00Z"},{"price":108.27,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T09:00:00Z"},{"price":104.8,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T09:15:00Z"},{"price":100.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T09:30:00Z"},{"price":98.62,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T09:45:00Z"},{"price":98.98,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T10:00:00Z"},{"price":96.95,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T10:15:00Z"},{"price":95.96,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T10:30:00Z"},{"price":95.11,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T10:45:00Z"},{"price":99.43,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T11:00:00Z"},{"price":96.57,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T11:15:00Z"},{"price":96.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T11:30:00Z"},{"price":99.4,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T11:45:00Z"},{"price":101.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T12:00:00Z"},{"price":102.56,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T12:15:00Z"},{"price":104.22,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T12:30:00Z"},{"price":101.99,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T12:45:00Z"},{"price":98.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T13:00:00Z"},{"price":102.35,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T13:15:00Z"},{"price":101.57,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T13:30:00Z"},{"price":110.66,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T13:45:00Z"},{"price":99.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T14:00:00Z"},{"price":117.22,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T14:15:00Z"},{"price":124.09,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T14:30:00Z"},{"price":138.69,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T14:45:00Z"},{"price":121.14,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T15:00:00Z"},{"price":131.5,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T15:15:00Z"},{"price":135.11,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T15:30:00Z"},{"price":141.15,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T15:45:00Z"},{"price":147.79,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T16:00:00Z"},{"price":151.48,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T16:15:00Z"},{"price":140.68,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T16:30:00Z"},{"price":128.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T16:45:00Z"},{"price":130.32,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T17:00:00Z"},{"price":113.7,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T17:15:00Z"},{"price":112.49,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T17:30:00Z"},{"price":102.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T17:45:00Z"},{"price":107.13,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T18:00:00Z"},{"price":101.56,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T18:15:00Z"},{"price":100.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T18:30:00Z"},{"price":100,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T18:45:00Z"},{"price":98.71,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T19:00:00Z"},{"price":97.8,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T19:15:00Z"},{"price":95.31,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T19:30:00Z"},{"price":91.64,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T19:45:00Z"},{"price":91.14,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T20:00:00Z"},{"price":88.64,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T20:15:00Z"},{"price":88.24,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T20:30:00Z"},{"price":88.59,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T20:45:00Z"},{"price":91.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T21:00:00Z"},{"price":86.91,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T21:15:00Z"},{"price":86.86,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T21:30:00Z"},{"price":84.67,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T21:45:00Z"},{"price":85.21,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T22:00:00Z"},{"price":83.14,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T22:15:00Z"},{"price":81.22,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T22:30:00Z"},{"price":79.86,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T22:45:00Z"},{"price":83.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:00:00Z"},{"price":82.96,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:15:00Z"},{"price":81.91,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:30:00Z"},{"price":80.89,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:45:00Z"},{"price":81.62,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:00:00Z"},{"price":80.6,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:15:00Z"},{"price":79.84,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:30:00Z"},{"price":77.88,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:45:00Z"},{"price":78.22,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:00:00Z"},{"price":77.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:15:00Z"},{"price":75.03,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:30:00Z"},{"price":74.14,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:45:00Z"},{"price":72.9,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:00:00Z"},{"price":72.47,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:15:00Z"},{"price":72.89,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:30:00Z"},{"price":73.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:45:00Z"},{"price":74.65,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:00:00Z"},{"price":75.09,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:15:00Z"},{"price":77.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:30:00Z"},{"price":78.48,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:45:00Z"},{"price":80.92,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:00:00Z"},{"price":82.07,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:15:00Z"},{"price":83.29,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:30:00Z"},{"price":84.17,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:45:00Z"},{"price":83.98,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:00:00Z"},{"price":85.58,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:15:00Z"},{"price":86.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:30:00Z"},{"price":87.82,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:45:00Z"},{"price":87.25,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:00:00Z"},{"price":87.91,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:15:00Z"},{"price":88.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:30:00Z"},{"price":88.69,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:45:00Z"},{"price":88.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:00:00Z"},{"price":88.55,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:15:00Z"},{"price":88.88,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:30:00Z"},{"price":88.97,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:45:00Z"},{"price":88.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:00:00Z"},{"price":88.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:15:00Z"},{"price":88.86,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:30:00Z"},{"price":89.01,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:45:00Z"},{"price":88.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:00:00Z"},{"price":88.24,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:15:00Z"},{"price":88.21,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:30:00Z"},{"price":87.97,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:45:00Z"},{"price":89.66,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:00:00Z"},{"price":89.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:15:00Z"},{"price":89.48,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:30:00Z"},{"price":89.49,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:45:00Z"},{"price":88.75,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:00:00Z"},{"price":89.62,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:15:00Z"},{"price":90.03,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:30:00Z"},{"price":90.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:45:00Z"},{"price":90.12,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:00:00Z"},{"price":90.84,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:15:00Z"},{"price":92.33,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:30:00Z"},{"price":94.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:45:00Z"},{"price":91.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:00:00Z"},{"price":93.01,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:15:00Z"},{"price":93.14,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:30:00Z"},{"price":93.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:45:00Z"},{"price":92.2,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:00:00Z"},{"price":93.38,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:15:00Z"},{"price":93.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:30:00Z"},{"price":93.84,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:45:00Z"},{"price":94,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:00:00Z"},{"price":95.16,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:15:00Z"},{"price":96.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:30:00Z"},{"price":101.04,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:45:00Z"},{"price":96.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:00:00Z"},{"price":95.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:15:00Z"},{"price":95.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:30:00Z"},{"price":95.29,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:45:00Z"},{"price":95.16,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:00:00Z"},{"price":95,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:15:00Z"},{"price":95.31,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:30:00Z"},{"price":95.13,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:45:00Z"},{"price":95.2,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:00:00Z"},{"price":94.93,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:15:00Z"},{"price":94.79,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:30:00Z"},{"price":94.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:45:00Z"},{"price":94.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:00:00Z"},{"price":94.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:15:00Z"},{"price":94.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:30:00Z"},{"price":94.21,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:45:00Z"},{"price":94,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:00:00Z"},{"price":93.94,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:15:00Z"},{"price":93.7,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:30:00Z"},{"price":93.49,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:45:00Z"},{"price":93.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:00:00Z"},{"price":93.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:15:00Z"},{"price":93.02,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:30:00Z"},{"price":92.7,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:45:00Z"},{"price":93.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:00:00Z"},{"price":92.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:15:00Z"},{"price":92.08,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:30:00Z"},{"price":91.1,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:45:00Z"},{"price":94.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T23:00:00Z"},{"price":93.55,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T23:15:00Z"},{"price":93.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T23:30:00Z"},{"price":91.08,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T23:45:00Z"},{"price":91.02,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T00:00:00Z"},{"price":90.87,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T00:15:00Z"},{"price":90.71,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T00:30:00Z"},{"price":90.6,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T00:45:00Z"},{"price":90.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T01:00:00Z"},{"price":90.28,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T01:15:00Z"},{"price":90.22,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T01:30:00Z"},{"price":90.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T01:45:00Z"},{"price":91.28,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T02:00:00Z"},{"price":91.79,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T02:15:00Z"},{"price":91.4,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T02:30:00Z"},{"price":91.58,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T02:45:00Z"},{"price":91.51,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T03:00:00Z"},{"price":91.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T03:15:00Z"},{"price":91.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T03:30:00Z"},{"price":91.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T03:45:00Z"},{"price":91.79,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T04:00:00Z"},{"price":90.98,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T04:15:00Z"},{"price":92.16,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T04:30:00Z"},{"price":91.75,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T04:45:00Z"},{"price":91.78,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T05:00:00Z"},{"price":90.08,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T05:15:00Z"},{"price":91.78,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T05:30:00Z"},{"price":91.56,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T05:45:00Z"},{"price":91.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T06:00:00Z"},{"price":92.38,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T06:15:00Z"},{"price":94.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T06:30:00Z"},{"price":96.68,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T06:45:00Z"},{"price":93.5,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T07:00:00Z"},{"price":97.4,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T07:15:00Z"},{"price":97.65,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T07:30:00Z"},{"price":98.39,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T07:45:00Z"},{"price":99.67,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T08:00:00Z"},{"price":101.82,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T08:15:00Z"},{"price":99.42,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T08:30:00Z"},{"price":97.94,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T08:45:00Z"},{"price":105.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T09:00:00Z"},{"price":101.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T09:15:00Z"},{"price":98.71,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T09:30:00Z"},{"price":97.29,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T09:45:00Z"},{"price":98.66,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T10:00:00Z"},{"price":98.42,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T10:15:00Z"},{"price":98.17,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T10:30:00Z"},{"price":97.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T10:45:00Z"},{"price":98.92,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T11:00:00Z"},{"price":98.03,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T11:15:00Z"},{"price":98.5,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T11:30:00Z"},{"price":98.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T11:45:00Z"},{"price":98.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T12:00:00Z"},{"price":98.82,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T12:15:00Z"},{"price":98.55,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T12:30:00Z"},{"price":97.99,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T12:45:00Z"},{"price":97.43,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T13:00:00Z"},{"price":97.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T13:15:00Z"},{"price":100.74,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T13:30:00Z"},{"price":105.94,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T13:45:00Z"},{"price":100.32,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T14:00:00Z"},{"price":105.32,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T14:15:00Z"},{"price":110.81,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T14:30:00Z"},{"price":113.24,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T14:45:00Z"},{"price":111.59,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T15:00:00Z"},{"price":120.96,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T15:15:00Z"},{"price":122.54,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T15:30:00Z"},{"price":123.82,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T15:45:00Z"},{"price":128.8,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T16:00:00Z"},{"price":126.62,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T16:15:00Z"},{"price":127.73,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T16:30:00Z"},{"price":131.06,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T16:45:00Z"},{"price":123.38,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T17:00:00Z"},{"price":121.69,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T17:15:00Z"},{"price":125.39,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T17:30:00Z"},{"price":124.59,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T17:45:00Z"},{"price":122.52,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T18:00:00Z"},{"price":121.64,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T18:15:00Z"},{"price":120.84,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T18:30:00Z"},{"price":113.53,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T18:45:00Z"},{"price":119.74,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T19:00:00Z"},{"price":106.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T19:15:00Z"},{"price":104.52,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T19:30:00Z"},{"price":99.31,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T19:45:00Z"},{"price":104.05,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T20:00:00Z"},{"price":100.21,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T20:15:00Z"},{"price":98.94,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T20:30:00Z"},{"price":96.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T20:45:00Z"},{"price":98.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T21:00:00Z"},{"price":97.66,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T21:15:00Z"},{"price":98.35,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T21:30:00Z"},{"price":99.81,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T21:45:00Z"},{"price":99.04,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T22:00:00Z"},{"price":98.13,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T22:15:00Z"},{"price":97.85,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T22:30:00Z"},{"price":96,"currency":"EUR","area":"NO1","timestamp":"2026-01-17T22:45:00Z"}];
|
|
4
|
-
|
|
5
|
-
const outdoorTemp = 5.0;
|
|
6
|
-
|
|
7
|
-
const config = {
|
|
8
|
-
heatLossCoefficient: 0.05,
|
|
9
|
-
minModeDuration: 60,
|
|
10
|
-
minSavingsPercent: 5,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
console.log('='.repeat(80));
|
|
14
|
-
console.log('3-DAY PRICE ANALYSIS (Jan 15-17, 2026)');
|
|
15
|
-
console.log('='.repeat(80));
|
|
16
|
-
|
|
17
|
-
const schedule = createSchedule(prices, outdoorTemp, config);
|
|
18
|
-
|
|
19
|
-
// Calculate statistics
|
|
20
|
-
const avgPrice = prices.reduce((sum, p) => sum + p.price, 0) / prices.length;
|
|
21
|
-
const minPrice = Math.min(...prices.map(p => p.price));
|
|
22
|
-
const maxPrice = Math.max(...prices.map(p => p.price));
|
|
23
|
-
|
|
24
|
-
console.log(`\nPrice range: ${minPrice.toFixed(2)} - ${maxPrice.toFixed(2)} EUR/MWh`);
|
|
25
|
-
console.log(`Average: ${avgPrice.toFixed(2)} EUR/MWh`);
|
|
26
|
-
console.log(`Volatility: ${((maxPrice - minPrice) / avgPrice * 100).toFixed(1)}%`);
|
|
27
|
-
|
|
28
|
-
// Show tuning info
|
|
29
|
-
if (schedule.length > 0 && schedule[0].tuning) {
|
|
30
|
-
const tuning = schedule[0].tuning;
|
|
31
|
-
console.log(`\n=== TUNING INFO ===`);
|
|
32
|
-
console.log(`Outdoor temp: ${tuning.outdoorTemp}C`);
|
|
33
|
-
console.log(`Min savings percent: ${tuning.minSavingsPercent}%`);
|
|
34
|
-
console.log(`Effective min savings percent: ${tuning.effectiveMinSavingsPercent.toFixed(2)}%`);
|
|
35
|
-
console.log(`Max safe coast: ${tuning.maxCoastMinutes.toFixed(0)} min (${(tuning.maxCoastMinutes / 60).toFixed(1)} hrs)`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Mode distribution
|
|
39
|
-
const coastCount = schedule.filter(s => s.mode === 'coast').length;
|
|
40
|
-
const boostCount = schedule.filter(s => s.mode === 'boost').length;
|
|
41
|
-
const normalCount = schedule.filter(s => s.mode === 'normal').length;
|
|
42
|
-
|
|
43
|
-
console.log(`\n=== SCHEDULE SUMMARY ===`);
|
|
44
|
-
console.log(`Total intervals: ${schedule.length} (${schedule.length / 4} hours)`);
|
|
45
|
-
console.log(`Coast: ${coastCount} intervals (${(coastCount * 15 / 60).toFixed(1)} hrs, ${((coastCount/schedule.length)*100).toFixed(1)}%)`);
|
|
46
|
-
console.log(`Boost: ${boostCount} intervals (${(boostCount * 15 / 60).toFixed(1)} hrs, ${((boostCount/schedule.length)*100).toFixed(1)}%)`);
|
|
47
|
-
console.log(`Normal: ${normalCount} intervals (${(normalCount * 15 / 60).toFixed(1)} hrs, ${((normalCount/schedule.length)*100).toFixed(1)}%)`);
|
|
48
|
-
|
|
49
|
-
// Show coast and boost periods
|
|
50
|
-
console.log(`\n=== COAST PERIODS (expensive) ===`);
|
|
51
|
-
let currentRun = null;
|
|
52
|
-
schedule.forEach((entry, i) => {
|
|
53
|
-
const time = new Date(entry.time);
|
|
54
|
-
const hourMinute = `${time.getUTCHours().toString().padStart(2, '0')}:${time.getUTCMinutes().toString().padStart(2, '0')}`;
|
|
55
|
-
const date = time.toISOString().split('T')[0];
|
|
56
|
-
|
|
57
|
-
if (entry.mode === 'coast') {
|
|
58
|
-
if (!currentRun) {
|
|
59
|
-
currentRun = { start: `${date} ${hourMinute}`, prices: [entry.price] };
|
|
60
|
-
} else {
|
|
61
|
-
currentRun.prices.push(entry.price);
|
|
62
|
-
}
|
|
63
|
-
} else if (currentRun) {
|
|
64
|
-
const avgRunPrice = currentRun.prices.reduce((a, b) => a + b, 0) / currentRun.prices.length;
|
|
65
|
-
const endTime = new Date(schedule[i - 1].time);
|
|
66
|
-
const endHourMinute = `${endTime.getUTCHours().toString().padStart(2, '0')}:${endTime.getUTCMinutes().toString().padStart(2, '0')}`;
|
|
67
|
-
const endDate = endTime.toISOString().split('T')[0];
|
|
68
|
-
console.log(`${currentRun.start} → ${endDate} ${endHourMinute} (${currentRun.prices.length * 15} min, avg ${avgRunPrice.toFixed(2)} EUR)`);
|
|
69
|
-
currentRun = null;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
console.log(`\n=== BOOST PERIODS (cheap) ===`);
|
|
74
|
-
currentRun = null;
|
|
75
|
-
schedule.forEach((entry, i) => {
|
|
76
|
-
const time = new Date(entry.time);
|
|
77
|
-
const hourMinute = `${time.getUTCHours().toString().padStart(2, '0')}:${time.getUTCMinutes().toString().padStart(2, '0')}`;
|
|
78
|
-
const date = time.toISOString().split('T')[0];
|
|
79
|
-
|
|
80
|
-
if (entry.mode === 'boost') {
|
|
81
|
-
if (!currentRun) {
|
|
82
|
-
currentRun = { start: `${date} ${hourMinute}`, prices: [entry.price] };
|
|
83
|
-
} else {
|
|
84
|
-
currentRun.prices.push(entry.price);
|
|
85
|
-
}
|
|
86
|
-
} else if (currentRun) {
|
|
87
|
-
const avgRunPrice = currentRun.prices.reduce((a, b) => a + b, 0) / currentRun.prices.length;
|
|
88
|
-
const endTime = new Date(schedule[i - 1].time);
|
|
89
|
-
const endHourMinute = `${endTime.getUTCHours().toString().padStart(2, '0')}:${endTime.getUTCMinutes().toString().padStart(2, '0')}`;
|
|
90
|
-
const endDate = endTime.toISOString().split('T')[0];
|
|
91
|
-
console.log(`${currentRun.start} → ${endDate} ${endHourMinute} (${currentRun.prices.length * 15} min, avg ${avgRunPrice.toFixed(2)} EUR)`);
|
|
92
|
-
currentRun = null;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
console.log('\n' + '='.repeat(80));
|
package/test-cold-weather.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const { createSchedule } = require('./src/strategy-smart-thermal-functions.js');
|
|
2
|
-
|
|
3
|
-
const prices = [{"price":83.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:00:00Z"},{"price":82.96,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:15:00Z"},{"price":81.91,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:30:00Z"},{"price":80.89,"currency":"EUR","area":"NO1","timestamp":"2026-01-15T23:45:00Z"},{"price":81.62,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:00:00Z"},{"price":80.6,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:15:00Z"},{"price":79.84,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:30:00Z"},{"price":77.88,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T00:45:00Z"},{"price":78.22,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:00:00Z"},{"price":77.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:15:00Z"},{"price":75.03,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:30:00Z"},{"price":74.14,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T01:45:00Z"},{"price":72.9,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:00:00Z"},{"price":72.47,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:15:00Z"},{"price":72.89,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:30:00Z"},{"price":73.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T02:45:00Z"},{"price":74.65,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:00:00Z"},{"price":75.09,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:15:00Z"},{"price":77.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:30:00Z"},{"price":78.48,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T03:45:00Z"},{"price":80.92,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:00:00Z"},{"price":82.07,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:15:00Z"},{"price":83.29,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:30:00Z"},{"price":84.17,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T04:45:00Z"},{"price":83.98,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:00:00Z"},{"price":85.58,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:15:00Z"},{"price":86.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:30:00Z"},{"price":87.82,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T05:45:00Z"},{"price":87.25,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:00:00Z"},{"price":87.91,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:15:00Z"},{"price":88.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:30:00Z"},{"price":88.69,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T06:45:00Z"},{"price":88.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:00:00Z"},{"price":88.55,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:15:00Z"},{"price":88.88,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:30:00Z"},{"price":88.97,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T07:45:00Z"},{"price":88.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:00:00Z"},{"price":88.83,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:15:00Z"},{"price":88.86,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:30:00Z"},{"price":89.01,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T08:45:00Z"},{"price":88.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:00:00Z"},{"price":88.24,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:15:00Z"},{"price":88.21,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:30:00Z"},{"price":87.97,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T09:45:00Z"},{"price":89.66,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:00:00Z"},{"price":89.45,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:15:00Z"},{"price":89.48,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:30:00Z"},{"price":89.49,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T10:45:00Z"},{"price":88.75,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:00:00Z"},{"price":89.62,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:15:00Z"},{"price":90.03,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:30:00Z"},{"price":90.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T11:45:00Z"},{"price":90.12,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:00:00Z"},{"price":90.84,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:15:00Z"},{"price":92.33,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:30:00Z"},{"price":94.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T12:45:00Z"},{"price":91.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:00:00Z"},{"price":93.01,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:15:00Z"},{"price":93.14,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:30:00Z"},{"price":93.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T13:45:00Z"},{"price":92.2,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:00:00Z"},{"price":93.38,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:15:00Z"},{"price":93.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:30:00Z"},{"price":93.84,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T14:45:00Z"},{"price":94,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:00:00Z"},{"price":95.16,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:15:00Z"},{"price":96.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:30:00Z"},{"price":101.04,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T15:45:00Z"},{"price":96.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:00:00Z"},{"price":95.19,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:15:00Z"},{"price":95.26,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:30:00Z"},{"price":95.29,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T16:45:00Z"},{"price":95.16,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:00:00Z"},{"price":95,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:15:00Z"},{"price":95.31,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:30:00Z"},{"price":95.13,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T17:45:00Z"},{"price":95.2,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:00:00Z"},{"price":94.93,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:15:00Z"},{"price":94.79,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:30:00Z"},{"price":94.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T18:45:00Z"},{"price":94.72,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:00:00Z"},{"price":94.46,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:15:00Z"},{"price":94.3,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:30:00Z"},{"price":94.21,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T19:45:00Z"},{"price":94,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:00:00Z"},{"price":93.94,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:15:00Z"},{"price":93.7,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:30:00Z"},{"price":93.49,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T20:45:00Z"},{"price":93.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:00:00Z"},{"price":93.37,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:15:00Z"},{"price":93.02,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:30:00Z"},{"price":92.7,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T21:45:00Z"},{"price":93.23,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:00:00Z"},{"price":92.77,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:15:00Z"},{"price":92.08,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:30:00Z"},{"price":91.1,"currency":"EUR","area":"NO1","timestamp":"2026-01-16T22:45:00Z"}];
|
|
4
|
-
|
|
5
|
-
const config = {
|
|
6
|
-
heatLossCoefficient: 0.05,
|
|
7
|
-
minModeDuration: 60,
|
|
8
|
-
minSavingsPercent: 5,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
console.log('COMPARISON: How outdoor temperature affects coast duration\n');
|
|
12
|
-
console.log('='.repeat(80));
|
|
13
|
-
|
|
14
|
-
// Test with different outdoor temperatures
|
|
15
|
-
const temps = [10, 5, 0, -5, -10];
|
|
16
|
-
|
|
17
|
-
temps.forEach(outdoorTemp => {
|
|
18
|
-
const schedule = createSchedule(prices, outdoorTemp, config);
|
|
19
|
-
|
|
20
|
-
const coastCount = schedule.filter(s => s.mode === 'coast').length;
|
|
21
|
-
const boostCount = schedule.filter(s => s.mode === 'boost').length;
|
|
22
|
-
const normalCount = schedule.filter(s => s.mode === 'normal').length;
|
|
23
|
-
|
|
24
|
-
const coastMinutes = coastCount * 15;
|
|
25
|
-
const boostMinutes = boostCount * 15;
|
|
26
|
-
|
|
27
|
-
const tuning = schedule[0]?.tuning;
|
|
28
|
-
const maxCoast = tuning?.maxCoastMinutes || 0;
|
|
29
|
-
|
|
30
|
-
console.log(`\nOutdoor temp: ${outdoorTemp}°C`);
|
|
31
|
-
console.log(` Max safe coast: ${maxCoast.toFixed(0)} min (${(maxCoast / 60).toFixed(1)} hrs)`);
|
|
32
|
-
console.log(` Actual coast: ${coastMinutes} min (${(coastMinutes / 60).toFixed(1)} hrs) - ${coastCount} intervals`);
|
|
33
|
-
console.log(` Boost time: ${boostMinutes} min (${(boostMinutes / 60).toFixed(1)} hrs) - ${boostCount} intervals`);
|
|
34
|
-
console.log(` Normal time: ${normalCount * 15} min (${(normalCount * 15 / 60).toFixed(1)} hrs)`);
|
|
35
|
-
console.log(` Distribution: ${((coastCount/96)*100).toFixed(1)}% coast, ${((boostCount/96)*100).toFixed(1)}% boost, ${((normalCount/96)*100).toFixed(1)}% normal`);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
console.log('\n' + '='.repeat(80));
|
|
39
|
-
console.log('\nKEY INSIGHTS:');
|
|
40
|
-
console.log('- Colder weather = shorter safe coast time (faster heat loss)');
|
|
41
|
-
console.log('- System automatically limits coast duration based on outdoor temp');
|
|
42
|
-
console.log('- Prevents unsafe temperature drops in cold weather');
|
|
43
|
-
console.log('- Boost periods remain constant (based on price, not temperature)');
|
package/test-day-transition.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test: Day transition (23:00 today -> 01:00 tomorrow)
|
|
3
|
-
*
|
|
4
|
-
* Scenario: Price data for today and tomorrow
|
|
5
|
-
* - Today ends expensive (23:00 = 120 EUR)
|
|
6
|
-
* - Tomorrow starts cheap (00:00 = 75 EUR)
|
|
7
|
-
*
|
|
8
|
-
* Expected behavior:
|
|
9
|
-
* 1. Coast should extend across midnight if needed (runway logic)
|
|
10
|
-
* 2. Thermal budget should be per-day (reset at midnight in Oslo time)
|
|
11
|
-
* 3. Times should display correctly in Oslo timezone
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const { createSchedule, getCurrentMode } = require('./src/strategy-smart-thermal-functions.js');
|
|
15
|
-
const { DateTime } = require('luxon');
|
|
16
|
-
|
|
17
|
-
// Two days of prices: Friday evening -> Saturday morning
|
|
18
|
-
// Simulating "today" (Friday) ending expensive, "tomorrow" (Saturday) starting cheap
|
|
19
|
-
const prices = [
|
|
20
|
-
// Friday afternoon/evening - prices rising toward peak
|
|
21
|
-
{ timestamp: "2026-01-16T14:00:00Z", price: 95 }, // 15:00 Oslo
|
|
22
|
-
{ timestamp: "2026-01-16T14:15:00Z", price: 98 },
|
|
23
|
-
{ timestamp: "2026-01-16T14:30:00Z", price: 102 },
|
|
24
|
-
{ timestamp: "2026-01-16T14:45:00Z", price: 108 },
|
|
25
|
-
{ timestamp: "2026-01-16T15:00:00Z", price: 115 }, // 16:00 Oslo - getting expensive
|
|
26
|
-
{ timestamp: "2026-01-16T15:15:00Z", price: 120 },
|
|
27
|
-
{ timestamp: "2026-01-16T15:30:00Z", price: 125 },
|
|
28
|
-
{ timestamp: "2026-01-16T15:45:00Z", price: 130 }, // Peak
|
|
29
|
-
{ timestamp: "2026-01-16T16:00:00Z", price: 128 }, // 17:00 Oslo
|
|
30
|
-
{ timestamp: "2026-01-16T16:15:00Z", price: 125 },
|
|
31
|
-
{ timestamp: "2026-01-16T16:30:00Z", price: 122 },
|
|
32
|
-
{ timestamp: "2026-01-16T16:45:00Z", price: 120 },
|
|
33
|
-
{ timestamp: "2026-01-16T17:00:00Z", price: 118 }, // 18:00 Oslo
|
|
34
|
-
{ timestamp: "2026-01-16T17:15:00Z", price: 115 },
|
|
35
|
-
{ timestamp: "2026-01-16T17:30:00Z", price: 112 },
|
|
36
|
-
{ timestamp: "2026-01-16T17:45:00Z", price: 110 },
|
|
37
|
-
{ timestamp: "2026-01-16T18:00:00Z", price: 108 }, // 19:00 Oslo
|
|
38
|
-
{ timestamp: "2026-01-16T18:15:00Z", price: 105 },
|
|
39
|
-
{ timestamp: "2026-01-16T18:30:00Z", price: 102 },
|
|
40
|
-
{ timestamp: "2026-01-16T18:45:00Z", price: 100 },
|
|
41
|
-
{ timestamp: "2026-01-16T19:00:00Z", price: 98 }, // 20:00 Oslo
|
|
42
|
-
{ timestamp: "2026-01-16T19:15:00Z", price: 95 },
|
|
43
|
-
{ timestamp: "2026-01-16T19:30:00Z", price: 92 },
|
|
44
|
-
{ timestamp: "2026-01-16T19:45:00Z", price: 90 },
|
|
45
|
-
{ timestamp: "2026-01-16T20:00:00Z", price: 88 }, // 21:00 Oslo
|
|
46
|
-
{ timestamp: "2026-01-16T20:15:00Z", price: 85 },
|
|
47
|
-
{ timestamp: "2026-01-16T20:30:00Z", price: 82 },
|
|
48
|
-
{ timestamp: "2026-01-16T20:45:00Z", price: 80 },
|
|
49
|
-
{ timestamp: "2026-01-16T21:00:00Z", price: 78 }, // 22:00 Oslo
|
|
50
|
-
{ timestamp: "2026-01-16T21:15:00Z", price: 76 },
|
|
51
|
-
{ timestamp: "2026-01-16T21:30:00Z", price: 74 },
|
|
52
|
-
{ timestamp: "2026-01-16T21:45:00Z", price: 72 },
|
|
53
|
-
{ timestamp: "2026-01-16T22:00:00Z", price: 70 }, // 23:00 Oslo - cheap (Friday night)
|
|
54
|
-
{ timestamp: "2026-01-16T22:15:00Z", price: 68 },
|
|
55
|
-
{ timestamp: "2026-01-16T22:30:00Z", price: 66 },
|
|
56
|
-
{ timestamp: "2026-01-16T22:45:00Z", price: 65 },
|
|
57
|
-
|
|
58
|
-
// Saturday (midnight boundary)
|
|
59
|
-
{ timestamp: "2026-01-16T23:00:00Z", price: 64 }, // 00:00 Oslo Saturday - MIDNIGHT
|
|
60
|
-
{ timestamp: "2026-01-16T23:15:00Z", price: 63 },
|
|
61
|
-
{ timestamp: "2026-01-16T23:30:00Z", price: 62 },
|
|
62
|
-
{ timestamp: "2026-01-16T23:45:00Z", price: 61 },
|
|
63
|
-
{ timestamp: "2026-01-17T00:00:00Z", price: 60 }, // 01:00 Oslo Saturday
|
|
64
|
-
{ timestamp: "2026-01-17T00:15:00Z", price: 59 },
|
|
65
|
-
{ timestamp: "2026-01-17T00:30:00Z", price: 58 },
|
|
66
|
-
{ timestamp: "2026-01-17T00:45:00Z", price: 57 },
|
|
67
|
-
{ timestamp: "2026-01-17T01:00:00Z", price: 56 }, // 02:00 Oslo Saturday
|
|
68
|
-
{ timestamp: "2026-01-17T01:15:00Z", price: 55 },
|
|
69
|
-
{ timestamp: "2026-01-17T01:30:00Z", price: 55 },
|
|
70
|
-
{ timestamp: "2026-01-17T01:45:00Z", price: 56 },
|
|
71
|
-
{ timestamp: "2026-01-17T02:00:00Z", price: 58 }, // 03:00 Oslo Saturday
|
|
72
|
-
{ timestamp: "2026-01-17T02:15:00Z", price: 60 },
|
|
73
|
-
{ timestamp: "2026-01-17T02:30:00Z", price: 62 },
|
|
74
|
-
{ timestamp: "2026-01-17T02:45:00Z", price: 65 },
|
|
75
|
-
];
|
|
76
|
-
|
|
77
|
-
const config = {
|
|
78
|
-
heatLossCoefficient: 0.05,
|
|
79
|
-
minModeDuration: 60,
|
|
80
|
-
minSavingsPercent: 5,
|
|
81
|
-
numPriceGroups: 3,
|
|
82
|
-
outputTimezone: "Europe/Oslo",
|
|
83
|
-
extremeWeatherThreshold: -15,
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const outdoorTemp = 5;
|
|
87
|
-
|
|
88
|
-
console.log("=== DAY TRANSITION TEST ===\n");
|
|
89
|
-
console.log("Testing Friday evening -> Saturday morning transition\n");
|
|
90
|
-
|
|
91
|
-
const schedule = createSchedule(prices, outdoorTemp, config);
|
|
92
|
-
|
|
93
|
-
// Show tuning info
|
|
94
|
-
const tuning = schedule[0]?.tuning;
|
|
95
|
-
if (tuning) {
|
|
96
|
-
console.log("Clustering thresholds:");
|
|
97
|
-
console.log(` Cheap (boost): < ${tuning.clustering.cheapThreshold?.toFixed(1)} EUR`);
|
|
98
|
-
console.log(` Expensive (coast): > ${tuning.clustering.expensiveThreshold?.toFixed(1)} EUR`);
|
|
99
|
-
console.log(` Max coast intervals: ${tuning.maxCoastIntervals}`);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
console.log("\n--- Schedule around midnight ---\n");
|
|
103
|
-
console.log("Oslo Time | UTC Time | Mode | Price");
|
|
104
|
-
console.log("-".repeat(55));
|
|
105
|
-
|
|
106
|
-
// Filter to show 21:00 Oslo Friday -> 04:00 Oslo Saturday
|
|
107
|
-
const midnightSchedule = schedule.filter(s => {
|
|
108
|
-
const oslo = s.time.substring(0, 16);
|
|
109
|
-
return oslo >= "2026-01-16T21:00" || oslo <= "2026-01-17T04:00";
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
midnightSchedule.forEach(entry => {
|
|
113
|
-
const osloTime = entry.time.substring(11, 16);
|
|
114
|
-
const osloDate = entry.time.substring(0, 10);
|
|
115
|
-
const utcTime = entry.timeUtc.substring(11, 16);
|
|
116
|
-
const mode = entry.mode.padEnd(6);
|
|
117
|
-
const price = entry.price.toFixed(0).padStart(3);
|
|
118
|
-
const dayMarker = osloDate === "2026-01-17" ? " (Sat)" : " (Fri)";
|
|
119
|
-
const modeMarker = entry.mode === "coast" ? " <-- COAST" : entry.mode === "boost" ? " <-- BOOST" : "";
|
|
120
|
-
console.log(`${osloTime}${dayMarker} | ${utcTime} UTC | ${mode} | ${price} EUR${modeMarker}`);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// Count modes per day
|
|
124
|
-
const fridaySchedule = schedule.filter(s => s.time.startsWith("2026-01-16"));
|
|
125
|
-
const saturdaySchedule = schedule.filter(s => s.time.startsWith("2026-01-17"));
|
|
126
|
-
|
|
127
|
-
console.log("\n--- Per-day mode counts ---\n");
|
|
128
|
-
console.log("Friday (2026-01-16):");
|
|
129
|
-
console.log(` Boost: ${fridaySchedule.filter(s => s.mode === "boost").length} intervals`);
|
|
130
|
-
console.log(` Normal: ${fridaySchedule.filter(s => s.mode === "normal").length} intervals`);
|
|
131
|
-
console.log(` Coast: ${fridaySchedule.filter(s => s.mode === "coast").length} intervals`);
|
|
132
|
-
|
|
133
|
-
console.log("\nSaturday (2026-01-17):");
|
|
134
|
-
console.log(` Boost: ${saturdaySchedule.filter(s => s.mode === "boost").length} intervals`);
|
|
135
|
-
console.log(` Normal: ${saturdaySchedule.filter(s => s.mode === "normal").length} intervals`);
|
|
136
|
-
console.log(` Coast: ${saturdaySchedule.filter(s => s.mode === "coast").length} intervals`);
|
|
137
|
-
|
|
138
|
-
// Test getCurrentMode at various times
|
|
139
|
-
console.log("\n--- getCurrentMode at transition times ---\n");
|
|
140
|
-
|
|
141
|
-
const testTimes = [
|
|
142
|
-
"2026-01-16T22:30:00Z", // 23:30 Oslo Friday
|
|
143
|
-
"2026-01-16T22:59:00Z", // 23:59 Oslo Friday (just before midnight)
|
|
144
|
-
"2026-01-16T23:00:00Z", // 00:00 Oslo Saturday (midnight)
|
|
145
|
-
"2026-01-16T23:01:00Z", // 00:01 Oslo Saturday (just after midnight)
|
|
146
|
-
"2026-01-16T23:30:00Z", // 00:30 Oslo Saturday
|
|
147
|
-
"2026-01-17T00:00:00Z", // 01:00 Oslo Saturday
|
|
148
|
-
];
|
|
149
|
-
|
|
150
|
-
testTimes.forEach(utc => {
|
|
151
|
-
const dt = DateTime.fromISO(utc);
|
|
152
|
-
const oslo = dt.setZone("Europe/Oslo").toFormat("yyyy-MM-dd HH:mm");
|
|
153
|
-
const mode = getCurrentMode(schedule, utc);
|
|
154
|
-
console.log(`UTC ${utc.substring(11, 16)} = Oslo ${oslo.substring(11, 16)} -> mode: ${mode}`);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
console.log("\n=== CONCLUSION ===");
|
|
158
|
-
console.log("✓ Schedule displays times in Oslo timezone correctly");
|
|
159
|
-
console.log("✓ Midnight transition (23:59 -> 00:00) is seamless");
|
|
160
|
-
console.log("✓ getCurrentMode works with UTC times across midnight");
|
|
161
|
-
console.log("✓ Thermal budget is tracked per calendar day (Oslo time)");
|
package/test-find-params.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
const { createSchedule } = require('./src/strategy-smart-thermal-functions.js');
|
|
2
|
-
|
|
3
|
-
const prices = [{"price":97.41,"timestamp":"2026-01-14T23:00:00Z"},{"price":95.18,"timestamp":"2026-01-14T23:15:00Z"},{"price":92.83,"timestamp":"2026-01-14T23:30:00Z"},{"price":90.1,"timestamp":"2026-01-14T23:45:00Z"},{"price":94.19,"timestamp":"2026-01-15T00:00:00Z"},{"price":92.32,"timestamp":"2026-01-15T00:15:00Z"},{"price":90,"timestamp":"2026-01-15T00:30:00Z"},{"price":88.44,"timestamp":"2026-01-15T00:45:00Z"},{"price":90.22,"timestamp":"2026-01-15T01:00:00Z"},{"price":86.96,"timestamp":"2026-01-15T01:15:00Z"},{"price":84.8,"timestamp":"2026-01-15T01:30:00Z"},{"price":84.1,"timestamp":"2026-01-15T01:45:00Z"},{"price":83.83,"timestamp":"2026-01-15T02:00:00Z"},{"price":83.11,"timestamp":"2026-01-15T02:15:00Z"},{"price":81.99,"timestamp":"2026-01-15T02:30:00Z"},{"price":80.98,"timestamp":"2026-01-15T02:45:00Z"},{"price":80.33,"timestamp":"2026-01-15T03:00:00Z"},{"price":80.33,"timestamp":"2026-01-15T03:15:00Z"},{"price":80.96,"timestamp":"2026-01-15T03:30:00Z"},{"price":81.73,"timestamp":"2026-01-15T03:45:00Z"},{"price":81.46,"timestamp":"2026-01-15T04:00:00Z"},{"price":82.47,"timestamp":"2026-01-15T04:15:00Z"},{"price":84.17,"timestamp":"2026-01-15T04:30:00Z"},{"price":86.6,"timestamp":"2026-01-15T04:45:00Z"},{"price":88.49,"timestamp":"2026-01-15T05:00:00Z"},{"price":92.15,"timestamp":"2026-01-15T05:15:00Z"},{"price":93.8,"timestamp":"2026-01-15T05:30:00Z"},{"price":95.54,"timestamp":"2026-01-15T05:45:00Z"},{"price":95.2,"timestamp":"2026-01-15T06:00:00Z"},{"price":98.28,"timestamp":"2026-01-15T06:15:00Z"},{"price":101.23,"timestamp":"2026-01-15T06:30:00Z"},{"price":103.04,"timestamp":"2026-01-15T06:45:00Z"},{"price":98.12,"timestamp":"2026-01-15T07:00:00Z"},{"price":99.72,"timestamp":"2026-01-15T07:15:00Z"},{"price":99.67,"timestamp":"2026-01-15T07:30:00Z"},{"price":99.31,"timestamp":"2026-01-15T07:45:00Z"},{"price":107.96,"timestamp":"2026-01-15T08:00:00Z"},{"price":104.01,"timestamp":"2026-01-15T08:15:00Z"},{"price":100.59,"timestamp":"2026-01-15T08:30:00Z"},{"price":98.28,"timestamp":"2026-01-15T08:45:00Z"},{"price":108.27,"timestamp":"2026-01-15T09:00:00Z"},{"price":104.8,"timestamp":"2026-01-15T09:15:00Z"},{"price":100.19,"timestamp":"2026-01-15T09:30:00Z"},{"price":98.62,"timestamp":"2026-01-15T09:45:00Z"},{"price":98.98,"timestamp":"2026-01-15T10:00:00Z"},{"price":96.95,"timestamp":"2026-01-15T10:15:00Z"},{"price":95.96,"timestamp":"2026-01-15T10:30:00Z"},{"price":95.11,"timestamp":"2026-01-15T10:45:00Z"},{"price":99.43,"timestamp":"2026-01-15T11:00:00Z"},{"price":96.57,"timestamp":"2026-01-15T11:15:00Z"},{"price":96.77,"timestamp":"2026-01-15T11:30:00Z"},{"price":99.4,"timestamp":"2026-01-15T11:45:00Z"},{"price":101.19,"timestamp":"2026-01-15T12:00:00Z"},{"price":102.56,"timestamp":"2026-01-15T12:15:00Z"},{"price":104.22,"timestamp":"2026-01-15T12:30:00Z"},{"price":101.99,"timestamp":"2026-01-15T12:45:00Z"},{"price":98.83,"timestamp":"2026-01-15T13:00:00Z"},{"price":102.35,"timestamp":"2026-01-15T13:15:00Z"},{"price":101.57,"timestamp":"2026-01-15T13:30:00Z"},{"price":110.66,"timestamp":"2026-01-15T13:45:00Z"},{"price":99.23,"timestamp":"2026-01-15T14:00:00Z"},{"price":117.22,"timestamp":"2026-01-15T14:15:00Z"},{"price":124.09,"timestamp":"2026-01-15T14:30:00Z"},{"price":138.69,"timestamp":"2026-01-15T14:45:00Z"},{"price":121.14,"timestamp":"2026-01-15T15:00:00Z"},{"price":131.5,"timestamp":"2026-01-15T15:15:00Z"},{"price":135.11,"timestamp":"2026-01-15T15:30:00Z"},{"price":141.15,"timestamp":"2026-01-15T15:45:00Z"},{"price":147.79,"timestamp":"2026-01-15T16:00:00Z"},{"price":151.48,"timestamp":"2026-01-15T16:15:00Z"},{"price":140.68,"timestamp":"2026-01-15T16:30:00Z"},{"price":128.72,"timestamp":"2026-01-15T16:45:00Z"},{"price":130.32,"timestamp":"2026-01-15T17:00:00Z"},{"price":113.7,"timestamp":"2026-01-15T17:15:00Z"},{"price":112.49,"timestamp":"2026-01-15T17:30:00Z"},{"price":102.26,"timestamp":"2026-01-15T17:45:00Z"},{"price":107.13,"timestamp":"2026-01-15T18:00:00Z"},{"price":101.56,"timestamp":"2026-01-15T18:15:00Z"},{"price":100.83,"timestamp":"2026-01-15T18:30:00Z"},{"price":100,"timestamp":"2026-01-15T18:45:00Z"},{"price":98.71,"timestamp":"2026-01-15T19:00:00Z"},{"price":97.8,"timestamp":"2026-01-15T19:15:00Z"},{"price":95.31,"timestamp":"2026-01-15T19:30:00Z"},{"price":91.64,"timestamp":"2026-01-15T19:45:00Z"},{"price":91.14,"timestamp":"2026-01-15T20:00:00Z"},{"price":88.64,"timestamp":"2026-01-15T20:15:00Z"},{"price":88.24,"timestamp":"2026-01-15T20:30:00Z"},{"price":88.59,"timestamp":"2026-01-15T20:45:00Z"},{"price":91.23,"timestamp":"2026-01-15T21:00:00Z"},{"price":86.91,"timestamp":"2026-01-15T21:15:00Z"},{"price":86.86,"timestamp":"2026-01-15T21:30:00Z"},{"price":84.67,"timestamp":"2026-01-15T21:45:00Z"},{"price":85.21,"timestamp":"2026-01-15T22:00:00Z"},{"price":83.14,"timestamp":"2026-01-15T22:15:00Z"},{"price":81.22,"timestamp":"2026-01-15T22:30:00Z"},{"price":79.86,"timestamp":"2026-01-15T22:45:00Z"},{"price":83.45,"timestamp":"2026-01-15T23:00:00Z"},{"price":82.96,"timestamp":"2026-01-15T23:15:00Z"},{"price":81.91,"timestamp":"2026-01-15T23:30:00Z"},{"price":80.89,"timestamp":"2026-01-15T23:45:00Z"},{"price":81.62,"timestamp":"2026-01-16T00:00:00Z"},{"price":80.6,"timestamp":"2026-01-16T00:15:00Z"},{"price":79.84,"timestamp":"2026-01-16T00:30:00Z"},{"price":77.88,"timestamp":"2026-01-16T00:45:00Z"},{"price":78.22,"timestamp":"2026-01-16T01:00:00Z"},{"price":77.83,"timestamp":"2026-01-16T01:15:00Z"},{"price":75.03,"timestamp":"2026-01-16T01:30:00Z"},{"price":74.14,"timestamp":"2026-01-16T01:45:00Z"},{"price":72.9,"timestamp":"2026-01-16T02:00:00Z"},{"price":72.47,"timestamp":"2026-01-16T02:15:00Z"},{"price":72.89,"timestamp":"2026-01-16T02:30:00Z"},{"price":73.72,"timestamp":"2026-01-16T02:45:00Z"},{"price":74.65,"timestamp":"2026-01-16T03:00:00Z"},{"price":75.09,"timestamp":"2026-01-16T03:15:00Z"},{"price":77.46,"timestamp":"2026-01-16T03:30:00Z"},{"price":78.48,"timestamp":"2026-01-16T03:45:00Z"},{"price":80.92,"timestamp":"2026-01-16T04:00:00Z"},{"price":82.07,"timestamp":"2026-01-16T04:15:00Z"},{"price":83.29,"timestamp":"2026-01-16T04:30:00Z"},{"price":84.17,"timestamp":"2026-01-16T04:45:00Z"},{"price":83.98,"timestamp":"2026-01-16T05:00:00Z"},{"price":85.58,"timestamp":"2026-01-16T05:15:00Z"},{"price":86.45,"timestamp":"2026-01-16T05:30:00Z"},{"price":87.82,"timestamp":"2026-01-16T05:45:00Z"},{"price":87.25,"timestamp":"2026-01-16T06:00:00Z"},{"price":87.91,"timestamp":"2026-01-16T06:15:00Z"},{"price":88.19,"timestamp":"2026-01-16T06:30:00Z"},{"price":88.69,"timestamp":"2026-01-16T06:45:00Z"},{"price":88.3,"timestamp":"2026-01-16T07:00:00Z"},{"price":88.55,"timestamp":"2026-01-16T07:15:00Z"},{"price":88.88,"timestamp":"2026-01-16T07:30:00Z"},{"price":88.97,"timestamp":"2026-01-16T07:45:00Z"},{"price":88.45,"timestamp":"2026-01-16T08:00:00Z"},{"price":88.83,"timestamp":"2026-01-16T08:15:00Z"},{"price":88.86,"timestamp":"2026-01-16T08:30:00Z"},{"price":89.01,"timestamp":"2026-01-16T08:45:00Z"},{"price":88.37,"timestamp":"2026-01-16T09:00:00Z"},{"price":88.24,"timestamp":"2026-01-16T09:15:00Z"},{"price":88.21,"timestamp":"2026-01-16T09:30:00Z"},{"price":87.97,"timestamp":"2026-01-16T09:45:00Z"},{"price":89.66,"timestamp":"2026-01-16T10:00:00Z"},{"price":89.45,"timestamp":"2026-01-16T10:15:00Z"},{"price":89.48,"timestamp":"2026-01-16T10:30:00Z"},{"price":89.49,"timestamp":"2026-01-16T10:45:00Z"},{"price":88.75,"timestamp":"2026-01-16T11:00:00Z"},{"price":89.62,"timestamp":"2026-01-16T11:15:00Z"},{"price":90.03,"timestamp":"2026-01-16T11:30:00Z"},{"price":90.46,"timestamp":"2026-01-16T11:45:00Z"},{"price":90.12,"timestamp":"2026-01-16T12:00:00Z"},{"price":90.84,"timestamp":"2026-01-16T12:15:00Z"},{"price":92.33,"timestamp":"2026-01-16T12:30:00Z"},{"price":94.23,"timestamp":"2026-01-16T12:45:00Z"},{"price":91.23,"timestamp":"2026-01-16T13:00:00Z"},{"price":93.01,"timestamp":"2026-01-16T13:15:00Z"},{"price":93.14,"timestamp":"2026-01-16T13:30:00Z"},{"price":93.26,"timestamp":"2026-01-16T13:45:00Z"},{"price":92.2,"timestamp":"2026-01-16T14:00:00Z"},{"price":93.38,"timestamp":"2026-01-16T14:15:00Z"},{"price":93.72,"timestamp":"2026-01-16T14:30:00Z"},{"price":93.84,"timestamp":"2026-01-16T14:45:00Z"},{"price":94,"timestamp":"2026-01-16T15:00:00Z"},{"price":95.16,"timestamp":"2026-01-16T15:15:00Z"},{"price":96.72,"timestamp":"2026-01-16T15:30:00Z"},{"price":101.04,"timestamp":"2026-01-16T15:45:00Z"},{"price":96.26,"timestamp":"2026-01-16T16:00:00Z"},{"price":95.19,"timestamp":"2026-01-16T16:15:00Z"},{"price":95.26,"timestamp":"2026-01-16T16:30:00Z"},{"price":95.29,"timestamp":"2026-01-16T16:45:00Z"},{"price":95.16,"timestamp":"2026-01-16T17:00:00Z"},{"price":95,"timestamp":"2026-01-16T17:15:00Z"},{"price":95.31,"timestamp":"2026-01-16T17:30:00Z"},{"price":95.13,"timestamp":"2026-01-16T17:45:00Z"},{"price":95.2,"timestamp":"2026-01-16T18:00:00Z"},{"price":94.93,"timestamp":"2026-01-16T18:15:00Z"},{"price":94.79,"timestamp":"2026-01-16T18:30:00Z"},{"price":94.77,"timestamp":"2026-01-16T18:45:00Z"},{"price":94.72,"timestamp":"2026-01-16T19:00:00Z"},{"price":94.46,"timestamp":"2026-01-16T19:15:00Z"},{"price":94.3,"timestamp":"2026-01-16T19:30:00Z"},{"price":94.21,"timestamp":"2026-01-16T19:45:00Z"},{"price":94,"timestamp":"2026-01-16T20:00:00Z"},{"price":93.94,"timestamp":"2026-01-16T20:15:00Z"},{"price":93.7,"timestamp":"2026-01-16T20:30:00Z"},{"price":93.49,"timestamp":"2026-01-16T20:45:00Z"},{"price":93.77,"timestamp":"2026-01-16T21:00:00Z"},{"price":93.37,"timestamp":"2026-01-16T21:15:00Z"},{"price":93.02,"timestamp":"2026-01-16T21:30:00Z"},{"price":92.7,"timestamp":"2026-01-16T21:45:00Z"},{"price":93.23,"timestamp":"2026-01-16T22:00:00Z"},{"price":92.77,"timestamp":"2026-01-16T22:15:00Z"},{"price":92.08,"timestamp":"2026-01-16T22:30:00Z"},{"price":91.1,"timestamp":"2026-01-16T22:45:00Z"},{"price":94.26,"timestamp":"2026-01-16T23:00:00Z"},{"price":93.55,"timestamp":"2026-01-16T23:15:00Z"},{"price":93.45,"timestamp":"2026-01-16T23:30:00Z"},{"price":91.08,"timestamp":"2026-01-16T23:45:00Z"},{"price":91.02,"timestamp":"2026-01-17T00:00:00Z"},{"price":90.87,"timestamp":"2026-01-17T00:15:00Z"},{"price":90.71,"timestamp":"2026-01-17T00:30:00Z"},{"price":90.6,"timestamp":"2026-01-17T00:45:00Z"},{"price":90.37,"timestamp":"2026-01-17T01:00:00Z"},{"price":90.28,"timestamp":"2026-01-17T01:15:00Z"},{"price":90.22,"timestamp":"2026-01-17T01:30:00Z"},{"price":90.3,"timestamp":"2026-01-17T01:45:00Z"},{"price":91.28,"timestamp":"2026-01-17T02:00:00Z"},{"price":91.79,"timestamp":"2026-01-17T02:15:00Z"},{"price":91.4,"timestamp":"2026-01-17T02:30:00Z"},{"price":91.58,"timestamp":"2026-01-17T02:45:00Z"},{"price":91.51,"timestamp":"2026-01-17T03:00:00Z"},{"price":91.19,"timestamp":"2026-01-17T03:15:00Z"},{"price":91.3,"timestamp":"2026-01-17T03:30:00Z"},{"price":91.46,"timestamp":"2026-01-17T03:45:00Z"},{"price":91.79,"timestamp":"2026-01-17T04:00:00Z"},{"price":90.98,"timestamp":"2026-01-17T04:15:00Z"},{"price":92.16,"timestamp":"2026-01-17T04:30:00Z"},{"price":91.75,"timestamp":"2026-01-17T04:45:00Z"},{"price":91.78,"timestamp":"2026-01-17T05:00:00Z"},{"price":90.08,"timestamp":"2026-01-17T05:15:00Z"},{"price":91.78,"timestamp":"2026-01-17T05:30:00Z"},{"price":91.56,"timestamp":"2026-01-17T05:45:00Z"},{"price":91.3,"timestamp":"2026-01-17T06:00:00Z"},{"price":92.38,"timestamp":"2026-01-17T06:15:00Z"},{"price":94.26,"timestamp":"2026-01-17T06:30:00Z"},{"price":96.68,"timestamp":"2026-01-17T06:45:00Z"},{"price":93.5,"timestamp":"2026-01-17T07:00:00Z"},{"price":97.4,"timestamp":"2026-01-17T07:15:00Z"},{"price":97.65,"timestamp":"2026-01-17T07:30:00Z"},{"price":98.39,"timestamp":"2026-01-17T07:45:00Z"},{"price":99.67,"timestamp":"2026-01-17T08:00:00Z"},{"price":101.82,"timestamp":"2026-01-17T08:15:00Z"},{"price":99.42,"timestamp":"2026-01-17T08:30:00Z"},{"price":97.94,"timestamp":"2026-01-17T08:45:00Z"},{"price":105.19,"timestamp":"2026-01-17T09:00:00Z"},{"price":101.37,"timestamp":"2026-01-17T09:15:00Z"},{"price":98.71,"timestamp":"2026-01-17T09:30:00Z"},{"price":97.29,"timestamp":"2026-01-17T09:45:00Z"},{"price":98.66,"timestamp":"2026-01-17T10:00:00Z"},{"price":98.42,"timestamp":"2026-01-17T10:15:00Z"},{"price":98.17,"timestamp":"2026-01-17T10:30:00Z"},{"price":97.37,"timestamp":"2026-01-17T10:45:00Z"},{"price":98.92,"timestamp":"2026-01-17T11:00:00Z"},{"price":98.03,"timestamp":"2026-01-17T11:15:00Z"},{"price":98.5,"timestamp":"2026-01-17T11:30:00Z"},{"price":98.3,"timestamp":"2026-01-17T11:45:00Z"},{"price":98.26,"timestamp":"2026-01-17T12:00:00Z"},{"price":98.82,"timestamp":"2026-01-17T12:15:00Z"},{"price":98.55,"timestamp":"2026-01-17T12:30:00Z"},{"price":97.99,"timestamp":"2026-01-17T12:45:00Z"},{"price":97.43,"timestamp":"2026-01-17T13:00:00Z"},{"price":97.77,"timestamp":"2026-01-17T13:15:00Z"},{"price":100.74,"timestamp":"2026-01-17T13:30:00Z"},{"price":105.94,"timestamp":"2026-01-17T13:45:00Z"},{"price":100.32,"timestamp":"2026-01-17T14:00:00Z"},{"price":105.32,"timestamp":"2026-01-17T14:15:00Z"},{"price":110.81,"timestamp":"2026-01-17T14:30:00Z"},{"price":113.24,"timestamp":"2026-01-17T14:45:00Z"},{"price":111.59,"timestamp":"2026-01-17T15:00:00Z"},{"price":120.96,"timestamp":"2026-01-17T15:15:00Z"},{"price":122.54,"timestamp":"2026-01-17T15:30:00Z"},{"price":123.82,"timestamp":"2026-01-17T15:45:00Z"},{"price":128.8,"timestamp":"2026-01-17T16:00:00Z"},{"price":126.62,"timestamp":"2026-01-17T16:15:00Z"},{"price":127.73,"timestamp":"2026-01-17T16:30:00Z"},{"price":131.06,"timestamp":"2026-01-17T16:45:00Z"},{"price":123.38,"timestamp":"2026-01-17T17:00:00Z"},{"price":121.69,"timestamp":"2026-01-17T17:15:00Z"},{"price":125.39,"timestamp":"2026-01-17T17:30:00Z"},{"price":124.59,"timestamp":"2026-01-17T17:45:00Z"},{"price":122.52,"timestamp":"2026-01-17T18:00:00Z"},{"price":121.64,"timestamp":"2026-01-17T18:15:00Z"},{"price":120.84,"timestamp":"2026-01-17T18:30:00Z"},{"price":113.53,"timestamp":"2026-01-17T18:45:00Z"},{"price":119.74,"timestamp":"2026-01-17T19:00:00Z"},{"price":106.23,"timestamp":"2026-01-17T19:15:00Z"},{"price":104.52,"timestamp":"2026-01-17T19:30:00Z"},{"price":99.31,"timestamp":"2026-01-17T19:45:00Z"},{"price":104.05,"timestamp":"2026-01-17T20:00:00Z"},{"price":100.21,"timestamp":"2026-01-17T20:15:00Z"},{"price":98.94,"timestamp":"2026-01-17T20:30:00Z"},{"price":96.23,"timestamp":"2026-01-17T20:45:00Z"},{"price":98.37,"timestamp":"2026-01-17T21:00:00Z"},{"price":97.66,"timestamp":"2026-01-17T21:15:00Z"},{"price":98.35,"timestamp":"2026-01-17T21:30:00Z"},{"price":99.81,"timestamp":"2026-01-17T21:45:00Z"},{"price":99.04,"timestamp":"2026-01-17T22:00:00Z"},{"price":98.13,"timestamp":"2026-01-17T22:15:00Z"},{"price":97.85,"timestamp":"2026-01-17T22:30:00Z"},{"price":96,"timestamp":"2026-01-17T22:45:00Z"}];
|
|
4
|
-
|
|
5
|
-
console.log("=== Finding parameters for 1-hour coast on Saturday ===\n");
|
|
6
|
-
|
|
7
|
-
// Saturday evening consecutive prices (Oslo time):
|
|
8
|
-
// 16:15=120.96, 16:30=122.54, 16:45=123.82, 17:00=128.80
|
|
9
|
-
// 17:15=126.62, 17:30=127.73, 17:45=131.06, 18:00=123.38
|
|
10
|
-
// 18:15=121.64, 18:30=120.84
|
|
11
|
-
// These are all 120+ from 16:15 to 18:30 (10 consecutive intervals = 2.5h)
|
|
12
|
-
|
|
13
|
-
const configs = [
|
|
14
|
-
{ name: "3 groups, 5%", numPriceGroups: 3, minSavingsPercent: 5 },
|
|
15
|
-
{ name: "3 groups, 3%", numPriceGroups: 3, minSavingsPercent: 3 },
|
|
16
|
-
{ name: "4 groups, 5%", numPriceGroups: 4, minSavingsPercent: 5 },
|
|
17
|
-
{ name: "4 groups, 3%", numPriceGroups: 4, minSavingsPercent: 3 },
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
for (const cfg of configs) {
|
|
21
|
-
const schedule = createSchedule(prices, 5, {
|
|
22
|
-
...cfg,
|
|
23
|
-
minModeDuration: 60,
|
|
24
|
-
outputTimezone: "Europe/Oslo",
|
|
25
|
-
heatLossCoefficient: 0.06,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const satCoast = schedule.filter(s => s.time.startsWith("2026-01-17") && s.mode === "coast");
|
|
29
|
-
const threshold = schedule[0]?.tuning?.clustering?.expensiveThreshold;
|
|
30
|
-
|
|
31
|
-
console.log(`${cfg.name}:`);
|
|
32
|
-
console.log(` Coast threshold: ${threshold?.toFixed(2)} EUR`);
|
|
33
|
-
console.log(` Saturday coast: ${satCoast.length} intervals (${satCoast.length * 15} min)`);
|
|
34
|
-
if (satCoast.length > 0) {
|
|
35
|
-
const times = satCoast.map(s => s.time.substring(11,16)).join(", ");
|
|
36
|
-
console.log(` Times: ${times}`);
|
|
37
|
-
}
|
|
38
|
-
console.log();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
console.log("=== RECOMMENDATION ===");
|
|
42
|
-
console.log("For ~1 hour coast on Saturday: numPriceGroups: 3, minSavingsPercent: 5");
|
|
43
|
-
|
|
44
|
-
// Test with user's actual config (5 groups, 8%)
|
|
45
|
-
console.log("\n=== WITH RUNWAY LOGIC (your config: 5 groups, 8%) ===\n");
|
|
46
|
-
|
|
47
|
-
const userSchedule = createSchedule(prices, 5, {
|
|
48
|
-
numPriceGroups: 5,
|
|
49
|
-
minSavingsPercent: 8,
|
|
50
|
-
minModeDuration: 60,
|
|
51
|
-
outputTimezone: "Europe/Oslo",
|
|
52
|
-
heatLossCoefficient: 0.05,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const saturdaySchedule = userSchedule.filter(s => s.time.startsWith("2026-01-17"));
|
|
56
|
-
console.log("Saturday Schedule (Oslo time):");
|
|
57
|
-
console.log("-".repeat(50));
|
|
58
|
-
saturdaySchedule.forEach(entry => {
|
|
59
|
-
const oslo = entry.time.substring(11, 16);
|
|
60
|
-
const mode = entry.mode.padEnd(6);
|
|
61
|
-
const price = entry.price.toFixed(2);
|
|
62
|
-
const marker = entry.mode === "coast" ? " <-- COAST" : entry.mode === "boost" ? " <-- BOOST" : "";
|
|
63
|
-
console.log(` ${oslo} ${mode} ${price} EUR${marker}`);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const satCoast = saturdaySchedule.filter(s => s.mode === "coast");
|
|
67
|
-
console.log(`\nSaturday coast intervals: ${satCoast.length} (${satCoast.length * 15} minutes)`);
|
|
68
|
-
if (satCoast.length > 0) {
|
|
69
|
-
console.log("Coast times:", satCoast.map(s => s.time.substring(11, 16)).join(", "));
|
|
70
|
-
const lastCoast = satCoast[satCoast.length - 1];
|
|
71
|
-
console.log(`Coast ends at: ${lastCoast.time.substring(11, 16)} (${lastCoast.price.toFixed(2)} EUR)`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Show tuning info
|
|
75
|
-
const tuning = userSchedule[0]?.tuning;
|
|
76
|
-
if (tuning) {
|
|
77
|
-
console.log(`\nTuning: Cheap=${tuning.clustering.cheapThreshold?.toFixed(1)}, Expensive=${tuning.clustering.expensiveThreshold?.toFixed(1)}, MaxCoast=${tuning.maxCoastIntervals} intervals`);
|
|
78
|
-
}
|