IKEA Shortcut Button OTA to V-2.3.080 | Automation Issue | quirk update

After OTA updating IKEA Shortcut Button to V-2.3.080, it is detected in ZHA integration but no automation options are found except device offline.

To resolve that, I updated the quirk file for the shortcut button and it is working now

Here is how to do that:

  1. SSH login to hassio [using SSH & Web Terminal addon]
  2. Login to homeassistant docker image
    $ docker exec -it homeassistant /bin/bash
  3. go to the below path
    # cd /usr/local/lib/python3.9/site-packages/zhaquirks/ikea
  4. Take backup of shortcutbtn.py file
    # cp shortcutbtn.py shortcutbtn.py_bak
  5. Update the file contents to be as the below
"""Device handler for IKEA of Sweden TRADFRI shortcut button."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.closures import WindowCovering
from zigpy.zcl.clusters.general import (
    Alarms,
    Basic,
    Groups,
    Identify,
    LevelControl,
    OnOff,
    Ota,
    PollControl,
    PowerConfiguration,
)
from zigpy.zcl.clusters.lightlink import LightLink

from zhaquirks.const import (
    ARGS,
    CLUSTER_ID,
    COMMAND,
    COMMAND_MOVE_ON_OFF,
    COMMAND_ON,
    COMMAND_STOP,
    DEVICE_TYPE,
    DIM_UP,
    ENDPOINT_ID,
    ENDPOINTS,
    INPUT_CLUSTERS,
    LONG_PRESS,
    LONG_RELEASE,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
    SHORT_PRESS,
    TURN_ON,
    DOUBLE_PRESS,
    COMMAND_OFF,
)
from zhaquirks.ikea import IKEA, LightLinkCluster, PowerConfiguration1CRCluster

IKEA_CLUSTER_ID = 0xFC7C  # decimal = 64636

class IkeaTradfriShortcutBtn(CustomDevice):
    """Custom device representing IKEA of Sweden TRADFRI shortcut button."""

    signature = {
        # <SimpleDescriptor endpoint=1 profile=260 device_type=2080
        # device_version=1
        # input_clusters=[0, 1, 3, 9, 32, 4096, 64636]
        ## input_clusters=[0, 1, 3, 9, 32, 4096]
        ## output_clusters=[3, 4, 6, 8, 25, 258, 4096]>
        # output_clusters=[3, 4, 6, 8, 25, 4096]>
        MODELS_INFO: [(IKEA, "TRADFRI SHORTCUT Button")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.NON_COLOR_CONTROLLER,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    Alarms.cluster_id,
                    PollControl.cluster_id,
                    LightLink.cluster_id,
                    IKEA_CLUSTER_ID,
                ],
                OUTPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Groups.cluster_id,
                    OnOff.cluster_id,
                    LevelControl.cluster_id,
                    Ota.cluster_id,
                    #WindowCovering.cluster_id,
                    LightLink.cluster_id,
                ],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.NON_COLOR_CONTROLLER,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration1CRCluster,
                    Identify.cluster_id,
                    Alarms.cluster_id,
                    PollControl.cluster_id,
                    LightLinkCluster,
                ],
                OUTPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Groups.cluster_id,
                    OnOff.cluster_id,
                    LevelControl.cluster_id,
                    Ota.cluster_id,
                    WindowCovering.cluster_id,
                    LightLink.cluster_id,
                ],
            }
        }
    }

    device_automation_triggers = {
        (SHORT_PRESS, TURN_ON): {COMMAND: COMMAND_ON, CLUSTER_ID: 6, ENDPOINT_ID: 1},
        (DOUBLE_PRESS, TURN_ON): {COMMAND: COMMAND_OFF, CLUSTER_ID: 6, ENDPOINT_ID: 1},
        (LONG_PRESS, DIM_UP): {
            COMMAND: COMMAND_MOVE_ON_OFF,
            CLUSTER_ID: 8,
            ENDPOINT_ID: 1,
            ARGS: [0, 83],
        },
        (LONG_RELEASE, DIM_UP): {
            COMMAND: COMMAND_STOP,
            CLUSTER_ID: 8,
            ENDPOINT_ID: 1,
        },
    }
  1. Restart home assistant
  2. If it fail, just restore the backup file
    # cp shortcutbtn.py_bak shortcutbtn.py

Looks like there’s a better way than replacing the .py file in the container: New method adding local quirks in HA

And tracking the specific issue: https://github.com/zigpy/zha-device-handlers/issues/1204