Skip to content

Instantly share code, notes, and snippets.

@HarvsG
Last active March 20, 2024 06:25
Show Gist options
  • Star 25 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save HarvsG/d43344cbe07e046cdda50c2458018c33 to your computer and use it in GitHub Desktop.
Save HarvsG/d43344cbe07e046cdda50c2458018c33 to your computer and use it in GitHub Desktop.
Adding IKEA Tradfri Devices with ZHA on Home Assistant

Shortcut and On/Off switches

  1. Remove back cover with philips scredriver and instert provided battery
  2. In home assistant select a ZHA always-on zigbee device - such as a powered light or signal repeater in the same room the shortcut button will end up in
  3. Select "Add device via this device"
  4. Press the pair button 4 times on the back of the shortcut button
  5. Wait
  6. If using an On/Off switch and you want to bind it to a bulb for non-controller dependant control (i.e will work if home assistant is down)

Pairing On/Off Switches to IKEA Bulbs

For firmware versions 2.3.0.75 or greater.

Before version 2.3.075 The IKEA on/off switches only bind to zigbee groups After they only bind to individual devices: The most reliable method seems to be: In ZHA for me that process is bring up the device page for the switch, 3 dots the the right of the reconfigure button, manage ZigBee device, bindings.

  1. Consider updating to the latest firmware, as updates alter this functionality.
  2. Unbind the switch from all devices including the co-ordinator
  3. Unbind from all groups (check all clusters) <-- not sure if necessary
  4. Reconfigure the device from the ZHA UI <-- not sure if necessary.
  5. Unbind from the coordinator again <-- not sure if necessary
  6. Bind with the desired lights
  7. Re-bind with the coordinator (This ensures the homeassistant UI acutally shows the state changes)
  8. If the lights do not update their status in the UI when turned on or off by the switch, then click RECONFIGURE DEVICE for each light, making sure to refresh the page between each device

Note about shortcut buttons

