if (Staubsauger_Kueche == OFF) {
raum = 17;
print(raum);
}
But the state of the variable is not printed. Could you please help me to find the syntax errors?
Addion to that, is there somehow a documentation how to programm Javascript scripts in Openhab? I just found a very tiny one. Some examples would be great.
print(items.Staubsauger_Kueche);
if (items.Staubsauger_Kueche == ON) {
var raum = 17;
print(raum);
}
if (items.Staubsauger_Flur == ON) {
var raum = raum + ',' + 18;
print(raum);
}
events.sendCommand(event.EZ_ExecuteCommand, "app_segment_clean[18]");
I got following error:
ON
17
17,18
23:54:52.508 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID ā443f42942aā failed: ReferenceError: āeventā is not defined in at line number 28
event only exists when the rule is triggered by an Item event. If it was triggered manually (by pressing the play button), from another rule, or via a time based trigger.
And it appears you are misusing event here. To send a command to an Item, pass the name of the Item as a String.