Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining an Event for a Thing - Aqara/Xiaomi "WXKG11LM Wireless Mini Switch" #294

Open
chaletbenadam opened this issue Mar 7, 2021 · 0 comments

Comments

@chaletbenadam
Copy link

I am attempting to configure an Aqara/Xiaomi "WXKG11LM Wireless Mini Switch" to toggle a light on and off based on a single click. The device is correctly recognized from the signature string "lumi.remote.b1acn01" and supports the "multi level input property" with four possible values:

  • 1 for a single press
  • 2 for a double press
  • 0 for a long press
  • 255 for release (after a long press)

I have been able to define this device in the zb-xiaomi.js extension file and can build rules based any one of the four values.

The value returned from the device does not change until a different button action is executed, e.g. a single press returns a value of '1' but another single press some time later cannot be detected as the value returned has not changed.

However, I would really like to be able to used a single click to toggle on and off another device rather than having to use a single click to turn on the device and a double-click to turn off the device. If I use value=1 and the present state of the device I am activating (i.e. on/off), the I get the classic flip-flop result reported in issue 694 - and based on the discussion in that posting, I can see that the answer is to use "events" and I can even see that there is code to support "single press", "double press", and "long press" - but cannot see how to define these for my device.

I will keep playing with the configuration, but any assistance on how to define an event would be greatly appreciated.

For information, here is the current configuration of the WXKG11LM:
/*
BACKGROUND READING
Property vs. Action vs. Event
Toggle option for Rules
Flip-Flop Implementation?
*/
'lumi.remote.b1acn01': {
// LUMI WXKG11LM Wireless Mini Switch
// https://www.zigbee2mqtt.io/devices/WXKG11LM.html
// https://github.com/zigbeer/documents/tree/master/zcl-id/clusters/general.md#genMultistateInput
name: 'button',
'@type': ['MultiLevelSwitch'],
description: 'Aqara Wireless Mini Switch',
powerSource: zb_constants_1.POWERSOURCE.BATTERY,
activeEndpoints: {
1: {
profileId: zb_constants_1.PROFILE_ID.ZHA_HEX,
inputClusters: [
zb_constants_1.CLUSTER_ID.GENBASIC_HEX,
zb_constants_1.CLUSTER_ID.GENMULTISTATEINPUT_HEX, // 0x0012 (18)
],
outputClusters: [],
},
},
properties: {
press: {
description: 'Aqara Wireless Mini Switch - vaue returned',
descr: {
'@type': 'MultilevelInputProperty',
label: 'Value returned',
type: 'integer',
enum: [0,1,2,255],
readOnly: true,
},
profileId: zb_constants_1.PROFILE_ID.ZHA,
endpoint: 1,
clusterId: zb_constants_1.CLUSTER_ID.GENMULTISTATEINPUT,
attr: 'presentValue', // 0x055 (81)
value: '',
parseValueFromAttr: 'parseNumericAttr',
},
},
},

@mrstegeman mrstegeman transferred this issue from WebThingsIO/gateway Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant