zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
734 stars 673 forks source link

New Ikea Somrig button, not able to connect zha #2835

Closed NicerDicer111 closed 9 months ago

NicerDicer111 commented 9 months ago

Problem description

Hello :slight_smile: I bought the new Ikea Somrig buttons and would like to connect them to my HomeAssistant with Zigbee Dongle. During the search of a new device, HA identifies the button but is not able to configure it. Although the configuration process does not finish, the device is part of the device list. Sometimes there is a battery and identify entity and sometimes not. I can not control any entity.

Solution description

Is anybody aware if there is a way to connect a device which is currently not fully supported or do you know if there will be an integration?

Screenshots/Video

Bildschirm­foto 2023-12-12 um 20 17 57 Bildschirm­foto 2023-12-12 um 20 20 21

Device signature

IEEE: 5c:c7:c1:ff:fe:87:35:e2 Nwk: 0x046e Device Type: EndDevice LQI: 108 RSSI: Unbekannt Zuletzt gesehen: 2023-12-12T20:13:52 Energiequelle: Battery or Unknown

Diagnostic information

zha-e958911dd7b4b0c8793c91dc810d16d3-IKEA of Sweden SOMRIG shortcut button-7dfa14459bf34ecb1709bcf1e8686b31.json.txt

Logs

Logs ```python [Paste the logs here] ```

Custom quirk

Custom quirk ```python [Paste your custom quirk here] ```

Additional information

No response

MattWestb commented 9 months ago

Its looks like your device is paired OK but its sending manufacture specific commands and need one quirk for getting the events from it OK. SYMFONISK II is using the same command so its shall not being so large problem getting it done but i cant then im not at home for the moment.

NicerDicer111 commented 9 months ago

Thanks for your response! I will try to find a solution but to be honest I‘m a total newbie. So maybe it will take some time or i need your help. 😃

QuantumCorral commented 9 months ago

is there any news about this ? would also be very interested. Thanks for the effort you put into it.

NicerDicer111 commented 9 months ago

Unfortunatly not from my side. So I still need help to integrate it..

ender-null commented 9 months ago

How do you pair it? I didn’t find any info about how to do it

Funder75 commented 9 months ago

I have a similar problem with the Somrig button. I had to reset the button (4 clicks on the link button) for it to enter pairing mode. Then it seemed to pair successfully, but now I have only entities for Identity and battery.

Skærmbillede 2023-12-17 kl  09 53 23
HawkanForce commented 9 months ago

Thank you Funder75, was loosing my mind. Tried long pressing, and pressing together with button 1 and even reading the manual. Thought the device was broken :D Now paired but only the same entities battery and identify

diogomendes-cmyk commented 9 months ago

Indeed, IKEA lists no procedure to get into pairing mode, discovered yesterday by chance.. :(

Same issue in current HA, Bat + Identify but nothing else.

casparz commented 9 months ago

I am working on a quirk for the remote, I have some issues contributing (its my first time).

It works as a custom quirk in my setup, so if you know how to add custom quirks you can copy my code for now.

NicerDicer111 commented 9 months ago

Thank you! Is it possible to use z2mqtt and zha simultaneously? Currently I use zha and for the somrig button and your code I need to install z2mqtt right? Or do I need to change my whole set up to z2mqtt?

casparz commented 9 months ago

No, the point is to get it to work with ZHA (and it does :) )

joshuapfl commented 9 months ago

WOULD love this to work soon toooo. No Idea how to accomplisch :)

QuantumCorral commented 9 months ago

you have to create a new folder e.g.

/config/custom_zha_quirks

in which you save the "somrigsmartbtn.py". Then add the following to "configuration.yaml"

zha:
  enable_quirks: true
  custom_quirks_path: /config/custom_zha_quirks/

Restart HA and add the button again.

Bluefarmer commented 9 months ago

Hi, I'm trying to get this to work, but the button keeps on configuring after connecting.

