if (items.getItem('Wetterstation_Dach_Rain').state == 'NEIN') {
logInfo("Aussentemperature", "Aussentemperatur ist: " + Wetterstation_Dach_Rain )
}
The method or field items is undefined; line 4, column 115, length 5
Could someone pls tell me how I can access this item?
As to my understanding, if you are using toString method, you need parenthesis toString(). I have seen weird messages/results when omitting them. But you might be dropping toString method entirely, depending on the item‘s type.
To be on the safe side and to put it alltogether, incl. Jims comment:
Hello I have no idea what happend but it turned out this expression in OH4.1 (windows11) does not work (anymore). I use the inline script “rule DSL”.
if (items.getItem('Wetterstation_Dach_Rain').state == 'Nein') {
items.getItem('KNX_Device_Aktor_A3_Kuche_Licht_Bar').sendCommand('OFF');
}
I made the same with blockly which gives me this working (!) code:
if (items.getItem('Wetterstation_Dach_Rain').state == 'Nein') {
items.getItem('KNX_Device_Aktor_A3_Kuche_Licht_Bar').sendCommand('OFF');
}
The error message for the first snipped is:
if (items.getItem('Wetterstation_Dach_Rain').state == 'Nein') {
items.getItem('KNX_Device_Aktor_A3_Kuche_Licht_Bar').sendCommand('OFF');
}
The method or field items is undefined; line 1, column 229, length 5