At software version number 2.3.015 they have 3 possible comands "on" (triggered with a short press) "move_with_on_off" triggered by a long press and "stop" triggered by a release of a long press. Each message may also be duplicated many times (apparently this is within the zigbee spec, but you may have to control for it in node-red (this node is helpful)

Somewhere between 2.3.015 and 2.3.80 the gain the "off" function which is tiggered by a double click. The message duplication is also improved ?completeley resolved?

Checking software version numbers in ZHA

  1. Device page of the device in question
  2. Manage Clusters
  3. "Basic (Endpoint id: 1, Id: 0x0000, Type: in)"
  4. Cluster Attributes -> "sw_build_id (id: 0x4000)"
  5. Click "Get Zigbee Attribute"
  6. If device is battery powered, trigger it somehow
  7. The version should appear in the "Value" box

Updating software in ZHA

I think updating software is generally a good idea, but IKEA often changes functionality with little warning and so it may break some of you systems. ZHA way of managing updates (if enables) is to silently update your devices in the background. Which may mean that things can silently break.

Updating On/Off remotes and shortcut buttons

This post on reddit by u/Wwalltt is currently a good overview of how updates work in ZHA

Version info is as follows from the IKEA server (no changelog): http://fw.ota.homesmart.ikea.net/feed/version_info.json

Tradfri changelog https://ww8.ikea.com/ikeahomesmart/releasenotes/releasenotes.html

Or official docs are a little better than they were: https://www.home-assistant.io/integrations/zha/#ota-firmware-updates

  • As of 2.3.075 or later on switches they go from being able to bind groups and not devices to the opposite
  • For the shortcut buttons as of 2.3.0.75, they gain the off command on double press and the duplicaiton problem is fixed.

In ZHA:

  1. Ensure you have OTA updates enabled in ZHA (see above)
  2. In my experience devices begin updating soon after joining the network anyway - you can skip to step 8/9 to check
  3. Select the device you want to update
  4. Select Manage Clusters
  5. Select Ota (Endpoint id: 1, Id: 0x0019, Type: out)
  6. In the Cluster Commands drop-down, (not Cluster Attributes) select image_notify (id: 0x0000)
  7. Click ISSUE ZIGBEE COMMAND whilst waking the device
  8. Wait One device took approx 2 hours(!)
    • there is no obvious way to tell if the update has started except to SSH into the HA and run tail -f home-assistant.log | egrep zigpy which should show an increasing upgrade percentage if you have DEBUG level logging for zigpy/ZHA.
  9. You can track the progress with tail -f home-assistant.log | egrep "OTA upgrade progress:"
@Christian1313
Copy link

If i perform the OTA in ZHA i get an error:
"Value for field 'payload_type' is require (See screenshot)

Shortcut version is "2.3.015"

Bildschirmfoto 2022-04-10 um 20 07 32

@adwoodworth
Copy link

If i perform the OTA in ZHA i get an error: "Value for field 'payload_type' is require (See screenshot)

Shortcut version is "2.3.015"

Bildschirmfoto 2022-04-10 um 20 07 32

I am having the same issue, "payload_type" is required. I can;t find any further details on what this means or how to solve it.

@johga1
Copy link

johga1 commented May 2, 2022

hortcut version is "2.3.015"

I'm also reccieving the message abot payload_type required. However, when checkling the logs the upgrade process seems to start anyway.
I've successfully updated one of my IKEA Shortcuts with the documented method way, and in the process of updating the second one.

image

Out of box firmware:
image

Updated firmware (01-MAY-22):
image

And the 'off' state is enabled after firmware update.

@devhammer
Copy link

I also encountered the 'payload_type" required error, but did not appear to initiate the OTA update in my case.

I found this issue which appears to be related, and includes a workaround which I'm currently testing:

home-assistant/core#71234

I'll report back with whether or not that was able to successfully update my shortcut button firmware.

@devhammer
Copy link

devhammer commented Jun 7, 2022

Mixed results so far, but I think the manual firmware update request via the Service tab is not working for me. I am able to successfully send the command, and I do see the command issued in the log, but it does not appear to cause the button to actually update.

2022-06-07 13:13:44 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9891](TRADFRI SHORTCUT Button): Issued cluster command: cluster_id: 25 command: 0 command_type: client args: (0, 100) cluster_id: out manufacturer: None endpoint_id: 1
2022-06-07 13:13:44 DEBUG (MainThread) [homeassistant.components.zha.api] Issued command for: cluster_id: [25] cluster_type: [out] endpoint_id: [1] command: [0] command_type: [client] args: [0, 100] manufacturer: [None] response: None

One of my 2 Tradfri shortcut buttons did get firmware updated, but appears that may have happened when I restarted the VirtualBox VM on which I have HA running. Either that, or I just need to be patient and wait for the 2nd button to be good and ready to update.

EDIT - Yeah, turns out the problem was between the chair and keyboard...forgot that I needed to wake the button when issuing the command. As soon as I did that, it kicked off the update. Not sure why, but this update seems pretty slow, but at least it's going.

Thanks, @HarvsG, for the original steps for requesting the OTA update. I can now confirm that the workaround in the link above will successfully kick off the request without encountering the 'payload_type' required error.

@officialdavidtaylor
Copy link

FWIW, I just bought a shortcut button this week and was able to connect it to ZHA, but I wasn't seeing any events firing when I pressed the button.

The original FW version was 2.3.015. I used the OTA update method described here, and though I had the same failure message as @Christian1313 when I came back a few hours later the FW had been updated to 2.3.080!

I removed the shortcut button from ZHA then reconnected it, and now it reliably fires single, double and long press events.

Thanks for this guide 🙏

@HarvsG
Copy link
Author

HarvsG commented Aug 5, 2022

If i perform the OTA in ZHA i get an error: "Value for field 'payload_type' is require (See screenshot)

Shortcut version is "2.3.015"

Bildschirmfoto 2022-04-10 um 20 07 32

I have raised this is an issue: home-assistant/core#76093

@GHTGXL
Copy link

GHTGXL commented Oct 17, 2022

After wasting a day trying to use it, Finally Can Use, FW:0x23015631, I use/work by pressing the central and pairing buttons simultaneously, trying to wake up the button, otherwise is paired, but can't use it.

Edit: try to replicate this method, but is a 50/50 chance to work. And Maybe Wait 5 min?

IMG_2022-10-17-18-41-57-596

