How to use RC522 and Aqara door/windows sensor or Nodemcu to arm o disarm system alarm?

I’m using AlarmSystem a Home Assistant apps based on AppDaemon https://github.com/runningman84/home-assistant-apps

Usually I use my android phone and device_tracker function to track presence and arm or disarm automatically the alarm.
But although I have double check both wifi and bluetooth and have configured a pending time of 45 seconds, sometimes home assistant does not detect my smartphone in time and activates the alarm.

I’m looking for a low-cost alternative method for recognizing authorized people to turn off the alarm without using a smartphone or acting directly on the home assistant interface.

A solution could be to use a badge and a RFID reader and a Xiaomi Aqara door/windows sensor hacked inserted in a wall electrical box after entered in the apartment to send a signal to HA for arm or disarm AlarmSystem.
Has anyone already tried?
The alternative is to use a NodeMCU flashed with Tasmota firmware instead of Xiaomi Aqara door/windows sensor

mifare-rc522-card-read-antenna-rf-rfid-reader-ic-card-proximity-module

Have you thought about other more effective and secure methods?

Well, I’m somewhere near that question too !

Right now, I have several IPCam controlled through ZoneMinder, well integrated into HA, a Xiaomi gateway with sensors on all openings and motion detection, and a device tracker based on network presence.
The alarm is set when our smarphones get out of the range, with a 10mn delay. In this state, I’m getting alarms by mail only when there are too many zoneminder events. Gateway sounds when a window is opened.
During the night mode (after 11pm and no inside motion for 15mn), ZM is armed on outside cameras and window/door sensors.

Second step is that, when away for more than 12hours AND the day is holiday (official or personal, based on caldav component), HA enters an “away” mode that will start some alarms (sound, light…) when anything happens : inside motion, door/window open, ZM motion trigger. Alarm is also sent by SMS.

Now I’m looking for a way to arm/disarm the second step alarm, at the user’s choice. Because, as you experienced, when coming back home, there can be some time before smartphone gets connected to the network and also because it’s a pain to find the right presence detection mechanisms on a daily basis to arm the alarm automatically. And I have a dog at home, being enough an alarm when left alone but also being detected (xiaomi motion and cameras…).

I see 3 security principles and applications :

  • “something you are” : face recognition, fingerprint… Checked the Xiaomi door lock with fingerprint, code and nfc, but it doesn’t seem to integrate in HA and to fit every door. Besides, I’m reluctant to change the (secured) locks of the home with some device that could be hacked.

  • “something you know” : some kind of password. I’m planning to add an on-wall tablet with HA in kiosk mode, mostly to control thermostat and some lights. Then I can add a password entry (customUI tiles ?) to control functions. When a kid comes home, he’ll have a personal code disarming a part of the alarm (but keeping the perimetrical ZM control for instance). When a parent comes home, their code disarm the whole system. And there’ll be a master code too. Nice, but what’s the point of automation if you have to enter codes ? And still, the tablet would be in a room, while I can enter the house at several doors (garage…)

  • “something you have”: Device tracker and something else. I thought using a door sensor, without even hacking it, may be a way. You can put as many magnets as house occupants somewhere near the entry door, and everyone will have his door sensor in his pocket, sticking it to the magnet when arriving. I’m not sure the sensor will be correctly included when arriving (and I’m sure there’ll be a problem if the gateway restarted while sensor was away). So the other way around is possible : hide a sensor outside and give a magnet to anyone. Of course, any magnet will do, so the sensor has to be hidden.
    There is also the Broadlink SC1 alarm system, that is now integrated in HA, it has a remote control. I guess you also have the Xiaomi Gateway, so you might not want to add another system in your installation.

Hi Mister_Slowhand,
I’ve a similar configuration with StstemAlarm with arming function based on presence with device_tracker with smartphones in house, the alarm is armed at 23 in “home” mode (only perimetral door/windows sensors if device_tracker detect people in house), and the “away” mode is armed 5 minutes after any smartphone isn’t detected in home network (wifi and bt) and any movement are detected by human body sensor in house.

The problem is that device_tracker often is slow to detect when my wife enter in apartment.
So I need a solution to disarm system alarm manually.
Your solution with magnets is not secure, anyone can have a magnet to disarm system.

Initially I had thought to use a xiaomi smart switch hidden in a drawer of the cabinet of the entrance but of course this system if discovered is usable by anyone … and I left it alone.

xiaomi_wifi_switch

The Broadlink SC1 is only a switch like the Sonoff Basic.

At the moment the only practical and low cost solution seems to use a rfid RC522 reader and use the electronics of a xiaomi aqara door / windows sensor (which transmits via zigbee) or alternatively a Nodemcu flashed with Tasmota MQTT firmware (which transmits via wifi).
These components cost very little and are so small that they can be placed inside a box for electrical switches.

The problem is that I do not find any tutorial to build it with the xiaomi door / windows sensor … while for the Nodemcu there are many ideals on the net.

This solution seems more functional because I can use different badges, also programming different functions. For example, I could give one to the housekeeper, it could only work on Monday from 10 am to 2 pm, while my wife badge disarm always the alarm system.

Sorry, S1C is the Broadlink gateway with remote control…
(I have SC1, they’re great and inexpensive, but seems like Broadlink marketing could improve their naming !! :stuck_out_tongue:)

The hidden button is the same as the hidden sensor, just a bit more obvious. You can improve by defining a pattern (ex. 3 press in 5 seconds and none for the next 5) but still, like the wall panel, this force just one entry in the house.

obviously… the best solution for me is to use an RFID reader with Nodemcu… and this is what I’m trying to make sure that not everyone can turn off the alarm but only the people who have the badge
but… how I can do it?
If I flash Nodemcu with Tasmota firmware … how I can do to communicate with RC522?

1 Like

Hi! You’ve prob’bly seen this one, but anyway… https://www.youtube.com/watch?v=ENMul9eAB00