Demo tariffs: increase forecast to 5 days (#33174)

This commit is contained in:
Tilo Alexander 2026-08-26 10:11:40 +02:00 • committed by GitHub
parent 887ec9ecd2
commit 063088c070
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 12 deletions

View file

@ -36,7 +36,7 @@ render: |
forecast:
source: js
script: |
// Generate CO₂ forecast for next 72 hours in 15-minute slots
// Generate CO₂ forecast for next 120 hours in 15-minute slots
// Based on summer grid patterns with high solar penetration
var now = new Date();
var start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
@ -44,13 +44,13 @@ render: |
var baseIntensity = parseFloat({{ .base }});
var variation = parseFloat({{ .variation }});
// Generate 15-minute slots for 3 days
// Generate 15-minute slots for 5 days
var slotMinutes = 15;
var slotDuration = slotMinutes * 60 * 1000;
var slotsPerHour = 60 / slotMinutes;
var slotsPerDay = 24 * slotsPerHour;
for (var day = 0; day < 3; day++) {
for (var day = 0; day < 5; day++) {
for (var slot = 0; slot < slotsPerDay; slot++) {
var time = new Date(start.getTime() + (day * slotsPerDay + slot) * slotDuration);
var hour = slot / slotsPerHour;

View file

@ -48,8 +48,8 @@ render: |
forecast:
source: js
script: |
// Generate deterministic dynamic grid prices for 3 days in 15-minute slots
// Pattern repeats every 3 days for predictability
// Generate deterministic dynamic grid prices for 5 days in 15-minute slots
// Daily pattern (by hour) repeats for predictability
var now = new Date();
var start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
var rates = [];
@ -58,7 +58,7 @@ render: |
var priceRange = maxPrice - minPrice;
var noiseAmount = parseFloat({{ .noise }});
// Generate 15-minute slots for 3 days
// Generate 15-minute slots for 5 days
var slotMinutes = 15;
var slotDuration = slotMinutes * 60 * 1000;
var slotsPerHour = 60 / slotMinutes;
@ -95,7 +95,7 @@ render: |
return ((n - Math.floor(n)) * 2 - 1) * noiseAmount;
}
for (var day = 0; day < 3; day++) {
for (var day = 0; day < 5; day++) {
for (var slot = 0; slot < slotsPerDay; slot++) {
var time = new Date(start.getTime() + (day * slotsPerDay + slot) * slotDuration);
var hour = slot / slotsPerHour;

View file

@ -46,7 +46,7 @@ render: |
forecast:
source: js
script: |
// Generate realistic solar forecast with bell curve for next 72 hours in 15-minute slots
// Generate realistic solar forecast with bell curve for next 120 hours in 15-minute slots
var now = new Date();
var start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
var rates = [];
@ -73,13 +73,13 @@ render: |
}
}
// Generate 15-minute slots for 3 days
// Generate 15-minute slots for 5 days
var slotMinutes = 15;
var slotDuration = slotMinutes * 60 * 1000;
var slotsPerHour = 60 / slotMinutes;
var slotsPerDay = 24 * slotsPerHour;
for (var day = 0; day < 3; day++) {
for (var day = 0; day < 5; day++) {
for (var slot = 0; slot < slotsPerDay; slot++) {
var time = new Date(start.getTime() + (day * slotsPerDay + slot) * slotDuration);
var hour = slot / slotsPerHour;

View file

@ -30,7 +30,7 @@ render: |
forecast:
source: js
script: |
// Generate temperature forecast for next 72 hours in 15-minute slots
// Generate temperature forecast for next 120 hours in 15-minute slots
// Sinusoidal daily cycle between min and max: coldest around 05:00, warmest around 17:00
var now = new Date();
var start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
@ -44,7 +44,7 @@ render: |
var slotDuration = slotMinutes * 60 * 1000;
var slotsPerDay = (24 * 60) / slotMinutes;
for (var day = 0; day < 3; day++) {
for (var day = 0; day < 5; day++) {
for (var slot = 0; slot < slotsPerDay; slot++) {
var time = new Date(start.getTime() + (day * slotsPerDay + slot) * slotDuration);
var hour = (slot * slotMinutes) / 60;