@HarvsG
Copy link
Author

HarvsG commented Oct 17, 2022

After wasting a day trying to use it, Finally Can Use, FW:0x23015631, I use/work by pressing the central and pairing buttons simultaneously, trying to wake up the button, otherwise is paired, but can't use it.

Edit: try to replicate this method, but is a 50/50 chance to work. And Maybe Wait 5 min?

IMG_2022-10-17-18-41-57-596

Which device is this?

@GHTGXL
Copy link

GHTGXL commented Oct 18, 2022

After wasting a day trying to use it, Finally Can Use, FW:0x23015631, I use/work by pressing the central and pairing buttons simultaneously, trying to wake up the button, otherwise is paired, but can't use it.
Edit: try to replicate this method, but is a 50/50 chance to work. And Maybe Wait 5 min?
IMG_2022-10-17-18-41-57-596

Which device is this?

Tradfri Shortcut button Type E1812

@NdK73
Copy link

NdK73 commented Mar 8, 2023

After a recent HA update (2023.3.x, not sure .0 or .1) both my Tradfri buttons stopped woring.
Pairing works OK (both from the coordinator or from a Tuya switch), but no events.

I also tried pairing to Z2M, and I can see the events in MQTT, so it seems a ZHA issue. Firmware is the latest 2.3.080 .

@jjnj023
Copy link

jjnj023 commented Mar 12, 2023

Same here... I can connect the switch but no actions are seen in Home Assistant

@Misiu
Copy link

Misiu commented Mar 13, 2023

I'm new to ZHA, but I'm pulling my hair out. Fresh install of HA (2023.03) and new ZHA network (iTead dongle Plus P).
My Ikea Shortcut Button was paired in a second, but I can't do anything with it - there are no events. I only get battery value :/

@leonbohmann
Copy link

I'm new to ZHA, but I'm pulling my hair out. Fresh install of HA (2023.03) and new ZHA network (iTead dongle Plus P). My Ikea Shortcut Button was paired in a second, but I can't do anything with it - there are no events. I only get battery value :/

Same for me. Thats probably the reason the author advises us to use the switch with the bulbs directly and only have light updates in HA.

@georgeolaru
Copy link

georgeolaru commented Mar 17, 2023

It seems that time helps. No events after successfully connecting; leave it there one night, and it works in the morning 🤷‍♂️

@Misiu
Copy link

Misiu commented Mar 17, 2023

Hi all, any hints on what to put in manufacturer_code, image_type and new_file_version boxes?
image
Without the values, I can't call any commands.

I also noticed that I'm unable to read any attribute:
image
Every time I try to read any attribute I get an error sign and nothing happens.

I have this in logs:

