nach langer zeit melde ich mich mal wieder mit einem problem.
Openhabversion 4.1.0.M3
Ich bekomme eine regel via Blocky nicht zum laufen.
Code: Alles auswählen
if (((time.ZonedDateTime.now()) > (time.toZDT('05:00')) && (time.ZonedDateTime.now()) < (time.toZDT('08:00')) || (time.ZonedDateTime.now()) > (time.toZDT('16:00')) && (time.ZonedDateTime.now()) < (time.toZDT('23:59'))) && items.getItem('Aussendaten_Helligkeit_Aussen').state < '100') {
console.info('Licht AN');
console.info(items.getItem('Aussendaten_Helligkeit_Aussen').state);
} else {
console.info('Licht AUS');
console.info(items.getItem('Aussendaten_Helligkeit_Aussen').state);
}
Mir scheint es so als würde der abgleich nicht funktionieren.
Die regel wurde mit Blocky erstellt, vielleicht liegt da auch irgendwo der fehler.
Gedanke war wenn zwischen 05:00 und 08:00 Uhr oder zwischen 16:00 und 23:59 und item Hellligkeit Aussen gibt wert < 100 zurück mache Licht an, sonst aus. Es sei denn der Wert ist 0.
im Log seh ich dann aber nur Aus
Code: Alles auswählen
2023-11-23 23:14:22.079 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AN
2023-11-23 23:14:22.082 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - 0
2023-11-23 23:28:53.875 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AUS
2023-11-23 23:29:25.467 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AN
2023-11-23 23:29:25.469 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - 0
2023-11-23 23:29:52.562 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AUS
2023-11-23 23:30:45.293 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AUS
2023-11-23 23:30:45.296 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - 101
2023-11-23 23:32:12.194 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AUS
2023-11-23 23:32:12.198 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - 99
2023-11-23 23:33:26.573 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AUS
2023-11-23 23:33:26.578 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - 50
2023-11-23 23:33:43.654 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AUS
2023-11-23 23:33:43.657 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - 50
2023-11-23 23:34:24.483 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - Licht AN
2023-11-23 23:34:24.487 [INFO ] [nhab.automation.script.ui.86f8e7ad86] - 0
Danke im voraus für die Hilfe.