Aqara micro button

siclark
Posts: 1974
Joined: Tue Jun 13, 2017 5:08 am
Location: UK

Aqara micro button

Post by siclark »

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":""}
siclark
Posts: 1974
Joined: Tue Jun 13, 2017 5:08 am
Location: UK

Re: Aqara micro button

Post by siclark »

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.
User avatar
FlyingDiver
Posts: 7323
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Aqara micro button

Post by FlyingDiver »

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
CliveS
Posts: 778
Joined: Sun Jan 10, 2016 5:31 am
Location: Medomsley, County Durham, UK

Re: Aqara micro button

Post by CliveS »

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 2532 times
CliveS

Indigo 2024.1.0 : macOS Sonoma 14.6.1 : 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
autolog
Posts: 4000
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: Aqara micro button

Post by autolog »

I set my Aqara Double Switch up as a generic JSON Device and then use different triggers to pick the different payload states. :)
autolog
Posts: 4000
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: Aqara micro button

Post by autolog »

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 2526 times
autolog
Posts: 4000
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: Aqara micro button

Post by autolog »

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 2525 times
CliveS
Posts: 778
Joined: Sun Jan 10, 2016 5:31 am
Location: Medomsley, County Durham, UK

Re: Aqara micro button

Post by CliveS »

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 2500 times
And yes that . in the Multi-States Key is needed!!
CliveS

Indigo 2024.1.0 : macOS Sonoma 14.6.1 : 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
juntta
Posts: 147
Joined: Mon Oct 13, 2014 12:46 am
Location: Finland

Re: Aqara micro button

Post by juntta »

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?
Post Reply

Return to “MQTT”