Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

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

Closed
kubawolanin opened this issue May 4, 2017 · 3 comments
Closed

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

kubawolanin opened this issue May 4, 2017 · 3 comments

Comments

@kubawolanin
Copy link
Contributor

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
  1. 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.

@sjsf
Copy link
Contributor

sjsf commented May 4, 2017

It looks like #3267 broke it.
@triller-telekom could you please fix it?

@sjsf
Copy link
Contributor

sjsf commented May 4, 2017

Oh, sorry, it was NOT this PR... My bad!
Thanks for having a look anyway.

triller-telekom added a commit to triller-telekom/smarthome that referenced this issue May 4, 2017
…ived#3362

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
@triller-telekom
Copy link
Contributor

Indeed it wasn't my fault. But I fixed it anyway :)

@sjsf sjsf closed this as completed in #3366 May 4, 2017
sjsf pushed a commit that referenced this issue May 4, 2017
* Trigger rules without specific event on any event, Fixes #3362
* Simplified nested if

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants