An Even Better Way to Create a Security Alarm With The Aqara Hub!

IMPORTANT NOTE: It’s come to our attention that this alarm automation is not working for some people, and is for others. This seems to be down to an issue with Aqara’s Cloud servers, so it’s best to not rely on this method until these issues are fixed – and ultimately, if you shouldn’t rely on this as your only alarm setup if it’s something you need for security, as it’s not currently as reliable as a fully professional alarm system.

A couple of weeks ago, we posted a method of using the Aqara hub as an alarm system, and although it works, it was a little long-winded. Well, we always like to take advice and get help whenever it’s offered, and Mariusz from Sweden (although he’s Polish) has shared a really, really simple way to create an alarm automation that not only gives you the classic ‘ook-ook’ car alarm sound for arming and disarming, but also pushes a notification to your phone, so you know the whether the alarm is armed or disarmed. So, we’d like to share it here…

So for this automation you’re going to need;

  • The Aqara HomeKit-enabled Hub
  • an Aqara Door/Window Sensor
  • An Aqara Wireless Mini Switch, or any other compatible Aqara or Mijia switch you have available

The whole process involves creating an automation for the alarm to be armed or disarmed, an automation for the mini switch to arm and disarm the alarm and a final couple of automations to push a notification to your phone so you know the state of the alarm itself.

One important thing to note is that whilst the automations are created using the English app, some of the terminology used in the Aqara app isn’t grammatically right and can be confusing, so bear with it.

Starting with the alarm first;

  1. We create an automation by clicking on the ‘Automation’ tab at the bottom, and the clicking the plug button at the top. We’re going to make it so that the Aqara door sensor is triggered by the door opening, it will send a signal to the Aqara hub to trigger an alarm after 1 minute has elapsed – you do need a bit of time to disarm the alarm yourself once you get it, right?
  2. Click on ‘Add’ in the IF section
  3. Select your Aqara door and window sensor from the list of devices
  4. Choose ‘Opens’ from the next list of options
  5. You’ll then return to the ‘IF THEN’ section
  6. Click on ‘Add’ in the THEN section
  7. Now when adding stuff here, we’re going to add more than one device or action, so…
  8. First, select ‘Push Alarm Notifications’, then click next to ‘Push Alarm Notifications’ which results in a tick mark appearing, then click ‘save’
  9. You’ll return to the IF THEN section, but we’re going to add another couple of things.
  10. Click on ‘Add’ in the THEN section again, then select ‘Delay’ and select the time you require before the alarm actually goes off – I’m going with 1 minute.
  11. You’ll return to the IF THEN section once again, so for the final time, click on ‘Add’ in the THEN section
  12. Select your Aqara Hub, then on the next page select ‘Play alarm sound’ , choose the preferred alarm sound and desired volume via the slider at the bottom of the screen and then click OK
  13. Click ‘save’ and name your alarm as appropriate – in my case ‘Apartment alarm’
  14. Once you’ve saved this automation, you it listed with an orange ‘shield’ icon.

This all sets up the alarm itself, so now onto the arm/disarm mechanism

  1. While still in the Automations page, Click on the plus symbol and ‘Add’ in the IF section
  2. Select your Aqara Switch from the list of devices – Aqara Mini Switch in my case
  3. Select Single press for your action (or a different action if you prefer)
  4. Once you’ve selected your press action, you’ll go back to the IF THEN section, so now click on ‘add’ in the THEN section
  5. Scroll down until you see the alarm automation you previously created – ‘Apartment Alarm’ in my case
  6. Then select ‘open/close’. This will allow you to use just the one action to both arm and disarm the alarm.
  7. Click save and name this automation.

Once you’ve done this, you can simply test this by pressing on the Mini Switch. You’ll hear a single ‘ook’ sound to tell you that the alarm is armed, and if you press it again, you’ll hear a double ‘ook’ sound to let you know the alarm has been disabled. Its important to note however, that there seems to be a bug in the software that sometimes makes the first click of the button not register, but if you press it again, you’ll hear the ‘armed’ sound, and subsequent presses will register as expected

What you have here works perfectly well and you don’t need to do any more, but if the final part is getting push notifications to your phone so that you know what state the alarm is in, if for example you’re not actually at home to hear the confirmation sound from the hub.

  1. Go into the Automations section by clicking on the Automations tab and click on the plus icon as before.
  2. click on ‘add’ in the IF section and scroll down to choose the alarm automation you originally created – in my case ‘Apartment Alarm’
  3. Select ‘Open the moment’ (this is the bit where grammar is a bit confusing)
  4. You’ll then go back to the IF THEN section. Click on ‘add’ in the THEN section
  5. Select ‘Push notifications’ – this will send a notification every time you arm the alarm
  6. Click ‘save’ and then name it to save this automation – in my case Alarm Armed
  7. You then repeat steps 2 – 6, to create a separate ‘push notification’ but in this case instead of choosing ‘open the moment’ you select ‘Close the moment’
  8. This will send a push notification to let you know the alarm has been disarmed

So this final part makes sure you get your notifications when the alarm is armed or disarmed, along with the audible sound from the Aqara Hub.

Simon T Bramley

Editor - Musician, graphic designer and HomeKit aficionado, living in Taipei, Taiwan.