NEWS
Husqvarna NextStartTimestamp über VIS ausgeben
-
Hallo Zusammen,
Ich benutze den Husqvarna Adapter und erhalte einen Wert NextStartTimestamp.Um diesen Wert umzuformatieren habe ich folgenden Java Code gefunden:
const nextStartTimestamp = 'husqvarna-automower.0.14474d9c-f9f7-4dd7-94c7-b25479xxxxx.planner.nextStartTimestamp'/Timestamp for the next auto start in milliseconds since 1970-01-01T00:00:00 in local time If the mower is charging then the value is the estimated time when it will be leaving the charging station If the value is 0 then the mower should start now NOTE! This timestamp is in local time for the mower and is coming directly from the mower/; // Beispiel-Zeitstempel (entspricht dem 25. März 2023 um 12:00 Uhr)
const date = new Date(nextStartTimestamp);
const year = date.getFullYear();
const month = date.getMonth() + 1; // Monate sind 0-basiert, daher +1
const day = date.getDate();
const hours = date.getHours();
const minutes = date.getMinutes();const formattedDate =
${day}.${month}.${year} um ${hours}:${minutes} Uhr
;Mein Wunsch wäre nun ein Blockly zu haben (mit dem obigen JAVA Code integriert), dass alle 15Min diesen Wert (formattedDate) in eine Variable in IOBroker schreibt (z.B. eine Variable in 0_userdata), die ich in VIS anzeigen kann.
Kann mir da jemand helfen? -