i bought a somrig “shortcut button” from Ikea (zigee). I have successfully connected this button as a thing in openHab via the zigbee binding. It is shown as online. It looks like this:
Triggered action (e.g. a button click). Value can be found in the published state on the action property. It’s not possible to read (/get) or write (/set) this value. The possible values are: 1_initial_press, 1_long_press, 1_short_release, 1_long_release, 1_double_press, 2_initial_press, 2_long_press, 2_short_release, 2_long_release, 2_double_press.
In openhab the channel looks different (see my first posting)
This does not work, because it is a state Channel and not a event Channel.
In the binding documentation there is an example of “Philips Hue Dimmer”.
Some devices like the Philips Hue Dimmer can be discovered and added to openHAB through this binding but will not allow the Items to be created in the UI. These channels are set as Triggers and will generate output in the events.log that looks similar to this:
Hi Daniel,
I was wondering if you figured out how to configure the IKEA Somrig buttons. I bought a couple and have the same problem you described.
Best,
No, I did not get the buttons working in openHAB. I am considering filing a bug report. I think this should be resolved within the binding. I’m not a Zigbee expert, but I believe there is a problem in the discovery process in the binding.
Elsewhere, I read that the problem could be a bug in the device. In my opinion, even in that case, a workaround in the binding might be an appropriate solution: Zigbee is a very important technology. Big brands like IKEA, Hue, or Aqara should be supported in openHAB. In this specific case, the Somrig from IKEA is also working in Home Assistant and Zigbee2MQTT.
Thanks for the response. Unfortunately, I’m guessing this problem most likely isn’t a bug but an issue caused by Ikea using it’s own unofficial Zigbee protocols. It’s true that it would be nice for the Zigbee binding to work with as many devices as possible but it’s impossible for the binding maintainer to keep up with all these companies implementing their own Zigbee protocols.
I have another OpenHAB implementation running with Zigbee2MQTT. I’ll try the buttons on that one.
Cheers,
Perhaps it might be a good idea to extend the binding so that users can provide more configuration options for specific items. This way, it needn’t be solely the responsibility of the binding maintainer. From the user’s standpoint, this is disappointing. For example, in Home Assistant and Zigbee2MQTT, this device is supported, despite the “own unofficial Zigbee protocol”!
Or to put it another way: Why do you think that the button can be supported in Zibee2Mqtt but not through the Zigbee binding in openHAB?"
The binding was written with zigbee standards in mind. This makes it universal - it will work with any device that uses the standards. The problem of course comes when manufacturers don’t stick to the standards.
Of course, making the binding more configurable is always an option - it takes more time, and then take even more time to maintain. This is what I did on the zwave binding - every device is explicitly defined, and this takes a lot of time to maintain.
Anyway, the zigbee binding does support some level of configuration to support custom devices - this tries to be the best of both worlds - it’s automatic in its support of standards compliant devices, but can be configured (within limitations!) for non-standard devices. This configuration assumes that the ZCL is generally adhered to, which Ikea I think does (many Chinese devices don’t!).
So, please feel free to take a look at the source as there are already some definitions for a few different devices included.
There are different concepts used here, but of course anything is possible with the zigbee binding - it just takes more time to code. So. it’s not a case that it cannot be supported by the binding - I think the original statement said that it was impossible for one person (ie the maintainer) to keep up with all devices, so this requires users with these devices to help (ie YOU). So, if you want to add support, then please do so - the contribution would of course be welcome.
I really like this approach. This way, most things (hopefully) work out of the box, and if needed, additional devices can be made operational individually.
What is ZCL? How can I check that?
The following ikea devices are working here without problems:
Some Ikea devices seem to comply with the standard and work without further configuration. Or are there already specific adjustments for Ikea devices in the binding?
In the documentation, I found references for the ‘Philips Hue Dimmer.’ This seems to be a similar device to the Ikea device. Are there any specific adjustments included in the binding for this? Or should the detection behave similarly for the Ikea device?
That’s a good point: I consider Zigbee to be a core technology in the smart home. Therefore, having the help of several people would be an important aspect for openHAB overall, in my opinion. I’m not sure if I can actually help here. But I am a Java developer and would like to try and see if I can contribute. Maybe you can give me a few tips on how to get started:
In which ‘area’ could I set a breakpoint (I would like to debug the detection process)?
Can you give me an example in the binding code where a specific configuration for a device has been added?
Do you have any further hints or tips on how I could approach this problem?
It’s the Zigbee Cluster Library. This defines various interfaces and defines how a manufacturer cluster should work (using custom attributes and commands). If the device does this then we can probably configure it up using a device definition file.
Hmmm - I’m not sure you can really just “set a breakpoint”. There’s really a LOT that happens during. discovery. Some of this happens in the underlying Zigbee library, and some happens in the binding.
Sure - take a look at this folder -:
First thing is always to understand how to communicate with the device(s). This is always the problem when manufacturers do their own thing. You can possibly find this info somewhere on the web though with a bit of googling.
Thank you for your detailed response! However, all of this is still quite overwhelming for me, and I really don’t know where to start. Unfortunately, I lack basic knowledge about the Zigbee standard and also about the openHAB binding.
However, it seems quite simple to get the Ikea device running with the help of a configuration file. The Ikea button seems to be similar to the two Philips devices (1
and 2), for which there is also a configuration file available. Maybe I can learn something from that.
Is there any information available on how these configuration files work?
Can I possibly find the required data (such as ‘zigbee_shortpress_command_id’) in the output of the fingerprint of the device?
I thought that I could use the information from Zigbee2MQTT for that, and additionally the information from the fingerprint!?"
The XML file itself is the standard OH thing definition file - it’s defined in the OH docs. We basically then just define properties that map commands or attributes in an endpoint/cluster to a channel.
No - the fingerprint command cannot (or at least does not) scan a manufacturer specific cluster, since it doesn’t know what is there. In principal it could be possible to read attributes - it could scan all 65000 possible options to see if there were any responses, but given that most will time out, it will take a lonnnngggg time. Commands are obviously more difficult as they can’t be scanned.
Getting the value of an attribute though doesn’t necessarily help - you still don’t know what it is or what it does. Reverse engineering this isn’t necessarily impossible, but it takes time - depending on the device (it might be easy with a simple button).
Yep - quite possibly you can find it in their docs or source code. I’m not familiar with that project so I can’t comment on that.
However, in this case, it might be as simple as enabling debug, and pressing buttons to see what commands are received. You might find that pressing each button reveals a standard command / args and from that we could work out how to handle this.
Debug logging is a good idea. I have disabled all other Zigbee devices for this. Now I remember that I had tried this before. When I press a button, I don’t see an immediate output in the log.
This is the logging configuration of the zigbee binding:
As you suspect, I don’t see anything in the log from a button type device - just lots of reports from other devices (mainly illuminance).
Probably there is a need to configure reports. Let’s try this command -:
openhab:zigbee bind 0xfc80 address/1
Where address is the network address of the device. I’m not 100% sure this will work, but let’s try and see what happens. After doing this (and assuming the command works!), press the button and see if there’s anything received.
It’s hard to say what’s happening. It could be a blockage in the binding as it doesn’t know about this cluster, or it could be that the device isn’t listening since most battery devices don’t listen for commands. Pushing the button may or may not wake the device up so it listens.
A debug log might help to see if it’s a binding issue at least. One potential issue here is that the binding blocks clusters that it’s not programmed to handle - this was a requirement for zigbee certification when we had a commercial device put through testing a few years back so this is baked in to the underlying zigbee library.
Do you think I should activate the debug log again during the ‘zigbee bind’?
I wanted to catch up on that / try it out. Unfortunately, I can’t access the settings of the addon right now.
EDIT: The log4j2.xml was corrupt. I fixed it. Now I can see and set the log levels again.