How to configure a rule condition on color state in OH3 - Web-Interface?

Thanks for sharing the links and your comments.

As also written in a different post (How to delay (the sending of) a mqtt request?) I am trying to combine 2 things into one item with some rules.

My RGB LED strip is controlled by an esp32 and as the power supply has a high standby power consumption I want to use a ikea switch before the power supply.

  • If I now change the color of the RGB Item I want a rule to be executed and switch on the switch.
  • If I switch off the LEDs by setting them to “black” RGB(0,0,0) the switch shall be turned off.

Currently I am using the following rules (code from code-section in WEB-UI)

triggers:
  - id: "1"
    configuration:
      itemName: ESP32KitchenLeft_Color
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "4"
    configuration:
      itemName: ESP32KitchenLeft_Color
      state: 0,0,0
      operator: "!="
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: NetzteilKuche_Betrieb
      command: ON
    type: core.ItemCommandAction
triggers:
  - id: "1"
    configuration:
      itemName: ESP32KitchenLeft_Color
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "3"
    configuration:
      itemName: ESP32KitchenLeft_Color
      state: 0,0,0
      operator: =
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: NetzteilKuche_Betrieb
      command: OFF
    type: core.ItemCommandAction

But with those the switch is not actuated as expected.
Sometimes

  • if I switch the color item from HSB(0,0,0) to HSB(0,0,100) the switch is turned on
  • if I switch the color item from HSB(0,0,0) to HSB(0,100,0) the switch is turned on and then off again

But in other times it does not turn on/off the switch at all.

So I am a bit lost how to trace down the issue now in OH.