Hallo zusammen,
ich habe eine kleine Idee, die mit ioBroker wahrscheinlich umsetzbar wäre - nur leider bin ich im Scripting blutiger Anfänger.
Folgendes Ziel: Beim dynamischen Stromtarif von Tibber gibt es jede Stunde einen anderen Preis / kWh. Mit dem Adapter "TibberConnect" kann ich die Tagespreise in den ioBroker laden. In der günstigsten Stunde am Tag soll jetzt ein Luftentfeuchter für diese eine Stunde laufen.
TibberConnect gibt mir in den Objekten eine JSON-Liste, bereits sortiert nach Preis. Heute sieht sie so aus:
[{"total":0.274,"energy":0.0742,"tax":0.1998,"startsAt":"2023-09-22T14:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2783,"energy":0.0778,"tax":0.2005,"startsAt":"2023-09-22T13:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2798,"energy":0.079,"tax":0.2008,"startsAt":"2023-09-22T15:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2877,"energy":0.0856,"tax":0.2021,"startsAt":"2023-09-22T12:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2895,"energy":0.0872,"tax":0.2023,"startsAt":"2023-09-22T01:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2905,"energy":0.088,"tax":0.2025,"startsAt":"2023-09-22T02:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2908,"energy":0.0883,"tax":0.2025,"startsAt":"2023-09-22T00:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2908,"energy":0.0882,"tax":0.2026,"startsAt":"2023-09-22T16:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2914,"energy":0.0888,"tax":0.2026,"startsAt":"2023-09-22T03:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.294,"energy":0.091,"tax":0.203,"startsAt":"2023-09-22T04:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.294,"energy":0.0909,"tax":0.2031,"startsAt":"2023-09-22T11:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.2948,"energy":0.0917,"tax":0.2031,"startsAt":"2023-09-22T05:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.3043,"energy":0.0996,"tax":0.2047,"startsAt":"2023-09-22T10:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.3084,"energy":0.1031,"tax":0.2053,"startsAt":"2023-09-22T23:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.3118,"energy":0.1059,"tax":0.2059,"startsAt":"2023-09-22T22:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.3131,"energy":0.107,"tax":0.2061,"startsAt":"2023-09-22T17:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.3198,"energy":0.1126,"tax":0.2072,"startsAt":"2023-09-22T06:00:00.000+02:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.3221,"energy":0.1146,"tax":0.2075,"startsAt":"2023-09-22T21:00:00.000+02:00","currency":"EUR","level":"NORMAL"},{"total":0.3265,"energy":0.1183,"tax":0.2082,"startsAt":"2023-09-22T09:00:00.000+02:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.3446,"energy":0.1334,"tax":0.2112,"startsAt":"2023-09-22T20:00:00.000+02:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.3473,"energy":0.1358,"tax":0.2115,"startsAt":"2023-09-22T08:00:00.000+02:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.3481,"energy":0.1364,"tax":0.2117,"startsAt":"2023-09-22T18:00:00.000+02:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.35,"energy":0.138,"tax":0.212,"startsAt":"2023-09-22T07:00:00.000+02:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.376,"energy":0.1599,"tax":0.2161,"startsAt":"2023-09-22T19:00:00.000+02:00","currency":"EUR","level":"EXPENSIVE"}]
Hier erkennt man, dass die günstigste Stunde heute ab 14 Uhr war. Und da hört mein Wissen für mich auf. Ich möchte ein Script erstellen, was mir diesen Wert ausgibt - ich habe aber nichtmal eine Idee, mit welcher Funktion ich so eine Liste "parsen" kann.