Hallo zusammen,
vielleicht kann jemand von Euch helfen.
In meiner OH2 Umgebung hatte ich die Funktion
Tag_der_Woche.postUpdate(now.getDayOfWeek)
in eine Rule eingebaut. Damit konnte ich die wöchentlichen Verbrauchsdaten / Tag berechnen.
Leider funktioniert diese funktion in OH3 nicht.
Kann mir jemand sagen, wie ich den Wochentag (als Zahl) herauskriege?
Danke im Voraus
Gerd
Wochentag als Zahl
- udo1toni
- Beiträge: 15496
- Registriert: 11. Apr 2018 18:05
- Wohnort: Darmstadt
Re: Wochentag als Zahl
DayOfWeek sollte die Zahl liefern. (also ohne das get).
openHAB5.0.3 stable in einem Debian-Container (trixie, OpenJDK 21 headless runtime - LXC, 4 Kerne, 3 GByte RAM)
Hostsystem Proxmox 9.1.2 - AMD Ryzen 5 3600 6 Kerne, 12 Threads - 64 GByte RAM - ZFS Pools: Raid Z1, 3 x 20 TB HDD -> 40 TByte und Raid Z0-Mirrored 4 x 1 TByte NVMe -> 2 TByte
Hostsystem Proxmox 9.1.2 - AMD Ryzen 5 3600 6 Kerne, 12 Threads - 64 GByte RAM - ZFS Pools: Raid Z1, 3 x 20 TB HDD -> 40 TByte und Raid Z0-Mirrored 4 x 1 TByte NVMe -> 2 TByte
-
GerdTernes
- Beiträge: 25
- Registriert: 5. Okt 2020 15:55
Re: Wochentag als Zahl
Danke für die schnelle Antwort, aber leider funktioniert DayofWeek nicht. Folgende meldung:
failed: 'DayofWeek' is not a member of 'java.time.ZonedDateTime';
failed: 'DayofWeek' is not a member of 'java.time.ZonedDateTime';
- udo1toni
- Beiträge: 15496
- Registriert: 11. Apr 2018 18:05
- Wohnort: Darmstadt
Re: Wochentag als Zahl
Hmm... OK, probiere bitte mal
getValue sollte die Zahl hinter der Enumeration liefern.
Code: Alles auswählen
now.getDayOfWeek.getValueopenHAB5.0.3 stable in einem Debian-Container (trixie, OpenJDK 21 headless runtime - LXC, 4 Kerne, 3 GByte RAM)
Hostsystem Proxmox 9.1.2 - AMD Ryzen 5 3600 6 Kerne, 12 Threads - 64 GByte RAM - ZFS Pools: Raid Z1, 3 x 20 TB HDD -> 40 TByte und Raid Z0-Mirrored 4 x 1 TByte NVMe -> 2 TByte
Hostsystem Proxmox 9.1.2 - AMD Ryzen 5 3600 6 Kerne, 12 Threads - 64 GByte RAM - ZFS Pools: Raid Z1, 3 x 20 TB HDD -> 40 TByte und Raid Z0-Mirrored 4 x 1 TByte NVMe -> 2 TByte
-
GerdTernes
- Beiträge: 25
- Registriert: 5. Okt 2020 15:55
Re: Wochentag als Zahl
super, das funktioniert. Vielen Dank!