Somrig from IKEA - a zigbee switch does not work

Hi,

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:

But when clicking the button, nothing happens. No output in the event.log, too.

Any ideas?
Which logging category might help?

Daniel :slight_smile:

Here some more information:

node information

zigbee node 5CC7C1FFFE3EBEE4
> IEEE Address     : 5CC7C1FFFE3EBEE4
> Network Address  : 17073
> Node Descriptor  : NodeDescriptor [apsFlags=0, bufferSize=82, complexDescriptorAvailable=false, manufacturerCode=117C, logicalType=END_DEVICE, serverCapabilities=[], incomingTransferSize=82, outgoingTransferSize=82, userDescriptorAvailable=false, frequencyBands=[FREQ_2400_MHZ], macCapabilities=[REDUCED_FUNCTION_DEVICE], extendedEndpointListAvailable=false, extendedSimpleDescriptorListAvailable=false, stackCompliance=22]
> Power Descriptor : PowerDescriptor [currentPowerMode=RECEIVER_ON_IDLE, availablePowerSources=[MAINS], currentPowerSource=MAINS, powerLevel=FULL]
> Associations     : []
> Endpoints        :
>             1    : Profile     ZIGBEE_HOME_AUTOMATION
>                  : Device Type REMOTE_CONTROL
>                    -> BASIC
>                    -> POWER_CONFIGURATION
>                    -> IDENTIFY
>                    -> GROUPS
>                    -> POLL_CONTROL
>                    -> 0x1000
>                    -> 0xFC7C
>                    -> 0xFC80
>                    <- IDENTIFY
>                    <- GROUPS
>                    <- ON_OFF
>                    <- LEVEL_CONTROL
>                    <- OTA_UPGRADE
>                    <- 0x1000
>                    <- 0xFC80
>             2    : Profile     ZIGBEE_HOME_AUTOMATION
>                  : Device Type REMOTE_CONTROL
>                    -> BASIC
>                    -> IDENTIFY
>                    -> GROUPS
>                    -> 0xFC80
>                    <- IDENTIFY
>                    <- GROUPS
>                    <- ON_OFF
>                    <- LEVEL_CONTROL
>                    <- 0xFC80
> Neighbors        :
> Routes           :

fingerprint

openhab> zigbee fingerprint 5CC7C1FFFE3EBEE4

|>| Node Descriptor
| |> Logical Type               END_DEVICE
| |> MAC Capabilities           [REDUCED_FUNCTION_DEVICE]
| |> Stack Compliance           22
| |> Server Capabilities        []
| |> Buffer Size                82
| |> Incoming Transfer Size     82
| |> Outgoing Transfer Size     82
|
|>| Power Descriptor
| |> Available Power Sources    [MAINS]
| |> Current Power Source       MAINS
| |> Current Power Mode         RECEIVER_ON_IDLE
| |> Power Level                FULL
|
|>| ZDO
| |> ManagementBindRequest      TIMEOUT
| |> IeeeAddressRequest         TIMEOUT
| |> ManagementLqiRequest       SUCCESS
| |> ManagementRoutingRequest   NOT_SUPPORTED
|
|>| Basic Information
| |> Generic Device Class       0
| |> Generic Device Type        226
| |> Manufacturer Name          IKEA of Sweden
| |> Model Identifier           SOMRIG shortcut button
| |> Product Code               ByteArray [value=45 32 32 31 33]
| |> Product URL
| |> Date Code                  20230308
| |> Application Version        1
| |> Software Build ID          1.0.20
| |> Hardware Version           1
| |> Zcl Version                8
| |> Stack Version              113
| |
| |>| Endpoint 1
| | |> Profile                  0104  ZIGBEE_HOME_AUTOMATION
| | |> Device Type              0006  REMOTE_CONTROL
| | |> Device Version           1
| | |
| | |>| Input Clusters
| | | |
| | | |>| Cluster 0000 Basic
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | |
| | | | |>| Commands Received
| | | | | |> 0000 ResetToFactoryDefaultsCommand
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  ZCL Version                               >> UNSIGNED_8_BIT_INTEGER          8
| | | | | |> 0001  Application Version                       >> UNSIGNED_8_BIT_INTEGER          1
| | | | | |> 0002  Stack Version                             >> UNSIGNED_8_BIT_INTEGER          113
| | | | | |> 0003  HW Version                                >> UNSIGNED_8_BIT_INTEGER          1
| | | | | |> 0004  Manufacturer Name                         >> CHARACTER_STRING                IKEA of Sweden
| | | | | |> 0005  Model Identifier                          >> CHARACTER_STRING                SOMRIG shortcut button
| | | | | |> 0006  Date Code                                 >> CHARACTER_STRING                20230308
| | | | | |> 0007  Power Source                              >> ENUMERATION_8_BIT               3
| | | | | |> 0008  Generic Device Class                      >> ENUMERATION_8_BIT               0
| | | | | |> 0009  Generic Device Type                       >> ENUMERATION_8_BIT               226
| | | | | |> 000A  Product Code                              >> CHARACTER_STRING                ByteArray [value=45 32 32 31 33]
| | | | | |> 000B  Product URL                               >> CHARACTER_STRING
| | | | | |> 4000  SW Build ID                               >> CHARACTER_STRING                1.0.20
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         3
| | | |
| | | |>| Cluster 0001 Power Configuration
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0003 Identify
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0004 Groups
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0020 Poll Control
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 1000
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster FC7C
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster FC80
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | |
| | |>| Output Clusters
| | | |
| | | |>| Cluster 0003 Identify
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0004 Groups
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0006 On/Off
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0000 OffCommand
| | | | | |> 0001 OnCommand
| | | | | |> 0002 ToggleCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | | |
| | | |>| Cluster 0008 Level Control
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0000 MoveToLevelCommand
| | | | | |> 0001 MoveCommand
| | | | | |> 0002 StepCommand
| | | | | |> 0003 StopCommand
| | | | | |> 0004 MoveToLevelWithOnOffCommand
| | | | | |> 0005 MoveWithOnOffCommand
| | | | | |> 0006 StepWithOnOffCommand
| | | | | |> 0007 StopWithOnOffCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         3
| | | |
| | | |>| Cluster 0019 Ota Upgrade
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0001 QueryNextImageCommand
| | | | | |> 0003 ImageBlockCommand
| | | | | |> 0006 UpgradeEndCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  Upgrade Server ID                         >> IEEE_ADDRESS                    E0798DFFFECDAA30
| | | | | |> 0001  File Offset                               >> UNSIGNED_32_BIT_INTEGER         -1
| | | | | |> 0002  Current File Version                      >> UNSIGNED_32_BIT_INTEGER         16777248
| | | | | |> 0006  Image Upgrade Status                      >> ENUMERATION_8_BIT               0
| | | | | |> 0007  Manufacturer ID                           >> UNSIGNED_16_BIT_INTEGER         4476
| | | | | |> 0008  Image Type ID                             >> UNSIGNED_16_BIT_INTEGER         65535
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         4
| | | |
| | | |>| Cluster 1000
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster FC80
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| |
| |>| Endpoint 2
| | |> Profile                  0104  ZIGBEE_HOME_AUTOMATION
| | |> Device Type              0006  REMOTE_CONTROL
| | |> Device Version           1
| | |
| | |>| Input Clusters
| | | |
| | | |>| Cluster 0000 Basic
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | |
| | | | |>| Commands Received
| | | | | |> 0000 ResetToFactoryDefaultsCommand
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  ZCL Version                               >> UNSIGNED_8_BIT_INTEGER          8
| | | | | |> 0001  Application Version                       >> UNSIGNED_8_BIT_INTEGER          1
| | | | | |> 0002  Stack Version                             >> UNSIGNED_8_BIT_INTEGER          113
| | | | | |> 0003  HW Version                                >> UNSIGNED_8_BIT_INTEGER          1
| | | | | |> 0004  Manufacturer Name                         >> CHARACTER_STRING                IKEA of Sweden
| | | | | |> 0005  Model Identifier                          >> CHARACTER_STRING                SOMRIG shortcut button
| | | | | |> 0006  Date Code                                 >> CHARACTER_STRING                20230308
| | | | | |> 0007  Power Source                              >> ENUMERATION_8_BIT               3
| | | | | |> 0008  Generic Device Class                      >> ENUMERATION_8_BIT               0
| | | | | |> 0009  Generic Device Type                       >> ENUMERATION_8_BIT               226
| | | | | |> 000A  Product Code                              >> CHARACTER_STRING                ByteArray [value=45 32 32 31 33]
| | | | | |> 000B  Product URL                               >> CHARACTER_STRING
| | | | | |> 4000  SW Build ID                               >> CHARACTER_STRING                1.0.20
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         3
| | | |
| | | |>| Cluster 0003 Identify
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0004 Groups
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster FC80
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | |
| | |>| Output Clusters
| | | |
| | | |>| Cluster 0003 Identify
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0004 Groups
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0006 On/Off
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0000 OffCommand
| | | | | |> 0001 OnCommand
| | | | | |> 0002 ToggleCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | | |
| | | |>| Cluster 0008 Level Control
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> 0000 MoveToLevelCommand
| | | | | |> 0001 MoveCommand
| | | | | |> 0002 StepCommand
| | | | | |> 0003 StopCommand
| | | | | |> 0004 MoveToLevelWithOnOffCommand
| | | | | |> 0005 MoveWithOnOffCommand
| | | | | |> 0006 StepWithOnOffCommand
| | | | | |> 0007 StopWithOnOffCommand
| | | | |
| | | | |>| Commands Received
| | | | |
| | | | |>| Attributes Supported
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         3
| | | |
| | | |>| Cluster FC80
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally


Any ideas?

I found useful information in the Zigbee2MQTT documentation:

Here is mentioned:

Action (enum)

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) :thinking:

My idea is, to trigger a rule, whenn the channel gets triggered. But i don’t get it working: My rule "when a trigger channel fires" does not trigger

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:

The dectection created the following channel:

  - id: 5CC7C1FFFE3EBEE4_1_dimmer
    channelTypeUID: zigbee:switch_level
    label: "REMOTE_CONTROL: Level Control"
    configuration:
      zigbee_reporting_polling: 2147483647

In the documentation i can’t find exactly the type switch_level. There is a similar type:

switch_dimmer	LEVEL_CONTROL (0x0008)	Dimmer

If I understand correctly, this could be the problem. Perhaps the “button channels” should be better event Channels like the hue dimmer :thinking:

I found an old thread with a similar topic:

Any ideas how to get the shortcut button working?

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,

Hi Brian,

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.

Best regards,
Daniel

Hi Daniel,

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?

Thank you very much and best regards,
Daniel

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!?"

Sorry for all the questions!

Best regards, Daniel.

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:

I did the following:

  • Disabled the Somrig switch
  • Activated the Somrig switch
  • Waited until it was online
  • Then clicked the buttons a few times

The corresponding log output is attached here.
zigbee-smorig-log.txt (96.4 KB)

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.

Unfortunately, that doesn’t seem to be working.

zigbee node 5CC7C1FFFE3EBEE4
IEEE Address     : 5CC7C1FFFE3EBEE4
Network Address  : 17073
Node Descriptor  : NodeDescriptor [apsFlags=0, bufferSize=82, complexDescriptorAvailable=false, manufacturerCode=117C, logicalType=END_DEVICE, serverCapabilities=[], incomingTransferSize=82, outgoingTransferSize=82, userDescriptorAvailable=false, frequencyBands=[FREQ_2400_MHZ], macCapabilities=[REDUCED_FUNCTION_DEVICE], extendedEndpointListAvailable=false, extendedSimpleDescriptorListAvailable=false, stackCompliance=22]
Power Descriptor : PowerDescriptor [currentPowerMode=RECEIVER_ON_IDLE, availablePowerSources=[MAINS], currentPowerSource=MAINS, powerLevel=FULL]
Associations     : []
Endpoints        :
            1    : Profile     ZIGBEE_HOME_AUTOMATION
                 : Device Type REMOTE_CONTROL

zigbee bind 0xfc80 17073/1
Error executing command: CommandResult [TIMEOUT]

After I entered the command, I immediately pressed the button several times. After a while, the timeout message appeared.

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.

Yes, that’s true - it really is difficult.

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.