Hello @openhabber,
For commands, it is event.itemCommand, if anyone is wondering.
You mean UI-based, right?
I really searched for that. Maybe the docs should at least mention them?
Maybe, but I think would be better if it event is the same in UI-based and file-based. In file-based, the event is formatted by this function: openhab-js/rules/rules.js at 394fb9959ce92f57766d495fb98c298276d78615 · openhab/openhab-js · GitHub
If I am able to apply this in UI-based, it would be the same - I will take a look at it later.
In addition, the autocorrect on the UI editor predicts the wrong elements.
Yes, I have also noticed this, that’s one of the things that have to be changed in the codecompletion.
Also the dump does not seem that helpful.
Oh sorry, I forgot that dumpObject() had an issue that was recently solved but no new version was published yet.
On my system (with the fixed dumpObject()), it looks like the following for file-based ItemCommandTrigger:
2022-04-24 12:12:43.326 [INFO ] [org.openhab.automation.script.utils ] - Dumping object...
2022-04-24 12:12:43.329 [INFO ] [org.openhab.automation.script.utils ] - typeof obj = object
2022-04-24 12:12:43.332 [INFO ] [org.openhab.automation.script.utils ] - Java.isJavaObject(obj) = false
2022-04-24 12:12:43.335 [INFO ] [org.openhab.automation.script.utils ] - Java.isType(obj) = false
2022-04-24 12:12:43.340 [INFO ] [org.openhab.automation.script.utils ] - getOwnPropertyNames(obj) = eventType,triggerType,receivedCommand,oldState,newState,itemName,module
2022-04-24 12:12:43.353 [INFO ] [org.openhab.automation.script.utils ] - getAllPropertyNames(obj) = eventType,triggerType,receivedCommand,oldState,newState,itemName,module,__proto__,constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf,__defineGetter__,__defineSetter__,__lookupGetter__,__lookupSetter__