Next-Generation Rules with a numerical event stop working if trigger edited

  • Platform information:
    • Hardware: RPI 4
    • OS: openhabian
    • Java Runtime Environment: openJDK 1.8.0_265
    • openHAB version: 2.5.8 Release Build
  • Issue of the topic:
    I have configured today a new Thing within openhab2: an Aquara Wireless Switch (Xiaomi). It is discovered via a Dresden Elektronik deCONZ Binding (using a Conbee II usb key). My purpose is to use its buttonevent to switch on/off a Smart Plugs (Fibaro Wall Plug) using rules.

As I have never wrote a rule for openhab before, I decided to start with the Next-Gen Rule Engine…

I did create 4 simple rules to play various sounds when

  • clicking (event “1002”),
  • double clicking (event “1004”),
  • pressing (event “1001”) or
  • releasing (event “1003”) the switch.

Each rules works fine until I enter into its trigger, via the gear icon “Update Trigger”.
Even if I click Cancel instead of Ok (and even if I don’t make any concrete modification), the rule does not trigger anymore once saved (This is not impacting the other rules).

I tried to stop oh, clean the cache and restart oh but it didn’t fix the pblm.
I have no error in my openhab.log. And I can still see the buttonevent in the events.log

Events when Rule is Working and double clicking
2020-09-06 22:36:25.522 [vent.ChannelTriggeredEvent] - deconz:switch:9f6d0541:00158d00040184b7010012:buttonevent triggered 1004
2020-09-06 22:36:25.527 [.event.RuleStatusInfoEvent] - b79e1105-da53-47bb-88b4-9ed007035f1a updated: RUNNING
2020-09-06 22:36:25.529 [vent.ItemStateChangedEvent] - AquaraSwitch_Office changed from 1003 to 1004

Events when updating the Rule (no actual changes !)
2020-09-06 22:38:56.628 [ome.event.RuleUpdatedEvent] - Rule ‘b79e1105-da53-47bb-88b4-9ed007035f1a’ has been updated.
2020-09-06 22:38:56.646 [.event.RuleStatusInfoEvent] - b79e1105-da53-47bb-88b4-9ed007035f1a updated: INITIALIZING
2020-09-06 22:38:56.667 [.event.RuleStatusInfoEvent] - b79e1105-da53-47bb-88b4-9ed007035f1a updated: IDLE

Event (only one) after Rule edition and double clicking
2020-09-06 22:40:02.117 [vent.ChannelTriggeredEvent] - deconz:switch:9f6d0541:00158d00040184b7010012:buttonevent triggered 1004

Comparing the file automation_rules.json with the ones in the jsondb backup folder, I see what has been changed when “editing” a rule (even if I concretely didn’t change anything): in the configuration node of the trigger, the event which was initially, e.g., “1003” became 1003.0

It’s unfortunately not possible to fix the value via the UI as the correct string “1003” is displayed even if the stored value is 1003.0. But if I fix the event via a text editor (nano) and restarted oh, then the rules restart working…

This is really annoying as I intend to create and edit a lot of rules until I am pleased with the setup…
Would anyone have a suggestion/workaround for this issue ?

Thx a lot in adv !


NB.: To add blanks, quotes or double quotes around the value in the Next-Gen UI is not a solution. the resulting value in the json is "“1003"”.

I recall troubleshooting this before and possibly opening an issue… let me search a bit…

Here you go… tagged with Won’t Fix, since Paper UI has been removed…

Here is where it was reported in the forum…

My suggestion to you is to not use the UI rule editor until after OH 3.0 has been released and has been beaten on for a long while. However, using scripted automation with the NGRE is very solid. Here is an easy way to get started and some links to check out…

If you have questions, just ask!

Thx a lot!

I will look at your addon… learning how to use scripts for rules was anyway on my todo list :smiley:


1 Like