2023-03-17 09:49:00.161 DEBUG (MainThread) [homeassistant.components.zha.api] Get bindable devices: source_ieee: [54:0f:57:ff:fe:f5:88:13], bindable devices: [[{'ieee': '00:12:4b:00:24:c2:d1:5a', 'nwk': 0x0000, 'manufacturer': 'Texas Instruments', 'model': 'CC1352/CC2652, Z-Stack 3.30+ (build 20221226)', 'name': 'Texas Instruments CC1352/CC2652, Z-Stack 3.30+ (build 20221226)', 'quirk_applied': False, 'quirk_class': 'zigpy_znp.zigbee.device.ZNPCoordinator', 'manufacturer_code': 0, 'power_source': 'Mains', 'lqi': None, 'rssi': None, 'last_seen': '2023-03-17T09:21:35', 'available': True, 'device_type': 'Coordinator', 'signature': {'node_descriptor': 'NodeDescriptor(logical_type=<LogicalType.Coordinator: 0>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice|AlternatePanCoordinator: 143>, manufacturer_code=0, maximum_buffer_size=80, maximum_incoming_transfer_size=160, server_mask=11265, maximum_outgoing_transfer_size=160, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=True, *is_coordinator=True, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)', 'endpoints': {1: {'profile_id': 260, 'device_type': '0x0400', 'in_clusters': ['0x0000', '0x0006', '0x000a', '0x0019', '0x0501'], 'out_clusters': ['0x0001', '0x0020', '0x0500', '0x0502']}, 2: {'profile_id': 49246, 'device_type': '0x0820', 'in_clusters': ['0x0000'], 'out_clusters': []}}}, 'active_coordinator': True, 'entities': [], 'neighbors': [{'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': '82:f8:75:26:cf:1f:54:a3', 'ieee': '00:12:4b:00:25:0e:01:af', 'nwk': '0x17AE', 'permit_joining': 'Unknown', 'depth': '1', 'lqi': '178'}], 'routes': [], 'endpoint_names': [{'name': 'CONTROLLER'}, {'name': 'IAS_CONTROL'}], 'user_given_name': None, 'device_reg_id': '575c7b99cc16aeeffea75e71cc0bda30', 'area_id': 'biuro'}]]
2023-03-17 09:49:00.188 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 9, cluster_type: 'in', endpoint_id: 1, response: [{'id': 0, 'name': 'alarm_count'}, {'id': 65533, 'name': 'cluster_revision'}, {'id': 65534, 'name': 'attr_reporting_status'}]
2023-03-17 09:49:01.949 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 0, cluster_type: 'in', endpoint_id: 1, response: [{'id': 0, 'name': 'zcl_version'}, {'id': 1, 'name': 'app_version'}, {'id': 2, 'name': 'stack_version'}, {'id': 3, 'name': 'hw_version'}, {'id': 4, 'name': 'manufacturer'}, {'id': 5, 'name': 'model'}, {'id': 6, 'name': 'date_code'}, {'id': 7, 'name': 'power_source'}, {'id': 8, 'name': 'generic_device_class'}, {'id': 9, 'name': 'generic_device_type'}, {'id': 10, 'name': 'product_code'}, {'id': 11, 'name': 'product_url'}, {'id': 12, 'name': 'manufacturer_version_details'}, {'id': 13, 'name': 'serial_number'}, {'id': 14, 'name': 'product_label'}, {'id': 16, 'name': 'location_desc'}, {'id': 17, 'name': 'physical_env'}, {'id': 18, 'name': 'device_enabled'}, {'id': 19, 'name': 'alarm_mask'}, {'id': 20, 'name': 'disable_local_config'}, {'id': 16384, 'name': 'sw_build_id'}, {'id': 65533, 'name': 'cluster_revision'}, {'id': 65534, 'name': 'attr_reporting_status'}]
2023-03-17 09:49:08.950 DEBUG (MainThread) [zigpy.zcl] [0x8EA6:1:0x0000] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=28, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
2023-03-17 09:49:08.951 DEBUG (MainThread) [zigpy.zcl] [0x8EA6:1:0x0000] Sending request: Read_Attributes(attribute_ids=[16384])
2023-03-17 09:49:08.952 DEBUG (MainThread) [zigpy.device] [0x8ea6] Extending timeout for 0x1c request
2023-03-17 09:49:13.864 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9318](TRADFRI SHORTCUT Button): Device seen - marking the device available and resetting counter
2023-03-17 09:49:13.864 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9318](TRADFRI SHORTCUT Button): Update device availability - device available: True - new availability: True - changed: False

@silversparker
Copy link

I'm new to ZHA, but I'm pulling my hair out. Fresh install of HA (2023.03) and new ZHA network (iTead dongle Plus P). My Ikea Shortcut Button was paired in a second, but I can't do anything with it - there are no events. I only get battery value :/

If you get a correct battery value, pair the shortcut button with an Ikea-Bulb (5-10 sec pair-button hold on the shortcut button). After that, you should get events from the button in hass. You just have to reset the bulb after that. But that works wonders for me.

@Misiu
Copy link

Misiu commented Mar 20, 2023

If you get a correct battery value, pair the shortcut button with an Ikea-Bulb (5-10 sec pair-button hold on the shortcut button). After that, you should get events from the button in hass. You just have to reset the bulb after that. But that works wonders for me.

I don't have any ZHA bulbs :/
Funny thing is that the shortcut buttons are working (at least now), but I'm unable to read any attributes from any zha device.

@barcik75
Copy link

barcik75 commented Apr 20, 2023

