IoT Silent Door Alarm

I have an elderly family member who is probably in the early stages of dementia and is leaving the apartment at random times. It has been hard for his family caregiver to keep track of when he leaves and was hoping to set up a silent alarm system.

So far, I managed to set up a NodeMCU and connect it to a reed switch:

I am able to connect to my wifi network, and the switch is being recorded (in the serial monitor). I’m getting stuck at the sending the alert somewhere. I tried creating an IFTTT applet connecting a webhook to either an email or slack message with no luck. I was using this walkthrough for guidance which uses the IFTTTwebhook library.

Any other ideas on how to send an alert message to the caretaker’s phone from the NodeMCU? A novice friendly solution would be nice also.

Thanks in advance!

1 Like

Can the NodeMCU host a website? The phone could browse to the website where it gets a javascript script that runs in the web browser on the phone and polls the website for the door status. If it ever sees a change in door status or if it cant reach the website, it shows an alert on the phone. You probably want to add some robustness features to make it as reliable as required.

You could even have multiple devices polling the same door switch, from anywhere on the internet.

Yes! That’s a good idea. You can run a local website once it connects and has an IP address. I can start looking into that. I’m guessing I need port forwarding (?) to get alerts when the caregiver is not home on the same network?

Ugh started to do some more digging on this idea and Apple, yet again, puts a kink in things. The caregiver has an iPhone and web push notifications are not yet possible on iOS. Apparently this has been a long standing request by developers. Maybe this will be the year?

I dont thing you need push notifications - you just need the phone to keep runninng the javascript - the script itself can post a dialog on the phone (but maybe cant bring the browser to the front? Not sure about that.)

Yes, you need the phone browser to get through the router or whatever in the residence, if you are trying to monitor from outside.

Thanks @jwintour! I found another IFTTT library which I will try. I’m thinking the push notification will be needed when the phone isn’t actively open to the web browser. Will update here if successful!

1 Like

Do you still require assistance here? Our team can help set this up for you otherwise.

1 Like

Yes that would be wonderful if you could help. I just replied to your message and we can chat further…

1 Like

Sending a text depends on a whole bunch of things that a NodeMCU might not be able to handle. Sometimes it even depends on the cell provider. The guaranteed-to-work-but-not-inexpensive way to get texts out is to use a cellular board like the Particle Electron / Boron and a $3/month data cell plan.

1 Like

We found a way around it! Shout out Hedgehog for the help. The NodeMCU connects to the home’s wifi network, detects the open door through the reed switch, and sends the state change to via MQTT. From there IFTTT can send the Adafruit data to email, Twillo, slack, IFTTT notification, etc. It seems to be working pretty well for now. Now working on the power part…


Good news - we have completed the documentation for the IoT door sensor alarm. Please find the instructions in Dropbox and the code in Github. This was a fun project and we’re glad to have been able to support!