I made the file with the name mentioned, put in all the code, added the text to the configuration.yaml but it keeps on configuring

BenJamesAndo commented 9 months ago

@Bluefarmer you don't need to add a custom quirk for this anymore as it's been merged. I set mine up today. I pressed the pairing button 4 times and it then showed up in ZHA on the add device page.

HawkanForce commented 9 months ago

Did you get it to work @Bluefarmer ?

I removed Somrig from my devices, updated HA to the latest version, added zigbee devices and it just keeps configuring image it does show up in devices but no button presses are shown in the logbook or battery information etc. image

{ "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4476, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, allocate_address=True, is_alternate_pan_coordinator=False, is_coordinator=False, is_end_device=True, is_full_function_device=False, is_mains_powered=False, is_receiver_on_when_idle=False, is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x0006", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x0004", "0x0020", "0x1000", "0xfc7c", "0xfc80" ], "output_clusters": [ "0x0003", "0x0004", "0x0006", "0x0008", "0x0019", "0x1000", "0xfc80" ] }, "2": { "profile_id": "0x0104", "device_type": "0x0006", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0xfc80" ], "output_clusters": [ "0x0003", "0x0004", "0x0006", "0x0008", "0xfc80" ] } }, "manufacturer": "IKEA of Sweden", "model": "SOMRIG shortcut button", "class": "zhaquirks.ikea.somrigsmartbtn.IkeaSomrigSmartButton" }

MattWestb commented 9 months ago

If the device is getting problem then being paired its not getting OK configured.. Try reconfigure from the device card and waking it up then sending commands to it. If not working restart HA and try agen. Dome new devices need potting the battery out and doing the reconfigure then its being putted back in for getting it OK and other times deleting it and wait one minute / or restart HA and adding it new.

Bluefarmer commented 9 months ago

I still have the same issue if I connect the device the normal way, without quirks. After the interview is complete, it stays on configuring for a very long time. After this, the buttons are not available. This happens with two separate devices...

Bluefarmer commented 9 months ago