I managed to update the switch version to 2.3.080 (according to the Ikea website, the latest version for this switch) But I still don't have Action entities, only Diagnostic entities.
I'm using ZHA, a colleague is using ZigBee2MQTT and there I have Action related entities, not just Diagnostics. It's funny that pressing the button longer, twice or once briefly generates entries in the Event Log, but I can't control them in any way (creating automation)
Anyone have any ideas on how to force the controls to appear? Switch to ZigBee2MQTT? Anything else?
obraz

I have a similar problem with the STYRBAR button. Entities in the Diagnostics category are available.

@barcik75
Copy link

Hi all, any hints on what to put in manufacturer_code, image_type and new_file_version boxes? Without the values, I can't call any commands.

I also noticed that I'm unable to read any attribute: Every time I try to read any attribute I get an error sign and nothing happens.

I have this in logs:

2023-03-17 09:49:00.161 DEBUG (MainThread) [homeassistant.components.zha.api] Get bindable devices: source_ieee: [54:0f:57:ff:fe:f5:88:13], bindable devices: [[{'ieee': '00:12:4b:00:24:c2:d1:5a', 'nwk': 0x0000, 'manufacturer': 'Texas Instruments', 'model': 'CC1352/CC2652, Z-Stack 3.30+ (build 20221226)', 'name': 'Texas Instruments CC1352/CC2652, Z-Stack 3.30+ (build 20221226)', 'quirk_applied': False, 'quirk_class': 'zigpy_znp.zigbee.device.ZNPCoordinator', 'manufacturer_code': 0, 'power_source': 'Mains', 'lqi': None, 'rssi': None, 'last_seen': '2023-03-17T09:21:35', 'available': True, 'device_type': 'Coordinator', 'signature': {'node_descriptor': 'NodeDescriptor(logical_type=<LogicalType.Coordinator: 0>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice|AlternatePanCoordinator: 143>, manufacturer_code=0, maximum_buffer_size=80, maximum_incoming_transfer_size=160, server_mask=11265, maximum_outgoing_transfer_size=160, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=True, *is_coordinator=True, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)', 'endpoints': {1: {'profile_id': 260, 'device_type': '0x0400', 'in_clusters': ['0x0000', '0x0006', '0x000a', '0x0019', '0x0501'], 'out_clusters': ['0x0001', '0x0020', '0x0500', '0x0502']}, 2: {'profile_id': 49246, 'device_type': '0x0820', 'in_clusters': ['0x0000'], 'out_clusters': []}}}, 'active_coordinator': True, 'entities': [], 'neighbors': [{'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': '82:f8:75:26:cf:1f:54:a3', 'ieee': '00:12:4b:00:25:0e:01:af', 'nwk': '0x17AE', 'permit_joining': 'Unknown', 'depth': '1', 'lqi': '178'}], 'routes': [], 'endpoint_names': [{'name': 'CONTROLLER'}, {'name': 'IAS_CONTROL'}], 'user_given_name': None, 'device_reg_id': '575c7b99cc16aeeffea75e71cc0bda30', 'area_id': 'biuro'}]]
2023-03-17 09:49:00.188 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 9, cluster_type: 'in', endpoint_id: 1, response: [{'id': 0, 'name': 'alarm_count'}, {'id': 65533, 'name': 'cluster_revision'}, {'id': 65534, 'name': 'attr_reporting_status'}]
2023-03-17 09:49:01.949 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 0, cluster_type: 'in', endpoint_id: 1, response: [{'id': 0, 'name': 'zcl_version'}, {'id': 1, 'name': 'app_version'}, {'id': 2, 'name': 'stack_version'}, {'id': 3, 'name': 'hw_version'}, {'id': 4, 'name': 'manufacturer'}, {'id': 5, 'name': 'model'}, {'id': 6, 'name': 'date_code'}, {'id': 7, 'name': 'power_source'}, {'id': 8, 'name': 'generic_device_class'}, {'id': 9, 'name': 'generic_device_type'}, {'id': 10, 'name': 'product_code'}, {'id': 11, 'name': 'product_url'}, {'id': 12, 'name': 'manufacturer_version_details'}, {'id': 13, 'name': 'serial_number'}, {'id': 14, 'name': 'product_label'}, {'id': 16, 'name': 'location_desc'}, {'id': 17, 'name': 'physical_env'}, {'id': 18, 'name': 'device_enabled'}, {'id': 19, 'name': 'alarm_mask'}, {'id': 20, 'name': 'disable_local_config'}, {'id': 16384, 'name': 'sw_build_id'}, {'id': 65533, 'name': 'cluster_revision'}, {'id': 65534, 'name': 'attr_reporting_status'}]
2023-03-17 09:49:08.950 DEBUG (MainThread) [zigpy.zcl] [0x8EA6:1:0x0000] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=28, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
2023-03-17 09:49:08.951 DEBUG (MainThread) [zigpy.zcl] [0x8EA6:1:0x0000] Sending request: Read_Attributes(attribute_ids=[16384])
2023-03-17 09:49:08.952 DEBUG (MainThread) [zigpy.device] [0x8ea6] Extending timeout for 0x1c request
2023-03-17 09:49:13.864 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9318](TRADFRI SHORTCUT Button): Device seen - marking the device available and resetting counter
2023-03-17 09:49:13.864 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9318](TRADFRI SHORTCUT Button): Update device availability - device available: True - new availability: True - changed: False

