and get a warning I can’t explain reading the documentatiën
Item 'HueWoonkamerAmbientIlluminanc' needed for rule 'rule-17-ca733f77-80fa-4618-a5c5-b98465d65795' is missing. Trigger 'baa3d813-0d02-494c-9e36-c9bb8d8a51ee' will not work.
[ERROR] [automation.script.file.javartrial.js] - Failed to execute rule rule-17-ce088287-10c3-4c89-9632-16f8b58975ad: ReferenceError: "HueWoonkamerAmbientIlluminance" is not defined: ReferenceError: "HueWoonkamerAmbientIlluminance" is not defined
I’m both cases the error means you are referencing an Item that doesn’t exist. That usually means a typo in the Item name as you’ve typed it in the rule.
I copied the item from the items file.
I’m 100% sure that item exist.
The DSL rule as below is working
rule "Woonkamer lampen uit als het licht wordt"
when
Item HueWoonkamerAmbientIlluminance changed
then
logInfo("default.rules", "Lichtsterkte woonkamer veranderd: " + HueWoonkamerAmbientIlluminance.state )
end