Aqara Opple may not be the best IoT response to Nintendo Switch, it won’t top the chart for 10 best No Man’s Sky controllers either, but using this light switch as a game controller shows how much fun one can have given more buttons than sense!
I came up with a couple of clever scripts over the years to tackle limited control schemes. I used a single button controller to toggle all devices, or dim, toggle and control the colour of the lights with a single click. All that forced by the number of buttons available on each controller. Now I have buttons for days and more, thanks to Aqara Opple – a ZigBee switch with 24 actions.
Power remote
Aqara Opple is built to control complicated light groups, but it doesn’t have to be used this way. The panel comes with 6 buttons, each one of them has 4 configurable actions:
- Single Click
- Double Click
- Tripple Click
- Hold and Release
It’s ZigBee, so Aqara Opple will run for months on a single CR2032 battery. Speaking of that battery, whoever came up with the procedure (or lack thereof) for changing the battery, should be hung to dry. You have to pop the buttons out with significant force risking breaking the thin panels covering the actual PCB. what’s wrong with the access latch at the back? I’m pleased that the battery on ZigBee gadgets lasts a long time! It is powered by JN5189 IC from NXP, with a rich array of dev pads present which usually indicated a good hacking potential.
Aqara Opple comes with a wall mount. It can be screwed in or glued, but the unit itself sits in the bracket thanks to small magnets. The actual device is much smaller and easier to carry around.
Aqara Opple is Aqara Home exclusive
To my surprise, I was not able to pair Aqara Opple with MiHome hub, Tuya or eWeLink. Looks like this device is compatible with Aqara Home, a new ecosystem which incorporates all familiar Aqara devices from MiHome.
Fragmenting ecosystem of ZigBee devices in the wake of Apple and Google joining the alliance is not something I would expect. The biggest strength of the ZigBee is not being locked to a single ecosystem/manufacturer.
Fortunately, there is NodeRED.
NodeRED: More buttons than sense
If this is your 1st NodeRED and ZigBee rodeo, you can mix and match most of the ZigBee products thanks to CC2531 (and other coordinators). Thanks to this small USB stick, hooking up Aqara Opple is a dream come true, as the device is already supported by ZigBee2MQTT.
I’m not sure yet, what would I need 24 actions for and how I’m going to use this in my automation setup, but I’m almost certain that Aqara Opple will end up embedded into my new desk. I will show you the most interesting use cases in NodeRED and if 24 actions aren’t enough, how to add more actions to a single controller.
I already covered different ways of interacting with various systems so I will simply refer you to individual articles for each action:
- Hold/Release to dim
- Sending messages to Android
- Interacting with Windows computer (EventGhost)
- Making Google Home talk
- Making Alexa do anything you want (and notifications)
- Tasker integration via AutoRemote
- Inching
Infinite buttons*
In case 24 buttons aren’t enough, NodeRED can change the map of the actions on the fly. It’s a really simple concept, an external command (a button, voice command, dashboard switch) can be used to change the current map of all actions linked to Aqara Opple. You could even bind this action to one of the buttons of Aqara Opple.
A minor inconvenience would be lack of direct feedback that would indicate what layout is currently assigned but with some clever automation, you can always have the buttons mapped your way.
I used button_1_triple
& button_2_triple
to iterate between 3 layouts. But you can map fixed preset as well. If you do so, these actions will be disabled from the layouts and permanently assigned to layout changes. To achieve this, simply filter the actions out, and assign 2 iterating functions:
// preset ++
var preset = flow.get("preset");
var presetName;
if(preset < 3){
preset++;
flow.set("preset", preset);
}
else {
preset = 1;
flow.set("preset", preset);
}
switch(preset){
case 1:
presetName = "bedroom";
break;
case 2:
presetName = "office";
break;
case 3:
presetName = "kitchen";
break;
}
//preset --
var preset = flow.get("preset");
var presetName;
if(preset <= 3 && preset > 1){
preset--;
flow.set("preset", preset);
}
else{
preset = 3;
flow.set("preset", preset);
}
switch(preset){
case 1:
presetName = "bedroom";
break;
case 2:
presetName = "office";
break;
case 3:
presetName = "kitchen";
break;
}
Then you can use all other actions to your heart’s content. I’m not sure why would you need over 60 actions, and how you are going to memorise it, but the option is there should you need it. Before I show you what you could do with all these buttons, Let’s add a Alexa/GoogleHome and Android prompt that tells you the current preset.
Amazon Echo (AlexaRemote2)
I mentioned before how AlexaRemote2 replaces IFTTT Pro for Alexa users completely, and it’s pretty much all you need to send the voice feedback to your Alexa enabled speaker (or a mobile phone with Alexa app installed).
Use Alexa Routine node to trigger a speech mode. If you are feeling fancy, you can edit the payload to SSML and make the Alexa whisper instead, I will keep it simple and set the text option to msg.payload
. Now, when I change the preset, Alexa will announce the one, that is active on my Aqara Opple.
Google Home (Castv2)
To achieve a similar outcome with Google Home devices, I need a Castv2 node. I will cover it in detail better at some point, but for the purpose of this tutorial, just know that you have to modify the payload into a JSON format (JSON 5 min tutorial).
This function node will do just that, and Castv2 will make your smart speaker announce the current preset for Aqara Opple.
msg.payload = {
"app": "DefaultMediaReceiver",
"type": "TTS",
"text": msg.payload,
"speed": 1,
"language": "en",
"metadata": {
"title": "Media title"
}
}
return msg;
You could take it further and trigger voice prompts only on smart speakers located in the rooms that correspond to presets instead of spamming all of them. Simply add an IF
statement and take the advantage of the value listed in the presetName
.
Android (Join App)
If you want an android notification, Join app is by far the easiest way to go (plus the app has 100s of other uses!). To send the message, I have to compose the push JSON. I used this website to get URL for the icons (free, but needs account) so if you want to prettify your notification pick the icons you like.
msg.push = {
"title":"Aqara Opple preset",
"text":msg.payload,
"icon":"https://img.icons8.com/cotton/64/000000/warning-shield.png",
"smallicon": "https://img.icons8.com/cotton/64/000000/warning-shield.png"
};
return msg;
When the preset changes, you will get an instant notification on your phone to keep the track of the changes.
No Man’s Sky
In case you wonder how I turned the Aqara Opple into a controller, I created a new preset with AutoRemote to EventGhost action. Commands sent from the remote (mostly hold down/up events) were mapped to corresponding button actions using Keyboard plugin. This way I could emulate the button presses from the wall switch itself.
While latency wasn’t that big, hold and release triggers take about 1 sec to register which introduced a visible delay between my actions and character’s response. Anything that requires a simple button press takes less than half a second to register. It’s not enough for gaming, but sufficient for a viral video or a custom Spotify controller.
Final thoughts
Although the lack of support for MiHome, Tuya and other ecosystems than Aqara Home is disappointing, the seamless work with NodeRED redeems the gadget for me. Everything I play with ends up linked to my automation server so it’s a win in my books. The most important question is: what am I going to do with countless ZigBee buttons? 24 actions (or 18 actions and 6 dimmers) seem like a lot. I created the layouts and named it after the rooms for a reason as if you ever wanted to have a universal remote that works in each room – Aqara Opple could be a very inexpensive option. Let me know what would you do with 24+ actions in this Reddit thread.