Struggling with threshold variables for rule in OH3

  • Platform information:
    • OS: unRAID / Container
    • openHAB version: openHAB 3.3.0.M1

I’m trying to configure a basic rule to turn on my Air conditioning, when the temperature exceeds a limit, but it never fires.

I’ve tried setting a threshold for this, but I believe my syntax might be off, around the fact that I’m want it to trigger when LoungeMultisensor_Sensortemperature is greater than an amount, and not an exact number.

Rule text below, it was created in design mode. Thanks for any help

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: LoungeMultisensor_Sensortemperature
      state: =>25
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "5"
    configuration:
      startTime: 10:00
      endTime: 17:00
    type: core.TimeOfDayCondition
  - inputs: {}
    id: "6"
    configuration:
      itemName: LoungeSensibo_MasterSwitch
      state: OFF
      operator: =
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      command: ON
      itemName: LoungeSensibo_MasterSwitch
    type: core.ItemCommandAction
  - inputs: {}
    id: "3"
    configuration:
      command: cool
      itemName: LoungeSensibo_Mode
    type: core.ItemCommandAction
  - inputs: {}
    id: "4"
    configuration:
      command: "23"
      itemName: LoungeSensibo_TargetTemperature
    type: core.ItemCommandAction

Can’t do that in a trigger.

You might also have to consider “25 what” i.e. does your Item have units

Showing only what need to change:

triggers:
  - id: "1"
    configuration:
      itemName: LoungeMultisensor_Sensortemperature
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "7"
    configuration:
      itemName: LoungeMultisensor_Sensortemperature
      operator: ">="
      state: "25"
    type: core.ItemStateCondition

The same rule in its entirety written in jruby (file based rule)

require 'openhab'

rule 'Turn on Aircon when hot during the day' do
  changed LoungeMultisensor_Sensortemperature
  between '10am'..'5pm'
  only_if { LoungeMultisensor_Sensortemperature >= '25 °C' }
  not_if LoungeSensibo_MasterSwitch
  run do
    LoungeSensibo_MasterSwitch << ON
    LoungeSensibo_Mode << 'cool'
    LoungeSensibo_TargetTemperature << '23 °C' # if your temperature item supports unit, otherwise just 23
  end
end