OH3 UI Rule: doesn't trigger as intended

I have a simple use case:

  1. got an Switch-item, when there’s movement in front of my house
  2. got an Switch-item, which states “it’s dark outside”
  3. if there’s movement and it’s dark, the lights (switch-item) should go on

That’s the very simple rule:

configuration: {}
  - id: "1"
      command: ON
      itemName: DB_Motion
    type: core.ItemCommandTrigger
  - inputs: {}
    id: "2"
      itemName: StateDarkoutside
      state: ON
      operator: =
    type: core.ItemStateCondition
  - inputs: {}
    id: "3"
      command: ON
      itemName: KNX_EntranceLight
    type: core.ItemCommandAction

But it won’t trigger like ever? What do I miss here? :wink:
I could put it in a script instead of that simple UI-rule (and it works that way), but I’d like to know, what I didn’t count in here?

Here’s some logs for it:

2022-11-18 16:36:00.042 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'StateDarkoutside' received command ON
2022-11-18 16:36:00.045 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'StateDarkoutside' changed from OFF to ON
2022-11-18 19:53:58.019 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DB_Motion' changed from OFF to ON

You seem to be looking for a command to trigger the rule.
Sensors don’t usually get commands.

It’s vital to understand the distinction between command and state when working with openHAB Items.

1 Like

Oh. Yeah. That’s right. :kissing_closed_eyes:

ItemStateChangeTrigger should do it for DB_Motion. In a recent refactoring I changed the trigger item from one triggered by a rule via .sendCommand to a sensor’s item. And as you said, the Doorbell binding just updates its items…