Misiu, I had a similar problem. And I don't have Ikea bulbs either. I moved the switch closer to the gate and pressed the Read Attributes button until the value showed up, which was about 10 times.

@silversparker
Copy link

I managed to update the switch version to 2.3.080 (according to the Ikea website, the latest version for this switch) But I still don't have Action entities, only Diagnostic entities. I'm using ZHA, a colleague is using ZigBee2MQTT and there I have Action related entities, not just Diagnostics. It's funny that pressing the button longer, twice or once briefly generates entries in the Event Log, but I can't control them in any way (creating automation) Anyone have any ideas on how to force the controls to appear? Switch to ZigBee2MQTT? Anything else?

I have a similar problem with the STYRBAR button. Entities in the Diagnostics category are available.

But if there are events showing then youre ready to go? Just use the trigger "device" in your automations and set the trigger of that device to short press or long press. Or am I misunderstanding you?

@barcik75
Copy link

I managed to update the switch version to 2.3.080 (according to the Ikea website, the latest version for this switch) But I still don't have Action entities, only Diagnostic entities. I'm using ZHA, a colleague is using ZigBee2MQTT and there I have Action related entities, not just Diagnostics. It's funny that pressing the button longer, twice or once briefly generates entries in the Event Log, but I can't control them in any way (creating automation) Anyone have any ideas on how to force the controls to appear? Switch to ZigBee2MQTT? Anything else?
I have a similar problem with the STYRBAR button. Entities in the Diagnostics category are available.

But if there are events showing then youre ready to go? Just use the trigger "device" in your automations and set the trigger of that device to short press or long press. Or am I misunderstanding you?

You understood me right :) So far in all automations I have used entities and "forgot" that devices can also be used. Thanks for the hint, now everything is ok.

@dect0r
Copy link

dect0r commented May 10, 2023

Hi all, any hints on what to put in manufacturer_code, image_type and new_file_version boxes? image Without the values, I can't call any commands.

I also noticed that I'm unable to read any attribute: image Every time I try to read any attribute I get an error sign and nothing happens.

I have this in logs:

