OH3 help with rule

Hello guys.
Playing with rules in OH3, trying to make a script that turns on my outdoor light when brightness is below 20.0 - but been told that I can’t do it that way - anyone can help me over the hurdle and show a quick sample?

triggers:

  • id: “1”
    configuration:
    itemName: gOutside_UdendorsLysstyrkeLUX
    state: “>20.0”
    type: core.ItemStateUpdateTrigger
    conditions: []
    actions:
  • inputs: {}
    id: “2”
    configuration:
    itemName: gOutside_OutputHCUBEPaFacadeNord
    command: OFF
    type: core.ItemCommandAction
  • inputs: {}
    id: “3”
    configuration:
    itemName: 500Dimmer_Channel1SpotsIndhakUdendors
    command: OFF
    type: core.ItemCommandAction

You can’t do a comparison in the trigger. You need to create a condition to check the level. That’s the “But only if…” section.

Awesome, so a real “script” is not needed then…

Not for this. But if you get event just a little more complex you’ll have to create Script Actions or Script Conditions.

Perfect I see that…
I’m planning to Learn the JavaScript way - so must start reading :slight_smile: