openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.9k stars 3.6k forks source link

Rule is not executed when no event name is passed #2229

Closed kubawolanin closed 7 years ago

kubawolanin commented 7 years ago

Environment / device: openHAB 2.0 Build #905 / RaspberryPI 3B with openHABian

Steps to reproduce:

  1. Create a new rule responding to the event channel, e.g.
    rule "Tide Dash button pressed"
    when
    Channel "amazondashbutton:dashbutton:Tide:press" triggered
    then
    sendNotification("some@email.com", "Amazon button pressed!")
    sendCommand(Vacuum_Dock, ON)
    end

    or

    rule "Xiaomi Switch"
    when
     Channel "mihome:sensor_switch:<ID>:button" triggered
    then
     var actionName = receivedEvent.getEvent()
     switch(actionName) {
         case "CLICK": {
             <ACTION>
         }
         case "DOUBLE_CLICK": {
             <ACTION>
         }
         case "LONG_CLICK_PRESS": {
             <ACTION>
         }
         case "LONG_CLICK_RELEASE": {
             <ACTION>
         }
     }
    end
  2. Try to trigger the events and see the results

Expected result: The rule is triggered and performed actions should be logged in the console.

Actual result: The rule doesn't trigger, nothing is being logged.

Note that both rules worked for me before I updated the distro to the latest one.

When I pass event name to the when section, e.g.

Channel "mihome:sensor_switch:<ID>:button" triggered CLICK

everything works properly as expected.

kubawolanin commented 7 years ago

@kaikreuzer should it be moved to the eclipse/smarthome github or openhab-core? Seems like a general issue.

kaikreuzer commented 7 years ago

Yes, please open it at ESH - thanks!

kubawolanin commented 7 years ago

Moved here: https://github.com/eclipse/smarthome/issues/3362