2023-03-17 09:49:00.161 DEBUG (MainThread) [homeassistant.components.zha.api] Get bindable devices: source_ieee: [54:0f:57:ff:fe:f5:88:13], bindable devices: [[{'ieee': '00:12:4b:00:24:c2:d1:5a', 'nwk': 0x0000, 'manufacturer': 'Texas Instruments', 'model': 'CC1352/CC2652, Z-Stack 3.30+ (build 20221226)', 'name': 'Texas Instruments CC1352/CC2652, Z-Stack 3.30+ (build 20221226)', 'quirk_applied': False, 'quirk_class': 'zigpy_znp.zigbee.device.ZNPCoordinator', 'manufacturer_code': 0, 'power_source': 'Mains', 'lqi': None, 'rssi': None, 'last_seen': '2023-03-17T09:21:35', 'available': True, 'device_type': 'Coordinator', 'signature': {'node_descriptor': 'NodeDescriptor(logical_type=<LogicalType.Coordinator: 0>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice|AlternatePanCoordinator: 143>, manufacturer_code=0, maximum_buffer_size=80, maximum_incoming_transfer_size=160, server_mask=11265, maximum_outgoing_transfer_size=160, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=True, *is_coordinator=True, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)', 'endpoints': {1: {'profile_id': 260, 'device_type': '0x0400', 'in_clusters': ['0x0000', '0x0006', '0x000a', '0x0019', '0x0501'], 'out_clusters': ['0x0001', '0x0020', '0x0500', '0x0502']}, 2: {'profile_id': 49246, 'device_type': '0x0820', 'in_clusters': ['0x0000'], 'out_clusters': []}}}, 'active_coordinator': True, 'entities': [], 'neighbors': [{'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': '82:f8:75:26:cf:1f:54:a3', 'ieee': '00:12:4b:00:25:0e:01:af', 'nwk': '0x17AE', 'permit_joining': 'Unknown', 'depth': '1', 'lqi': '178'}], 'routes': [], 'endpoint_names': [{'name': 'CONTROLLER'}, {'name': 'IAS_CONTROL'}], 'user_given_name': None, 'device_reg_id': '575c7b99cc16aeeffea75e71cc0bda30', 'area_id': 'biuro'}]]
2023-03-17 09:49:00.188 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 9, cluster_type: 'in', endpoint_id: 1, response: [{'id': 0, 'name': 'alarm_count'}, {'id': 65533, 'name': 'cluster_revision'}, {'id': 65534, 'name': 'attr_reporting_status'}]
2023-03-17 09:49:01.949 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 0, cluster_type: 'in', endpoint_id: 1, response: [{'id': 0, 'name': 'zcl_version'}, {'id': 1, 'name': 'app_version'}, {'id': 2, 'name': 'stack_version'}, {'id': 3, 'name': 'hw_version'}, {'id': 4, 'name': 'manufacturer'}, {'id': 5, 'name': 'model'}, {'id': 6, 'name': 'date_code'}, {'id': 7, 'name': 'power_source'}, {'id': 8, 'name': 'generic_device_class'}, {'id': 9, 'name': 'generic_device_type'}, {'id': 10, 'name': 'product_code'}, {'id': 11, 'name': 'product_url'}, {'id': 12, 'name': 'manufacturer_version_details'}, {'id': 13, 'name': 'serial_number'}, {'id': 14, 'name': 'product_label'}, {'id': 16, 'name': 'location_desc'}, {'id': 17, 'name': 'physical_env'}, {'id': 18, 'name': 'device_enabled'}, {'id': 19, 'name': 'alarm_mask'}, {'id': 20, 'name': 'disable_local_config'}, {'id': 16384, 'name': 'sw_build_id'}, {'id': 65533, 'name': 'cluster_revision'}, {'id': 65534, 'name': 'attr_reporting_status'}]
2023-03-17 09:49:08.950 DEBUG (MainThread) [zigpy.zcl] [0x8EA6:1:0x0000] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), tsn=28, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
2023-03-17 09:49:08.951 DEBUG (MainThread) [zigpy.zcl] [0x8EA6:1:0x0000] Sending request: Read_Attributes(attribute_ids=[16384])
2023-03-17 09:49:08.952 DEBUG (MainThread) [zigpy.device] [0x8ea6] Extending timeout for 0x1c request
2023-03-17 09:49:13.864 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9318](TRADFRI SHORTCUT Button): Device seen - marking the device available and resetting counter
2023-03-17 09:49:13.864 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x9318](TRADFRI SHORTCUT Button): Update device availability - device available: True - new availability: True - changed: False

You only have to select QueryJitter and leave the slider unchanged. This triggered the OTA for me

@Alveoli
Copy link

Alveoli commented Sep 29, 2023

Very informative posts, thank you.

I just bought a Tradfri Shortcut button Type E1812 two days and had similar issue - it binds to ZHA, I can see the battery level but no events. I wasn't able to connect to get the sw_build_id (same red exclamation mark error above).

Frustrated, I left it for two days... and this morning it's just started eventing! I did nothing. Didn't check or update the firmware.

Hopefully it continues to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment