Simple DSL rule is not firing at all GUI based

i am not a pro in web gui dsl rules (using mainly jss) but i added a simpy rule:

configuration: {}
triggers:

  • id: “1”
    configuration:
    itemName: FP_sensor_motion
    command: ON
    type: core.ItemCommandTrigger
    conditions:
    actions:
  • inputs: {}
    id: “3”
    configuration:
    itemName: shellydimmer2cc7b5c522d4a__1921680151_Brightness
    command: ON
    type: core.ItemCommandAction
  • inputs: {}
    id: “4”
    configuration:
    sink: appletv:device:12-54-B9-78-AA-8B
    sound: barking.mp3
    type: media.PlayAction

When i “Run” it from a play button in web gui it works, but when i change FP_sensor_motion item from OFF TO ON, there rule is not firing at all. Its quite easy, not sure what is happening. Tried to debug with:

log:set DEBUG org.openhab.core.model.rule
log:set DEBUG org.openhab.core.model.script
log:set DEBUG org.openhab.core.model.script.engine
log:set DEBUG org.eclipse.xtext.xbase.interpreter

but logs are empty during changing the FP_senso_motion item.

2025-09-09 19:15:42.467 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from ON to OFF
2025-09-09 19:15:43.070 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘FP_sensor_motion’ received command ON
2025-09-09 19:15:43.081 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from OFF to ON
2025-09-09 19:15:43.541 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘FP_sensor_motion’ received command OFF
2025-09-09 19:15:43.545 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from ON to OFF
2025-09-09 19:15:43.702 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘FP_sensor_motion’ received command ON
2025-09-09 19:15:43.705 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from OFF to ON
2025-09-09 19:15:43.875 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘FP_sensor_motion’ received command OFF
2025-09-09 19:15:43.877 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from ON to OFF
2025-09-09 19:15:44.036 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘FP_sensor_motion’ received command ON
2025-09-09 19:15:44.039 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from OFF to ON
2025-09-09 19:15:44.189 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘FP_sensor_motion’ received command OFF
2025-09-09 19:15:44.193 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from ON to OFF
2025-09-09 19:15:44.333 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘FP_sensor_motion’ received command ON
2025-09-09 19:15:44.340 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘FP_sensor_motion’ changed from OFF to ON

any clues?

label: FP2 detected motion
type: Switch
icon: presence
groupNames:

  • FP2_sensor
    tags:
  • Status

First of all, please use code fences, otherwise your code becomes unreadable. Especially if it is YAML which highly depends on the text idents

Your code goes here, e.g.:

configuration: {}
triggers:
  id: “1”
  configuration:
    itemName: FP_sensor_motion
    command: ON
    type: core.ItemCommandTrigger
...

It seems to me as either there’s an empty condition, or the square is also something interpreted as another symbole by the forum (that’s why code fences are important as well :wink: )

configuration: {}
triggers:
  - id: "2"
    configuration:
      itemName: FP_sensor_motion
      state: ON
    type: core.ItemStateChangeTrigger
conditions: []
actions:
  - inputs: {}
    id: "4"
    configuration:
      sink: appletv:device:12-54-B9-78-AA-8B
      sound: barking.mp3
    type: media.PlayAction

Note, this rule has nothing to do with Rules DSL. It’s just a “Simple UI Rule” and it doesn’t use any rules language at all. It’s executed natively by the rules engine.

Your original rule and the rule you posted in code fences are different. The original is configured to trigger only for ON commands. The new one is configured to trigger only on changes to the state ON.

As for the action, just to ensure there isn’t something going wrong with the playing of the sound, just send a command to a test Item.

now i noticed that sth is strange with my instance and part of the budles are missing

2025-09-09 20:20:19.404 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-persistence-mapdb, openhab-binding-exec, openhab-core-config-discovery-addon-mdns, openhab-automation-pidcontroller, openhab-core-config-discovery-addon-upnp, openhab-core-config-discovery-addon-sddp, openhab-misc-openhabcloud, openhab-binding-network, openhab-transformation-regex, openhab-transformation-jsonpath, openhab-automation-jsscripting, openhab-binding-shelly, openhab-automation-pwm, openhab-binding-mqtt, openhab-binding-tuya, openhab-persistence-rrd4j, openhab-transformation-map, openhab-ui-basic, openhab-misc-homekit, openhab-binding-openweathermap, openhab-binding-http, openhab-transformation-exec, openhab-core-config-discovery-addon-usb, openhab-core-config-discovery-addon-ip': Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-ui-basic; type=karaf.feature; version="[5.1.0.SNAPSHOT,5.1.0.SNAPSHOT]"; filter:="(&(osgi.identity=openhab-ui-basic)(type=karaf.feature)(version>=5.1.0.SNAPSHOT)(version<=5.1.0.SNAPSHOT))" [caused by: Unable to resolve openhab-ui-basic/5.1.0.SNAPSHOT: missing requirement [openhab-ui-basic/5.1.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.ui.basic; type=osgi.bundle; version="[5.1.0.202509091505,5.1.0.202509091505]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.ui.basic/5.1.0.202509091505: missing requirement [org.openhab.ui.basic/5.1.0.202509091505] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.google.gson)(version>=2.13.0)(!(version>=3.0.0)))"]]

i will try to solve this in first place

Yes indeed i change the rule trying to check other possibilities, but no option is working for me. I notice a strange bevahiour of bundles right now, some of them are missing and i am not able to install them from the GUI. not sure what is happening but maybe problem of the rule is somehow connected. I rebooted, cleared the cache and want to see if i get back the addons which were installed earlier

Ok sorry for bothering you, it was not a problem with the rule. Something bad happen with the whole instance, clearing cache and rebooted and it’s running ok. The rules is firing right now without a problem

2 Likes

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.