Button Event on Tradfri remote not working with new deconz binding

Hi,

I am just integrating the new deconz binding in my system and all is working but the buttonevent.
It seems like the binding is not sending any data, no errors or any logging.
Data is coming for every channel but the switch. Maybe handling is not yet implemented?

My bridge thing:

Bridge deconz:deconz:homeserver [ host="phoscon.local", apikey="D25175CADC" ] { // 
    presencesensor kitchen-presence        [ id="2" ]
    powersensor osram-power           [ id="3" ]
    presencesensor dining-presence        [ id="6" ]
    switch remote-buttonevent        [ id="7" ]
    powersensor aqara1-power           [ id="8" ]
    temperaturesensor aqara1-temp           [ id="8" ]
    temperaturesensor aqara2-temp           [ id="11" ]
}

My item:

Number Remote_Button "Button Event: %s" {channel="deconz:switch:homeserver:remote-buttonevent:buttonevent"}

RESTful response:

"7": {
    "config": {
        "alert": "none",
        "battery": 74,
        "group": "40781",
        "on": true,
        "reachable": true
    },
    "ep": 1,
    "etag": "1e500e0f7a73d3b9abe93f6e938721c7",
    "manufacturername": "IKEA of Sweden",
    "mode": 3,
    "modelid": "TRADFRI remote control",
    "name": "TRADFRI remote control ",
    "state": {
        "buttonevent": 1002,
        "lastupdated": "2018-12-29T16:27:29"
    },
    "swversion": "1.2.214",
    "type": "ZHASwitch",
    "uniqueid": "90:fd:9f:ff:fe:f4:e5:b7-01-1000"
}

Hi @Maxwell,

The buttonevent is a trigger channel which cannot be linked to an item. It is possible to use it in rule like the Hue Dimmer Switch in this example:

1 Like

Thanks for the info. Tried it out but again no response…
In my opinion the channel is correct: !?

My rule:

rule "tradfri remote handling"
when
   Channel "deconz:switch:homeserver:remote-buttonevent:buttonevent"
then
    logInfo("TradfriRemote", "Tradfri switch event {} was triggered", receivedEvent)
    switch(receivedEvent.getEvent()) {
        case "1002": {
            night_lights.sendCommand(ON)
        }
        case "2002": {
            night_lights.sendCommand(OFF)
        }
    }
end

Yes, it looks good. But you forgot to add the key word “triggered” in the trigger for the rule.

Ah sorry,
it was a copy mistake from me…

I have the key word in it…

rule "tradfri remote handling"
when
   Channel "deconz:switch:homeserver:remote-buttonevent:buttonevent" triggered
then
   logInfo("TradfriRemote", "Tradfri switch event {} was triggered", receivedEvent)
   switch(receivedEvent.getEvent()) {
      case "1002": {
        night_lights.sendCommand(ON)
      }
      case "2002": {
        night_lights.sendCommand(OFF)
      }
  }
end

So the channel should be fine… Any idea where I can look for errors/hints?

Nobody has used the buttonevent yet, you are the first one, I guess. A triggered channel should appear in the log, the binding itself does not log anything.

Ah great, then there may be a bug in there :slight_smile:
Can I adjust some special log levels to see what’s the binding doing?

In my bindings I do not log in critical code paths and in obvious cases (thing update, channel update etc). I guess one log line can be added to tell how many updated states have been received.

I just checked the deconz websocket with a demo client and I get all the data in, also the buttonevent. So there is something wrong in the binding.

I just wanted to chime in and say that I experience this to, and I do not know how to proceed.

Some more info

When I create the button in the things file, it is not created. If I instead switch the type to something like presencesensor, it is created.

If I create it using PaperUI I get
13:26:24.602 [WARN ] [core.thing.internal.ThingRegistryImpl] - Cannot create thing. No binding found that supports creating a thing of type 'deconz:switch'.

It is created fine if I create it as a lightsensor instead.

As @cweitkamp said you can use the switch only in a rule:

Try that and tell us if it works on your system pls.

There is also support for “button” ZigBee things added a day ago. Those support normal channels. But Buttonevent is really an event, from an architectural stand point it doesn’t make sense to expose it as a state channel, it really is a trigger channel only.

Regarding this warning: The thing type for the switch was missing in OH2.4 stable release. It has been fixed couple of days ago (see https://github.com/openhab/openhab2-addons/issues/4402 and https://github.com/openhab/openhab2-addons/issues/4406).

I upgraded to 2.5.0-SNAPSHOT and both the button/switch item and the buttonevent works well there.

I am faceing a lot more triggers - nearly every 5 min, w/o the button being pressed:

2019-01-04 22:50:12.792 [INFO ] [clipse.smarthome.model.script.deconz] - Trigger für TRÅDFRI Fernbedienung button pressed: 'deconz:switch:XXX:2:buttonevent triggered 4003'
2019-01-04 22:55:13.012 [INFO ] [clipse.smarthome.model.script.deconz] - Trigger für TRÅDFRI Fernbedienung button pressed: 'deconz:switch:XXX:2:buttonevent triggered 4003'
2019-01-04 23:00:12.853 [INFO ] [clipse.smarthome.model.script.deconz] - Trigger für TRÅDFRI Fernbedienung button pressed: 'deconz:switch:XXX:2:buttonevent triggered 4003'
2019-01-04 23:05:12.969 [INFO ] [clipse.smarthome.model.script.deconz] - Trigger für TRÅDFRI Fernbedienung button pressed: 'deconz:switch:XXX:2:buttonevent triggered 4003'

Anyone else?

@cweitkamp yes, thats what my PR is all about. See answer to your comment there, cause it is not directly related to this thread, but rather now occuring due the fix that makes buttons work in 2.5-SNAPSHOT :smiley:

Fix: Buttonevent trigger refiring on each reconnect

Hello,

i had the same problems.
Now with the snapshot version ist works fine.
Thanks a lot.