Aqara micro button

Posted on
Thu Feb 20, 2020 3:41 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Aqara micro button

This is a small hand wireless button , approx 3cmx3xm. It recognises 1x, 2x, 3x, 4x clicks. Apparently some models (with same model numberof WXKG11LM) recognise hold, but mine doesnt.

I have this setup in Shims as an On/Off device. The payload is like this

{"battery":100,"voltage":3145,"linkquality":97,"click":"double"}

Putting click as the payload key and leaving On Value blank, I get single, double, triple or quadruple populated in the device custom state of click. I can then create a trigger on the change of status when it equals one of these values.
The trouble is that the click state is not reset, so I have created a delayed action on my Button Topic Component Trigger to send a MQTT message back to the Button with a null click state. This works well.

The message back takes the values from the Indigo device states, so it has the correct values, as per this format.

{"battery":%%d:1473899162:battery%%,"voltage":%%d:1473899162:voltage%%,"linkquality":%%d:1473899162:linkquality%%,"click":""}

Posted on
Thu Feb 20, 2020 3:43 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Aqara micro button

Edit, just seen my log. Do this as a delayed action on a trigger when click has any change. Otherwise it gets in a loop sending back an updated message whenever there is. achange in battery or link quality. Dont do it on the Trigger Component trigger.

Posted on
Thu Feb 20, 2020 3:48 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Aqara micro button

I'm beginning to think there needs to be a GenericSensor type device that just has custom states, no onOffState or ValueState. Because shoehorning these into the two other types is just ugly.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Apr 01, 2020 9:12 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Aqara micro button

siclark wrote:
This is a small hand wireless button , approx 3cmx3xm. It recognises 1x, 2x, 3x, 4x clicks. Apparently some models (with same model numberof WXKG11LM) recognise hold, but mine doesnt.

I have this setup in Shims as an On/Off device. The payload is like this

{"battery":100,"voltage":3145,"linkquality":97,"click":"double"}

Putting click as the payload key and leaving On Value blank, I get single, double, triple or quadruple populated in the device custom state of click. I can then create a trigger on the change of status when it equals one of these values.
The trouble is that the click state is not reset, so I have created a delayed action on my Button Topic Component Trigger to send a MQTT message back to the Button with a null click state. This works well.

The message back takes the values from the Indigo device states, so it has the correct values, as per this format.

{"battery":%%d:1473899162:battery%%,"voltage":%%d:1473899162:voltage%%,"linkquality":%%d:1473899162:linkquality%%,"click":""}


I have just recieved one of these but mine has click = single , double, hold and release !!!
How have you setup the shims as I keep getting

Code: Select all
   Trigger                         Aqara
   MQTT Shims Error                Aqara Button: update unable to convert 'single' to float: could not convert string to float: single


Screenshot 2020-04-01 at 15.39.30.png
Screenshot 2020-04-01 at 15.39.30.png (282.87 KiB) Viewed 2099 times

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Wed Apr 01, 2020 9:28 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Aqara micro button

I set my Aqara Double Switch up as a generic JSON Device and then use different triggers to pick the different payload states. :)

Posted on
Wed Apr 01, 2020 9:32 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Aqara micro button

Trigger to process click:
Screenshot 2020-04-01 at 16.30.05.png
Screenshot 2020-04-01 at 16.30.05.png (71.55 KiB) Viewed 2093 times

Posted on
Wed Apr 01, 2020 9:34 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Aqara micro button

The MQTT Shims device definition:
Screenshot 2020-04-01 at 16.33.06.png
Screenshot 2020-04-01 at 16.33.06.png (173.58 KiB) Viewed 2092 times

Posted on
Wed Apr 01, 2020 11:07 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Aqara micro button

Thanks Jon, now have it sorted with the following for anyone else who gets one, It now shows click=single, click=double but when I hold the button it removes the click= and adds action=hold and action=release.
Just need to sort out my Aqara 2 gang wireless switch which your post should help with and also a 4 key Aqara Opple.


Screenshot 2020-04-01 at 17.55.50.png
Screenshot 2020-04-01 at 17.55.50.png (165.33 KiB) Viewed 2067 times


And yes that . in the Multi-States Key is needed!!

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sun Jan 07, 2024 6:09 am
juntta offline
Posts: 143
Joined: Oct 13, 2014
Location: Finland

Re: Aqara micro button

Thanks autolog & CliveS for your efforts with these Aqara micro buttons. : 8) Got myself one of these buttons to try it out and use it f.ex. with my garage door controller or some extra buttons for lightning.

However, I ran into issue when I needed two single clicks in row - I cant trigger consecutive single clicks. I used identical setup as CliveS. Payload data of two clicks are identical so I guess thats the issue. I've tried triggering with trigger type "MQTT Shims Event" with "Device Updated and State present" and type "Device State Changed" with button device state "action" either "Has any change" or "becomes equal to: click" but no luck.

The latter trigger (Device State Changed) work with different action types though (single, double, hold, release) unless they are ran consecutively. If so they fail to trigger as well.

Any tips to debug or what to try?

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest