[ST Edge Driver]Zigbee Driver for 4-Buttons Linxura smart controller

Hi everyone,

We are trying to apply our product Linxura smart controller to smartthings hub through Zigbee. Device using stm32 chip.

Currently device is able to work with Home assistant(connect with ZHA). device plays as four Zigbee buttons, each button act as press, double press, held. Device also could reconnect to ZHA after power down and power on, whch know as persistent feature.

We are now finish editing the SmartThings edge driver.

Here is the driver for SmartThings hub.


With this driver we could found our device as zigbee four buttons device. And could be add to the Smartthings app through SmartThings hub.

However, We have two issues.

1.There is no reaction on app when press, double press, held triggered on device. We are using IASZONE cluster. This is the Zigbee data log send to HA.

2024-12-10 11:35:18.792 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 12, 10, 3, 35, 18, 792896, tzinfo=datetime.timezone.utc), priority=0, src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xE46A), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=1280, data=Serialized[b'\x18\x02\n\x02\x00\x19\x01\x00\xfe\xff0\x01'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=51, rssi=None) 2024-12-10 11:35:18.793 DEBUG (MainThread) [zigpy.zcl] [0xE46A:1:0x0500] Received ZCL frame: b'\x18\x02\n\x02\x00\x19\x01\x00\xfe\xff0\x01' 2024-12-10 11:35:18.794 DEBUG (MainThread) [zigpy.zcl] [0xE46A:1:0x0500] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x18>(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Server_to_Client: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=2, command_id=10, *direction=<Direction.Server_to_Client: 1>) 2024-12-10 11:35:18.795 DEBUG (MainThread) [zigpy.zcl] [0xE46A:1:0x0500] Decoded ZCL frame: LinxuraIASCluster:Report_Attributes(attribute_reports=[Attribute(attrid=0x0002, value=TypeValue(type=bitmap16, value=<bitmap16: 1>)), Attribute(attrid=0xFFFE, value=TypeValue(type=enum8, value=<enum8.undefined_0x01: 1>))]) 2024-12-10 11:35:18.795 DEBUG (MainThread) [zigpy.zcl] [0xE46A:1:0x0500] Received command 0x0A (TSN 2): Report_Attributes(attribute_reports=[Attribute(attrid=0x0002, value=TypeValue(type=bitmap16, value=<bitmap16: 1>)), Attribute(attrid=0xFFFE, value=TypeValue(type=enum8, value=<enum8.undefined_0x01: 1>))]) 2024-12-10 11:35:18.796 DEBUG (MainThread) [zigpy.zcl] [0xE46A:1:0x0500] Attribute report received: zone_status=<bitmap16: 1>, 0xFFFE=<enum8.undefined_0x01: 1> 2024-12-10 11:35:18.796 DEBUG (MainThread) [zha.zigbee.cluster_handlers] [0xE46A:1:0x0500]: cluster_handler[ias_zone] attribute_updated - cluster[IAS Zone] attr[zone_status] value[1] 2024-12-10 11:35:18.796 DEBUG (MainThread) [zha] Emitting event cluster_handler_attribute_updated with data ClusterAttributeUpdatedEvent(attribute_id=2, attribute_name='zone_status', attribute_value=<ZoneStatus.Alarm_1: 1>, cluster_handler_unique_id='00:80:e1:25:00:8d:ae:ae:1:0x0500', cluster_id=1280, event_type='cluster_handler_event', event='cluster_handler_attribute_updated') (1 listeners) 2024-12-10 11:35:18.796 DEBUG (MainThread) [zha] Emitting event state_changed with data EntityStateChangedEvent(event_type='entity', event='state_changed', platform=<Platform.BINARY_SENSOR: 'binary_sensor'>, unique_id='00:80:e1:25:00:8d:ae:ae-1-1280', device_ieee=00:80:e1:25:00:8d:ae:ae, endpoint_id=1, group_id=None) (1 listeners) 2024-12-10 11:35:18.797 DEBUG (MainThread) [zha] Emitting event zha_event with data ZHAEvent(device_ieee=00:80:e1:25:00:8d:ae:ae, unique_id='00:80:e1:25:00:8d:ae:ae', data={'unique_id': '00:80:e1:25:00:8d:ae:ae:1:0x0500', 'endpoint_id': 1, 'cluster_id': 1280, 'command': 'button_1_remote_button_short_press', 'args': {'button': 'button_1', 'press_type': 'remote_button_short_press'}, 'params': {}}, event_type='zha_event', event='zha_event') (1 listeners) 2024-12-10 11:35:18.797 DEBUG (MainThread) [zha] (ZHADeviceProxy) handling event protocol for event: ZHAEvent(device_ieee=00:80:e1:25:00:8d:ae:ae, unique_id='00:80:e1:25:00:8d:ae:ae', data={'unique_id': '00:80:e1:25:00:8d:ae:ae:1:0x0500', 'endpoint_id': 1, 'cluster_id': 1280, 'command': 'button_1_remote_button_short_press', 'args': {'button': 'button_1', 'press_type': 'remote_button_short_press'}, 'params': {}}, event_type='zha_event', event='zha_event') 2024-12-10 11:35:18.797 DEBUG (MainThread) [zha.zigbee.cluster_handlers] [0xE46A:1:0x0500]: cluster_handler[ias_zone] attribute_updated - cluster[IAS Zone] attr[65534] value[enum8.undefined_0x01] 2024-12-10 11:35:18.797 DEBUG (MainThread) [zha] Emitting event cluster_handler_attribute_updated with data ClusterAttributeUpdatedEvent(attribute_id=65534, attribute_name=65534, attribute_value=<enum8.undefined_0x01: 1>, cluster_handler_unique_id='00:80:e1:25:00:8d:ae:ae:1:0x0500', cluster_id=1280, event_type='cluster_handler_event', event='cluster_handler_attribute_updated') (1 listeners)

Device send the same command to Smartthings hub. But nothing shows on the driver logcat.

Here is the device signature for Home Assistant.
{
“node_descriptor”: {
“logical_type”: 2,
“complex_descriptor_available”: 1,
“user_descriptor_available”: 1,
“reserved”: 0,
“aps_flags”: 0,
“frequency_band”: 8,
“mac_capability_flags”: 128,
“manufacturer_code”: 4311,
“maximum_buffer_size”: 57,
“maximum_incoming_transfer_size”: 2000,
“server_mask”: 11264,
“maximum_outgoing_transfer_size”: 128,
“descriptor_capability_field”: 3
},
“endpoints”: {
“1”: {
“profile_id”: “0x0104”,
“device_type”: “0x0402”,
“input_clusters”: [
“0x0000”,
“0x0500”
],
“output_clusters”:
}
},
“manufacturer”: “Linxura”,
“model”: “Smart Controller”,
“class”: “zhaquirks.linxura.button.LinxuraButton”
}

2、This is the wierd part. When I remove the persisitent feature for device, device could trigger action on SmartThings app. However since I close the persistent feature. device is not able to keep trigger the zigbee command after power down and off. Why open the persistent configure for IASZONE cluster would cause this issue?

Is there anything we missing on drivers and hub?

Looking forward to your replay.

Tagging @nayelyz

For a button?

The IAS Zone cluster defines an interface to the functionality of an IAS security zone device.

This is the Zigbee data log send to HA.

The logcat from the SmartThings CLI would be more helpful. Make sure to add ``` before and after pasted text, like this:

```
type or paste code here
```

This is interesting:

But nothing shows on the driver logcat.

Put a lot of log.info() in your code, especially in the if clause and right on top inside the handler (status). You’d be surprised…

And if there’s really absolutely nothing in the driver log, it’s not even loaded (wrong fingerprint).


I’d try to stay as close as possible to this driver structure:

Fork/branch it, add your device in a sub driver. This way your driver could be easily added as an official WWST device.

1 Like