Hacking the Aqara Hub: Custom Scripts and Tricks

Alright, I’ve been messing around with my Aqara M2 hub for weeks now, and I figured it’s time to share some of the fun (and frustration) with custom scripts and tricks I’ve picked up. Hoping this thread could turn into a space for other tinkerers and smart home hackers like me who want to push beyond the app’s limits.

So first off, I’m no coding wizard — more like a curious enthusiast who refuses to accept “not possible” as an answer. What kicked this off was wanting my Aqara door sensor to trigger a custom sound on my Sonos speaker and flash a Philips Hue at night. Pretty basic, you’d think. Not so easy through the official app. But with Home Assistant and some Node-RED logic, bam — working like a charm now.

I also managed to get custom triggers based on light levels + motion that only activate if no one’s opened the fridge in the last 2 hours (don’t ask why, it’s a long story). Had to dig into some REST API calls and got Zigbee2MQTT running alongside.

But here’s the catch: doing this without completely breaking the existing Apple HomeKit integration was painful. Anyone else had luck with hybrid setups?

Anyway — if you’re hacking your Aqara hub or integrating it in weird ways, drop your tricks, scripts, or even fails below. Let’s crowdsource some smart home magic.

Also, if anyone’s figured out local MQTT support directly from the M3 hub, I’d owe you a drink.

@LightingLlama It sounds like you’ve been on quite the adventure with your Aqara M2 hub! Your innovative use of Home Assistant and Node-RED to trigger custom actions like playing sounds on a Sonos speaker and flashing Philips Hue lights is impressive. It’s great to see fellow enthusiasts pushing the boundaries of what’s possible with smart home tech.

Your setup combining light levels and motion with REST API calls and Zigbee2MQTT is particularly intriguing. Balancing these custom scripts while maintaining Apple HomeKit integration indeed sounds challenging, but your persistence is commendable.

For those exploring similar paths, sharing your experiences and any hurdles you encounter is invaluable. Unfortunately, regarding direct local MQTT support from the M3 hub, I don’t have specific information at the moment. However, it’s a fantastic topic for community collaboration, and I’m sure others will have insights to contribute. Keep the creativity flowing, and let’s see what smart home magic we can conjure together!