Rules triggering not working in OH3

**default.items:**
// Control zigbee2mqtt
Group        gZigbeeMQTT        "Zigbee2mqtt"
String   ZigbeeState                            "Zigbee2mqtt state"                       <switch>              (gZigbeeMQTT)                                   { channel="mqtt:topic:myMQTTBroker:zigbeeMQTT:state"                           }
Switch   ZigbeePermitJoin                       "Permit join new devices"                 <switch>              (gZigbeeMQTT)                                   { channel="mqtt:topic:myMQTTBroker:zigbeeMQTT:permitJoin"                      }
String   ZigbeeLogType                          "Zigbee2mqtt log type"                    <none>                (gZigbeeMQTT)                                   { channel="mqtt:topic:myMQTTBroker:zigbeeMQTT:logType"                         }
String   ZigbeeLogMessage                       "Zigbee2mqtt log message"                 <none>                (gZigbeeMQTT)                                   { channel="mqtt:topic:myMQTTBroker:zigbeeMQTT:logMessage"                      }


// aqara WXKG07LM        schakelaar_double,        OntwikkelSchakelaar
String   schakelaar_50action                    "Action [%s]"                             <wallswitch>          (gZigbeeSwitch)                                 { channel="mqtt:topic:myMQTTBroker:schakelaar_50:action"                       }
Number   schakelaar_50Battery                   "Battery [%d %%]"                         <battery>             (gZigbeeSwitch)                                 { channel="mqtt:topic:myMQTTBroker:schakelaar_50:battery"                      }
Number   schakelaar_50Linkquality               "linkquality [%s]"                        <qualityofservice>    (gZigbeeSwitch)                                 { channel="mqtt:topic:myMQTTBroker:schakelaar_50:linkquality"                  }
Number   schakelaar_50Voltage                   "Voltage [%d mV]"                         <energy>              (gZigbeeSwitch)                                 { channel="mqtt:topic:myMQTTBroker:schakelaar_50:voltage"                      }


// IKEA TRADFRI bulb GU10 WW 400lm
Number   HOB_burolampLinkquality                "Burolamp linkquality [%s]"               <qualityofservice>    (gZigbeeSwitch)                                 { channel="mqtt:topic:myMQTTBroker:HOB_burolamp:linkquality"                   }
Switch   HOB_burolampState                      "Burolamp Status [%s]"                    <Light>               (Hobbykamer, BeganegrondState, HobbykamerState) { channel="mqtt:topic:myMQTTBroker:HOB_burolamp:state"                         }
Dimmer   HOB_burolampBrightness                 "Burolamp Brightness [%d %%]"             <Slider>              (Hobbykamer)                                    { channel="mqtt:topic:myMQTTBroker:HOB_burolamp:brightness"                    }
String   HOB_burolampEffect                     "Burolamp effect [%s]"                    <wind>                (Hal)                                           { channel="mqtt:topic:myMQTTBroker:HOB_burolamp:effect"                        }

MQTT.things:

your code goes hereBridge mqtt:broker:myMQTTBroker                 [ host="localhost", secure=false                                                                                                                                                                         ] 
{

    // zigbee2mqtt Bridge information
  Thing topic zigbeeMQTT "Zigbee2mqtt" @ "tijdelijk_onzichtbaar" {
    Channels:
      Type string : logType                     [ stateTopic="zigbee2mqtt/bridge/log/type"                                                                                                                                                               ]
      Type string : logMessage                  [ stateTopic="zigbee2mqtt/bridge/log/message"                                                                                                                                                            ]
      Type switch : permitJoin                  [ stateTopic="zigbee2mqtt/bridge/config/permit_join"                                                                    , on="true", off="false"                                                         ]
      Type string : state                       [ stateTopic="zigbee2mqtt/bridge/state"                                                                                                                                                                  ]
  }




    // Xiaomi Aqara D1 double key wireless wall switch WXKG07LM
  Thing topic schakelaar_50 "OntwikkelSchakelaar" {
    Channels:
      Type string : action                      [ stateTopic="zigbee2mqtt/schakelaar_50/action"                                                                                                                                                          ]
      Type number : battery                     [ stateTopic="zigbee2mqtt/schakelaar_50/battery"                                                                                                                                                         ]
      Type number : linkquality                 [ stateTopic="zigbee2mqtt/schakelaar_50/linkquality"                                                                                                                                                     ]
      Type number : voltage                     [ stateTopic="zigbee2mqtt/schakelaar_50/voltage"                                                                                                                                                         ]
  }

  //Ikea GU10_Ledlamp LED1837R5 - IKEA TRADFRI bulb GU10 WW 400lm with address ........
  Thing topic HOB_burolamp "burolamp_hobbykamer" {
    Channels:
      Type dimmer : brightness                  [ stateTopic="zigbee2mqtt/HOB_burolamp/brightness"       , commandTopic="zigbee2mqtt/HOB_burolamp/set/brightness"       , on="ON", off="OFF", min=1, max=255, formatBeforePublish="%d" ,  retained=false ]
      Type switch : state                       [ stateTopic="zigbee2mqtt/HOB_burolamp/state"            , commandTopic="zigbee2mqtt/HOB_burolamp/set"                  , on="ON", off="OFF"                                                             ]
      Type number : linkquality                 [ stateTopic="zigbee2mqtt/HOB_burolamp/linkquality"                                                                                                                                                      ]
      Type string : effect                      [ stateTopic="zigbee2mqtt/HOB_burolamp/effect"           , commandTopic="zigbee2mqtt/HOB_burolamp/set/effect"           , blink="Blink", breathe="Breathe"                                               ]
  }
}

Looks OK at first glance. Can you try completely restarting openHAB? Sometimes edits to Things files are not properly picked up.

OH3 runs on a separate virtual machine, that means that I restart openhab and the VM every time that I continue ‘developing’ the migration from OH2 to OH3.

If the Item event isn’t happening the problem lies between the Item and the device. This means one or more of these is going wrong:

  • there is no item channel link or the link is wrong
  • the channel is misconfigured
  • the Broker thing is misconfigured
  • the end device isn’t publishing the message

All I can really suggest is to check each is these in turn and verify each of them, pregnant in reverse order from what I listed above.

In reverse order:

** the end device isn’t publishing the message*
Having two implementations of OpenHAB, the first: my “production”-state OH2 environment, and second: my “development”-state OH3 environment, I move one bulb, one switch and the only one zigbee_usb_dongle from OH2 to OH3 environment and vice versa.
That proves that the end device is publishing messages as it is functioning after it has been placed back in the OH2 environment.

  • the Broker thing is misconfigured
    In my first post I wrote:
    By means of the UI of openHAB 3.4.2, I can switch on/off the light, so this proves a connection between openHAB, mqtt and zigbee.
    I assumed a correct configuration of the Broker thing. Do you agree?

the channel is misconfigured and there is no item channel link or the link is wrong
I think that my previous remark is also valid for these two possibilities?

Besides this, I compared my OH3 and OH2 systems and I noticed that I did not “add-on” the Javascript-Transformation and the JSONPath-Transformation. Even after adding these add-ons nothing changed.

In the file log4j2.xml, I changed “Logger level=INFO” to DEBUG. I could not find relevant information.

Summarized:

  • Clean OS
  • mosquitto
  • zigbee2mqtt
  • unzipped: openhab-3.4.2.zip
  • add-ons: MQTT-binding, zigbee-binding, Javascript-Transformation, JSON-transformation
  • things: See above (file based)
  • items: See above (file based)
var loginfo_rulefile = String::format( "%26s", "ohb3_switch_to_ON.rules" )

rule "switch_to_ON"
when
        Item schakelaar_50action received update left
        or
        Item schakelaar_50action received update single_left
        or
        Item schakelaar_50action received command left
        or
        Item schakelaar_50action changed
then
        var loginfo_rulename = String::format( "%-54s, ", "RULE=switch_to_ON" )
        HOB_burolampState.sendCommand( ON )
        logInfo( loginfo_rulefile, loginfo_rulename + "switched to  ON" )
end

Don’t string items need to have their values in quotation marks?

update "left"

Maybe that’s only required if there are spaces in the value, but I’ve always just done it that way.

It sounds like you’re having trouble getting your physical switch to trigger the rules file in your OH3 environment. You’ve confirmed that your zigbee network and mqtt are working correctly, and you’re able to switch the light on/off via the UI. However, when you press the physical switch, the rules file isn’t triggered even though it contains trigger conditions for the “left” action. Updating the rules file causes it to go through the UNINITIALIZED, INITIALIZING, and IDLE stages in the karaf console, but still no luck. It’s difficult to diagnose the issue without more information, but one possibility could be that the physical switch isn’t properly sending the “left” action to OH3.

@Russ: I tried that but there is no effect.

Yesterday I started from scratch with a new VM, this time not Rocky9 but Rocky8.5 because Rocky9 is not yet supported (GitHub - nodesource/distributions: NodeSource Node.js Binary Distributions).
Murphy was there too: The only test switch in my OH3 environment suffered from an almost empty battery. Battery replaced and two other switches added to OH3, one Ikea, one Xiaomi, just to eliminate issues with a specific switch.

Results so far:
In my new OH3@Rocky8 environment I have exactly the same issue: Rules do not get triggered.
My conclusion to date is: I must have missed an important step…
What could that be???

Installed:

  • Rocky-8.5
  • mosquitto, File /etc/mosquitto/mosquitto.conf: Completely default
  • nodejs: v19.8.1
  • npm: 9.5.1
  • java-11-openjdk
  • setcap ‘cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep’ /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el8_7.x86_64/bin/java
  • symbolic link: /usr/lib64/libjli.so → /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el8_7.x86_64/lib/jli/libjli.so

Accounts: openhab, zigbee2mqtt, members of groups tty, dialout

Firewall ports: 8080, 1883
SELinux: permissive

Files: (copied from OH2 environment, but reduced to just a few things)

  • /opt/openhab3/conf/things/MQTT.things
  • /opt/openhab3/conf/items/default.items
  • /opt/openhab3/conf/rules/ohb3_switch_to_OFF.rules
  • /opt/openhab3/conf/rules/ohb3_switch_to_ON.rules
  • /opt/openhab3/conf/transform/schakelaar_action.js

openhab UI:

  • initial account: openhab

Bindings:

  • MQTT Binding
  • openHAB ZigBee Binding

Other Add-ons:

  • Javascript Transformation
  • JSONPath Transformation

Settings:

  • Model : --nothing–
  • Items : Burolamp Status OFF or ON, switching on/off light: works fine
  • Items : Burolamp Brightness: 16, dimmer works fine
  • Items : all other items like Linkquality, Voltage,…: NULL
  • Pages : --untouched–
  • Rules : all rules: green and IDLE
  • Scripts: 0 scripts
  • Schedule: Nothing in the schedule

Commandline:

  • mosquitto_pub -t zigbee2mqtt/bridge/request/health_check -m “” —>>> payload ‘{“data”:{“healthy”:true},“status”:“ok”}’
  • mosquitto_pub -t zigbee2mqtt/HOB_burolamp/set -m ‘{ “state”: “ON” }’ —>>> works fine
  • mosquitto_pub -t zigbee2mqtt/HOB_burolamp/set -m ‘{ “state”: “OFF” }’ —>>> works fine

Two times the same issue. EBCAK??
My conclusion to date is: I must have missed an important step…
What could that be???

It’s been a while since I’ve used DSL, but shouldn’t ON be a string?

HOB_burolampState.sendCommand("ON")

Can you show us the openhab and events logs from around the times that you think the triggering should be occurring?

What’s this used for?

About ON versus “ON”: A quick scan in OH2 rules: I have used both. I remember that in specific cases the quotes are required.

About the logs:
The file events.log shows only events about startting/stopping openhab and events when manipulating light from the UI, like switching on/off and sliding the dimmer.

2023-04-01 12:09:27.189 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 37 to 35
2023-04-01 12:09:27.379 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampBrightness' received command 34
2023-04-01 12:09:27.382 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampBrightness' predicted to become 34
2023-04-01 12:09:27.383 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 35 to 34
2023-04-01 12:09:27.796 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampBrightness' received command 31
2023-04-01 12:09:27.798 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampBrightness' predicted to become 31
2023-04-01 12:09:27.800 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 34 to 31
2023-04-01 12:09:27.997 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampBrightness' received command 29
2023-04-01 12:09:27.998 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampBrightness' predicted to become 29
2023-04-01 12:09:28.002 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 31 to 29
2023-04-01 12:09:38.903 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampBrightness' received command 4
2023-04-01 12:09:38.905 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampBrightness' predicted to become 4
2023-04-01 12:09:38.906 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 29 to 4
2023-04-01 12:09:56.870 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampBrightness' received command 3
2023-04-01 12:09:56.872 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampBrightness' predicted to become 3
2023-04-01 12:09:56.873 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 4 to 3
2023-04-01 12:09:57.066 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampBrightness' received command 2
2023-04-01 12:09:57.067 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampBrightness' predicted to become 2
2023-04-01 12:09:57.069 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 3 to 2
2023-04-01 12:10:01.353 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampBrightness' received command 1
2023-04-01 12:10:01.354 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampBrightness' predicted to become 1
2023-04-01 12:10:01.357 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampBrightness' changed from 2 to 1
2023-04-01 12:13:13.076 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:myMQTTBroker:schakelaar_50' changed from ONLINE to UNINITIALIZED
2023-04-01 12:13:13.128 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:myMQTTBroker:schakelaar_50' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2023-04-01 12:13:13.128 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:myMQTTBroker:HOB_burolamp' changed from ONLINE to UNINITIALIZED
2023-04-01 12:13:13.176 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:myMQTTBroker:HOB_burolamp' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2023-04-01 12:13:13.177 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:myMQTTBroker:zigbeeMQTT' changed from ONLINE to UNINITIALIZED
2023-04-01 12:13:13.178 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:myMQTTBroker:zigbeeMQTT' changed from UNINITIALIZED to ONLINE
2023-04-01 12:13:13.223 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:myMQTTBroker:zigbeeMQTT' changed from ONLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)
2023-04-01 12:13:13.231 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:myMQTTBroker' changed from ONLINE to UNINITIALIZED
2023-04-01 12:13:13.243 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:myMQTTBroker' changed from UNINITIALIZED to OFFLINE (COMMUNICATION_ERROR): Client sent DISCONNECT
2023-04-01 12:13:13.246 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:myMQTTBroker' changed from OFFLINE (COMMUNICATION_ERROR): Client sent DISCONNECT to OFFLINE
2023-04-01 12:13:13.260 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:myMQTTBroker' changed from OFFLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)

About openHAB ZigBee Binding:
I think this one shows the state of zigbee. I don’t use it in rules, maybe I dont’t need it all.
I think openhab only communicates with the MQTTBroker, but I am not sure.

Are the last few lines in that log extract when openHAB was shutting down?

Do you have two Mosquitto MQTT brokers in your network?

The last few lines: yes, openhab is shutting down.
Two brokers:
Both VMs have their own MQTT broker, accessed via localhost.
There is only one zigbee dongle, and that one hops from OH2 to OH3 and back.
At any point in time there is only one network active.

Can you, in OH3, create a rule using only the UI to try and perform the same function, and report back?

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: schakelaar_50action
      state: single_left
    type: core.ItemStateUpdateTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      command: ON
      itemName: HOB_burolampState
    type: core.ItemCommandAction

your code goes here==> /opt/openhab3/userdata/logs/events.log <==
2023-04-01 19:53:17.984 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampState' received command ON
2023-04-01 19:53:17.985 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampState' predicted to become ON
2023-04-01 19:53:17.989 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampState' changed from OFF to ON

Is this what you mean?
When I “Run Now (Ctrl R)” from the UI the light switches on.

And does the trigger work?

No in Rules DSL you can pass either a String or the Command/State Object and all of those are imported. So MyItem.sendCommand(ON) and MyItem.sendCommand("ON") will both work. It’s only the other languages which have to use the events Class’s actions to issue events directly on the event bus instead of through the Item where the String is required. sendCommand('MyItem', 'ON').

They are required under the following two circumstances:

  1. when using the actions instead of the methods on the Items
  2. when Rules DSL can’t figure out how to coerce the command/update to a Command or State; Rules DSL sometimes can’t navigate the inheritance tree very well

To test triggers within OH3 (without the need for z2m) I created the next rules:

//---------------------------------------------------------------------------------------------------------------------------
rule "HOB_burolampState_changed"
when
        Item HOB_burolampState  changed
then
        var loginfo_rulename = String::format( "%-54s, ", "RULE=HOB_burolampState_changed" )

        logInfo( loginfo_rulefile, loginfo_rulename + "switched to  xxxx" )

end
//---------------------------------------------------------------------------------------------------------------------------
rule "HOB_burolampState_changed_to_ON"
when
        Item HOB_burolampState  changed to ON
then
        var loginfo_rulename = String::format( "%-54s, ", "RULE=HOB_burolampState_changed_to_ON" )

        logInfo( loginfo_rulefile, loginfo_rulename + "switched to  ON" )

end
//---------------------------------------------------------------------------------------------------------------------------
rule "HOB_burolampState_changed_to_OFF"
when
        Item HOB_burolampState  changed to OFF
then
        var loginfo_rulename = String::format( "%-54s, ", "RULE=HOB_burolampState_changed_to_OFF" )

        logInfo( loginfo_rulefile, loginfo_rulename + "switched to  OFF" )

end
//---------------------------------------------------------------------------------------------------------------------------

The openhab.log shows shows that the rules have triggered:

your code goes here==> /opt/openhab3/userdata/logs/events.log <==
2023-04-03 10:23:35.227 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampState' received command OFF
2023-04-03 10:23:35.228 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampState' predicted to become OFF
2023-04-03 10:23:35.229 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampState' changed from ON to OFF

==> /opt/openhab3/userdata/logs/openhab.log <==
2023-04-03 10:23:35.230 [INFO ] [el.script.        report_state.ruleS] - RULE=HOB_burolampState_changed_to_OFF                 , switched to  OFF
2023-04-03 10:23:35.231 [INFO ] [el.script.        report_state.ruleS] - RULE=HOB_burolampState_changed                        , switched to  xxxx

==> /opt/openhab3/userdata/logs/events.log <==
2023-04-03 10:23:41.885 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HOB_burolampState' received command ON
2023-04-03 10:23:41.885 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HOB_burolampState' predicted to become ON
2023-04-03 10:23:41.886 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HOB_burolampState' changed from OFF to ON

==> /opt/openhab3/userdata/logs/openhab.log <==
2023-04-03 10:23:41.887 [INFO ] [el.script.        report_state.ruleS] - RULE=HOB_burolampState_changed                        , switched to  xxxx
2023-04-03 10:23:41.889 [INFO ] [el.script.        report_state.ruleS] - RULE=HOB_burolampState_changed_to_ON                  , switched to  ON


But pressing the switch shows in the /var/log/messages file:

Apr  3 10:27:34 ohbserver3 npm[2604]: Zigbee2MQTT:info  2023-04-03 10:27:34: MQTT publish: topic 'zigbee2mqtt/schakelaar_50', payload '{"action":"single_left","battery":100,"device_temperature":29,"linkquality":165,"power_outage_count":164,"voltage":3005}'
Apr  3 10:27:52 ohbserver3 npm[2604]: Zigbee2MQTT:info  2023-04-03 10:27:52: MQTT publish: topic 'zigbee2mqtt/schakelaar_50', payload '{"action":"single_right","battery":100,"device_temperature":29,"linkquality":150,"power_outage_count":164,"voltage":3005}'

But no rules are triggered.

I think I might know the problem.

Your Zigbee2mqtt sent this:

{"action":"single_left","battery":100,"device_temperature":29,"linkquality":165,"power_outage_count":164,"voltage":3005}

But your Openhab Thing config expected this:

      Type string : action                      [ stateTopic="zigbee2mqtt/schakelaar_50/action" ]

I have two suggestions for you:

  1. Change Zigbee2mqtt config output: attribute:
advanced:
  output: attribute

That should solve the problem.

  1. This is something I only learned muuuuuch too late in the game.
    Change your Things config to add postCommand=true just for the action one, like this:
Type string : action [ stateTopic="zigbee2mqtt/schakelaar_50/action", postCommand=true ]

And in your rule, you should trigger on received command

rule "xxx"
when
  Item schakelaar_50action received command
then
  ....
end

For years I didn’t know this trick - well because I hadn’t read the docs properly, and I used “updated”, then “changed” and had to resort to trickery to fight a behaviour where when something reloaded (e.g. the .things file refreshed), my item would get an update even though the actual button wasn’t pressed. The postCommand solved that issue.

Oh one more:

Have a look at JSScripting and JRuby for your scripting.

2 Likes

Thanks Jim, that suggestion solved my problem!
In my OH2 environment I also had this setting, but due to the fact that I wanted to start with a very clean and minimalistic environment I apparently skipped this setting and forget about it, not knowing what its function is.
I will look for the documentation that describes this setting “output: attribute”.
Your second suggestion: I will apply that to the other things in the migration to OH3.

Thanks again, and also thanks to everybody else that contributed to this issue.
I can now continue with the migration from OH2 to OH3.