For the last few weeks, my 4-year-old son has been waking up early and stealing his good behaviour treats from the fridge. I guess he figures it doesn't matter if he gets in trouble for it, as he already ate the treats. Today he ate 4 ice blocks, & my wife suggested I make an alarm.
The alarm notifies via google home when the fridge is open and can be activated and deactivated through by voice. It is based on an esp8266 with a reed switch.
The flow is:
1. IFTTT adds a listener to the Google home, to activate the alarm when the phrase "Hey Google, Set Fridge Security Active/Deactive", webhooks posts a JSON object to a node red webpage on my RPI zero
3. Node red sets a global variable to active/deactive
4. ESP8266 send MQTT message to node red via mosquito, when the reed switch opens
5. Node red listens on the topic, checks the state of the global variable and then pushes an alert to the google home
6. I jump out of bed and save the treats
Details
This is a very simple build, just a couple of hours. I will upload more details later.