Silver Crest ( Lidl) smart Button

Hey folks,

I have a view Lidls smart Button at home. To connect them with Homeassistan was easy but there is a small “problem” one click is off an double click is on . My wife don’t like it and will try to change this behavior but I have no idea how :sweat_smile:

I use the Smart Button too with Zigbee2MQTT: Lidl HG08164 control via MQTT | Zigbee2MQTT with/for automations. For example as a light switch.

There ist no Problem: One click = On and One click = Off

Ok, I use the Zigbee home automation integration any idea how I can fix this behavior?

No, unfortunately not. Sorry.

Assuming the button isn’t bound directly to the light, change the “click” automation to a light.toggle service call.

Did you find a solution? Because im facing the exact same issue.

Hey, no I’m working on it but no results.

I found a Solution:
First create a custom quirks direction like described here.:

Then create a file there with .py as file extension (name of file doesnt matter) and paste in this code:

"""Lidl TS004F Smart Button SSBM A1"""

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
    Basic,
    Groups,
    Identify,
    LevelControl,
    OnOff,
    Ota,
    PowerConfiguration,
    Scenes,
    Time,
)
from zigpy.zcl.clusters.lightlink import LightLink

from zhaquirks.const import (
    BUTTON,
    BUTTON_1,
    BUTTON_2,
    BUTTON_3,
    BUTTON_4,
    CLUSTER_ID,
    COMMAND,
    COMMAND_MOVE,
    COMMAND_MOVE_SATURATION,
    COMMAND_OFF,
    COMMAND_ON,
    COMMAND_STEP,
    COMMAND_STOP,
    COMMAND_STOP_MOVE_STEP,
    COMMAND_TOGGLE,
    DEVICE_TYPE,
    DIM_DOWN,
    DIM_UP,
    DOUBLE_PRESS,
    ENDPOINT_ID,
    ENDPOINTS,
    INPUT_CLUSTERS,
    LEFT,
    LONG_PRESS,
    LONG_RELEASE,
    MODEL,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PARAMS,
    PROFILE_ID,
    RIGHT,
    SHORT_PRESS,
    TURN_OFF,
    TURN_ON,
)
from zhaquirks.tuya import TuyaZBOnOffAttributeCluster, TuyaZBExternalSwitchTypeCluster 

class LidlSmartRemote004F(CustomDevice):
    """Lidl one button smart remote - model SSBM A1"""

    signature = {
        # "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=4098, 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)",
        # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=2080, device_version=1, input_clusters=[0, 1, 3, 4, 4096, 57345], output_clusters=[3, 4, 5, 6, 8, 10, 25, 4096])
        MODEL: "TS004F",
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.DIMMER_SWITCH,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    OnOff.cluster_id,
                    LightLink.cluster_id,
                    TuyaZBExternalSwitchTypeCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    Ota.cluster_id,
                    Time.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    OnOff.cluster_id,
                    LevelControl.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,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,  # Is needed for adding group then binding is not working.
                    LightLink.cluster_id,
                    TuyaZBExternalSwitchTypeCluster,
                ],
                OUTPUT_CLUSTERS: [
                    Ota.cluster_id,
                    Time.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaZBOnOffAttributeCluster,
                    LevelControl.cluster_id,
                    LightLink.cluster_id,
                ],
            },
        },
    }

    device_automation_triggers = {
        (SHORT_PRESS, BUTTON): {COMMAND: COMMAND_ON, ENDPOINT_ID: 1},
        (DOUBLE_PRESS, BUTTON): {COMMAND: COMMAND_OFF, ENDPOINT_ID: 1},
        (LONG_PRESS, BUTTON): {COMMAND: COMMAND_STEP, ENDPOINT_ID: 1},
        (LONG_RELEASE, BUTTON): {COMMAND: COMMAND_STOP, ENDPOINT_ID: 1},
    }

Save and restart. After that there should be new options for the button. See here:

11 Likes

I could not make it run with quirk. I have still the same options.

Did you restart home assistant after creating the python file?

1 Like

Yes I did. But I already found the Issue: I forgot to add the following entry in the configuration.yaml:

zha:
  enable_quirks: true
  custom_quirks_path: /config/custom_zha_quirks

Thank you for providing this solution :grinning:. It makes the button more usable.

2 Likes

I tried the same, but doesn’t work for me. Added all lines to config, restarted, but still get an error log:

''Invalid config for [script]: value must be one of [‘brightness_decrease’, ‘brightness_increase’, ‘flash’, toggle', 'turn_off', 'turn_on'] for dictionary value @ data['type']. Got None. (See /config/configuration.yaml, line 12).

Any advice? Thank you!
(Sorry for bad formatting, first post :slight_smile: )

Could you check or post the lines of your config in this specific lines ?

config.yaml:

zha:
enable_quirks: true
custom_quirks_path: /config/zha_custom_quirks/

I’ve created the directory and *.py file. The *.py contains the exact copy of the code from drauboss:
image

Her’s the exact log:

Logger: homeassistant.config
Source: config.py:454
First occurred: 12:32:33 (1 occurrences)
Last logged: 12:32:33

Invalid config for [script]: value must be one of [‘brightness_decrease’, ‘brightness_increase’, ‘flash’, ‘toggle’, ‘turn_off’, ‘turn_on’] for dictionary value @ data[‘type’]. Got None. (See /config/configuration.yaml, line 12).

Thank you!

image
Did you try with indentation here ?
Then you should check if your configuration is valid before restart:

Hi,
could you explain how did you connect your Lidl button to the Homeassistant? I cannot understand how I should do it. The 5s on the button does not make it enter pairing mode, as other Zigbee devices do…

thanks!

1 Like

The reset button is under the cover where you would find the battery. Open the cover and keep the tiny reset button for 5 seconds and the light on the button will start blink for pairing mode

Instead of making a quirk, would it be simpler to change the automation so that when you get the single press “on” command it does a “toggle” of the light? That way each time you press it once it will change the light? This is what we have in our in-wall switches: press once to switch the light.

1 Like

Wow thanks! I could not find it, and was about to give it back to the shop, but this evening I will try to connect it, I hope it works :slight_smile:
Best regards!

I got it working by creating two automations:
First one triggers when button is turned on → Condition: Light is Off → Actions: Turn light on → Actions: Turn button off
Second one triggers when button is turned on → Condition: Light is On → Actions: Turn light on → Actions: Turn button Off

So now when you press button once either one activates depending on status of the light. It is important to turn button off to get this working after every action. If you turn button on from HA then there is small hiccup until button is switched off.

2 Likes