Okay, never mind. Updated HA to latest version (wasn't correctly triggered...) and now everything works

HawkanForce commented 9 months ago

Thank you, now I also get something in the log after reconfiguring.

image

deephack1982 commented 9 months ago

This worked perfectly for me. Will somrigsmartbtn.py be included in a future release?

casparz commented 9 months ago

It is included in the most recent release of HA (2024.1). For those that have added it as custom quirk, it is best to:

MattWestb commented 9 months ago

This worked perfectly for me. Will somrigsmartbtn.py be included in a future release?

Its in HA 2024.1

BatteryDie commented 8 months ago

Seem this issue is still persist after I updated and restarted HA 2024.1.5. I tried remove and pair it. I do not have custom quirk on HA.

image

Here are highlighted log ``` Tries remaining: 1 [0x43A7:1:0x0020] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=31, command_id=, *direction=) [0x43A7:1:0x0020] Sending request: Write_Attributes(attributes=[Attribute(attrid=0x0000, value=TypeValue(type=uint32_t, value=13200))]) [0x43a7] Extending timeout for 0x1f request [0xCC8E](TS011F): Device seen - marking the device available and resetting counter [0xCC8E](TS011F): Update device availability - device available: True - new availability: True - changed: False [0xA19A](TS011F): Device seen - marking the device available and resetting counter [0xA19A](TS011F): Update device availability - device available: True - new availability: True - changed: False [0x8856](TS0601): last_seen is 11395394.559090614 seconds ago and ping attempts have been exhausted, marking the device unavailable [0x8856](TS0601): Update device availability - device available: False - new availability: False - changed: False [0x43A7:1:0x0003]: 'async_configure' stage succeeded [0x43A7:1:0x0001]: 'async_configure' stage succeeded [0x43A7:1:0x0000]: 'async_configure' stage succeeded [0x43A7:1:0x0020]: 'async_configure' stage failed: Failed to send request: Request failed after 5 attempts: [0x43A7:1:0x1000]: 'async_configure' stage succeeded [0x43A7:1:0xfc80]: 'async_configure' stage succeeded [0x43A7:1:0x0008]: 'async_configure' stage succeeded [0x43A7:1:0x0006]: 'async_configure' stage succeeded [0x43A7:1:0x0019]: 'async_configure' stage succeeded [0x43A7](SOMRIG shortcut button): completed configuration Tries remaining: 3 [0x43A7:1:0x0003] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=32, command_id=64, *direction=) [0x43A7:1:0x0003] Sending request: trigger_effect(effect_id=, effect_variant=) [0x43a7] Extending timeout for 0x20 request [0xDF03](TS011F): Device seen - marking the device available and resetting counter [0xDF03](TS011F): Update device availability - device available: True - new availability: True - changed: False Feeding watchdog Tries remaining: 2 [0x43A7:1:0x0003] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=33, command_id=64, *direction=) [0x43A7:1:0x0003] Sending request: trigger_effect(effect_id=, effect_variant=) [0x43a7] Extending timeout for 0x21 request sensor.plug_04_active_power_2: polling for updated state [0xA19A:1:0x0b04]: async_update [0xA19A:1:0x0b04]: Reading attributes in chunks: ['active_power', 'rms_current', 'rms_voltage'] [0xA19A:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=23, command_id=, *direction=) [0xA19A:1:0x0b04] Sending request: Read_Attributes(attribute_ids=[1291, 1288, 1285]) Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 1, 21, 21, 26, 34, 181681, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0xA19A), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=2820, data=Serialized[b'\x18\x17\x01\x0b\x05\x00!\x00\x00\x08\x05\x00!\x00\x00\x05\x05\x00!}\x00'], tx_options=, radius=28, non_member_radius=0, lqi=42, rssi=None) [0xA19A:1:0x0b04] Received ZCL frame: b'\x18\x17\x01\x0b\x05\x00!\x00\x00\x08\x05\x00!\x00\x00\x05\x05\x00!}\x00' [0xA19A:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=23, command_id=1, *direction=) [0xA19A:1:0x0b04] Decoded ZCL frame: TuyaZBElectricalMeasurement:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x050B, status=, value=TypeValue(type=uint16_t, value=0)), ReadAttributeRecord(attrid=0x0508, status=, value=TypeValue(type=uint16_t, value=0)), ReadAttributeRecord(attrid=0x0505, status=, value=TypeValue(type=uint16_t, value=125))]) Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 1, 21, 21, 26, 35, 534292, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=, address=0x451F), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=1794, data=Serialized[b'\x08(\n\x00\x00%\xb5\xab\x00\x00\x00\x00'], tx_options=, radius=27, non_member_radius=0, lqi=162, rssi=None) [0x451F:1:0x0702] Received ZCL frame: b'\x08(\n\x00\x00%\xb5\xab\x00\x00\x00\x00' [0x451F:1:0x0702] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=40, command_id=10, *direction=) [0x451F:1:0x0702] Decoded ZCL frame: Metering:Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=uint48_t, value=43957))]) [0x451F:1:0x0702] Received command 0x0A (TSN 40): Report_Attributes(attribute_reports=[Attribute(attrid=0x0000, value=TypeValue(type=uint48_t, value=43957))]) [0x451F:1:0x0702] Attribute report received: current_summ_delivered=43957 [0x451F:1:0x0702] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=40, command_id=, *direction=) [0x451F:1:0x0702] Sending reply: Default_Response(command_id=10, status=) [0x596E](E21-N1EA): Device seen - marking the device available and resetting counter [0x596E](E21-N1EA): Update device availability - device available: True - new availability: True - changed: False Tries remaining: 1 ```

Edit: I was able to pair between Somrig device and HA by spamming pair buttons (i don't know why red LED was off while pair mode it have new brand battery too) but pressing both two buttons do not works when it became unknown. I already replaced the battery two times.

image

dhzl84 commented 8 months ago

Exact same issue here, also running HA 2024.1.5.

RASTRILL0 commented 8 months ago

Same problem here. Device pairs and shows battery and Identify but is unable to bind the buttons.

MattWestb commented 8 months ago

@RASTRILL0 This device can only being bond if its using in ZLL mode (direct paring with light without coordinator) the its sending On/Off light commands. Then being paired with one coordinator its only sending short double and long press / release in matter standard commands for switches and lights is not understanding this commands. You shall using automatons triggered from the events the remote is sending and defining actions they shall doing in the automations.

gimik91 commented 8 months ago

Same problem here. Device pairs and shows battery and Identify but is unable to bind the buttons.

RASTRILL0 commented 8 months ago

Same problem here. Device pairs and shows battery and Identify but is unable to bind the buttons.

Tap the pair button 4 times to initiate the pairing process (red blinking light) then keep tapping the pair button until it’s complete. I think the remote is going to sleep before the process finishes. I got mine working.

MattWestb commented 8 months ago

Same problem here. Device pairs and shows battery and Identify but is unable to bind the buttons.

Pleas explaining wot you meaning with binding then its only used with light controllers and not "other" controllers (and this is NOT one light controller like Rodret is). And if being paired OK it shall being OK sending the commands t the system but can need being reconfigured for doing it OK.

gimik91 commented 8 months ago

Same problem here. Device pairs and shows battery and Identify but is unable to bind the buttons.

Tap the pair button 4 times to initiate the pairing process (red blinking light) then keep tapping the pair button until it’s complete. I think the remote is going to sleep before the process finishes. I got mine working.

I linked succesfully after 4 times click. I also added quirk and tried to run OTA (device is already latest version 1.0.20.
battery and identify works, but i just cannot see events from clicking the buttons. Still not solved somrig

reinder83 commented 8 months ago

I also have trouble pairing these, first few times I did not get any entities at all, now I get these image When I subscribe to zha_events in the developer tools I don't see anything

BatteryDie commented 8 months ago

I got new HA Green and I recently updated HA to 2024.1.6. It appears pairing between Somrig and Zigbee is reliable but Unfortunately, HA is not getting any event from clicking both buttons after I removed and re-paired them (pressed link buttons 4 times) three times.

image

dhzl84 commented 8 months ago

As mentioned here you have to enforce ZLL. For me this just worked by pairing Somrig via a Light device. Not sure if one can enforce ZLL otherwise. Screenshot_20240202-082634

After pairing that way I receive the events Screenshot_20240202-082852

MattWestb commented 8 months ago

The comment of ZLL is ti getting it sending Light Command like On/Off and dimming up and down. 4 press and the LED is start blinking its going in normal paring mode and if being OK its sending commands with press from both button. If not getting events try reconfigure and waking it up then sending commands. If not working restart HA and next is taking the battery out and putting it in and fast starting reconfigure.

BatteryDie commented 8 months ago

As mentioned here you have to enforce ZLL. For me this just worked by pairing Somrig via a Light device. Not sure if one can enforce ZLL otherwise.

I removed Somrig from HA and I tried pair Somrig again via devices I have:

  1. Ikea TRADFRI bulb E26 WW 806lm
  2. Jasco Enbrighten Zigbee Switch (it is acting as light device)
  3. Ikea STARKVIND Air purifier table
  4. TuYa TS011F smart plugs

Seem HA is not detecting Somrig with all of the device on the list. Weird thing is, it was able to detect and configurate Somrig with direct zigbee hub (Sonoff Zigbee 3.0 USB Dongle Plus with Texas Instruments CC2652).

P.S. What do 'enforce ZLL' mean? Google is not helping me.

reinder83 commented 8 months ago

I've managed to pair it succesfully now through an zigbee lightbulb

MattWestb commented 8 months ago

P.S. What do 'enforce ZLL' mean? Google is not helping me.´

It was the first Zigbee standard for lights (Zigbee Light Link) but its now one part or Zigbee 3 and have some extra functionality like touch link paring and the device is making its own network (IKEA standalone device / direct paring with lights and Trädfri hub is using it) and Dirigera is using "normal" paring with coordinator that is doing all security.

Your IKEA light shall not have any problem if its running current production firmware and not one old ZLL version.

HawkanForce commented 8 months ago

Is it just me or is only button1 working as of now? Nothing happens in the log when pressing button 2

image

reinder83 commented 8 months ago

Is it just me or is only button1 working as of now? Nothing happens in the log when pressing button 2

image

I have the same with 2 of my 3 somrig's, with the first one I managed to pair, everything seems to be working, I thought probably something went wrong while paring, so maybe i'll try to re-pair them later

MattWestb commented 8 months ago

If getting anything from the controller more then the checking every 50 minutes do one reconfigure of the device from the device card and waking the device then sending somthing to it then its sleeping nearly all the time. No events from button 2 and also being one hardware fault not likely one software problem.

HawkanForce commented 8 months ago

These Ikea Zigbee devices Somrig and E2002 seem to be a pain. Never had any issues with Zigbee devices before. Tried to reconfigure but now back to no buttons working and when trying to pair its stuck on interview and if trying to reconfigure it just failes despite trying to wake the device in different ways. Seems to be up to luck if you get the bindings to work. I'll leave this as is for now. Have to try to pair it again some other time and just hope for the best.

drkx commented 7 months ago

Is it just me or is only button1 working as of now? Nothing happens in the log when pressing button 2

I have the same problem. Button 1 works perfectly, but the second one seems to do nothing. Is there a possibility of debugging? To see if anything is sent by button 2?

labmonkey commented 7 months ago

As mentioned here you have to enforce ZLL. For me this just worked by pairing Somrig via a Light device. Not sure if one can enforce ZLL otherwise. Screenshot_20240202-082634

After pairing that way I receive the events Screenshot_20240202-082852

I can confirm that. I was trying everything to connect SOMRIG via my Sonoff Zigbee dongle and even if I went through the configuration step somehow the buttons never worked. I've connected Ikea TRADFRI lighbulb first and then used it to connect the remote and suddenly everything works perfectly.

MattWestb commented 7 months ago

Always have 3 or more good routers for end devices then the router part of all coordinators is very bad and being offline then restarting the system. If not you have not one mesh network but one star network with one point of (complete) failure and you is misusing the systems architecture / functionality.

petervk commented 7 months ago

I just bought one of these and once I figured out how to put it in pairing mode it seems to pair ok but I don't get any buttons showing up for the device in Home Assistant. What I find odd is that when I click either button events show up in the logbook but I don't know how to trigger automations based on that. I'm running Home Assistant 2024.2.4 and an ezsp coordinator connected via usb. image

petervk commented 7 months ago

I have been able to get this working using this blueprint: https://community.home-assistant.io/t/ikea-somrig-remote-e2213-zha/668671 but I feel like it would be better if this functionality was directly exposed through home assistant.

reinder83 commented 7 months ago

I have been able to get this working using this blueprint: https://community.home-assistant.io/t/ikea-somrig-remote-e2213-zha/668671 but I feel like it would be better if this functionality was directly exposed through home assistant.

When you choose device trigger in the automation, you get all the options, no blueprint needed for that image

petervk commented 7 months ago

Oh, there they are. I thought I tried that before and didn't see anything. Thanks!

MattWestb commented 7 months ago

For information is one firmware update in the pipe for Somrig its just being certificated by CSA so very likely its being released in some weeks. https://csa-iot.org/csa_product/somrig-shortcut-button-2/ Its only bug fix then its jumping from 1.0.20 to 1.0.21.