In case you are using motion on raspberry pi and want to make a notification on
your android phone whenever some motion is detected on camera, please read this.
Go to ifttt and login and create a new applet , in this part select webhook
enter the event name , ilke the front_door_movement and select a notification in that
part, for simple android notification on the phone select the ifttt notification (simple one)
Now go to settings and know your api key for this webhook.
The trigger url for webhook will look something like this.
ifttt.py // run apt-get update & apt-get install python-requests if you dont have requests module on pi
////////
import requests
requests.post("https://maker.ifttt.com/trigger/front_door_movement/with/key/{yourkey}", data="")
////////////
Go to /etc/motion/motion.conf and locate on_event_start event
on_event_start python /home/pi/ifttt.py
uncomment and add this trigger, make sure python file is executable by running chmod +x
try running file first to see if ifttt hook is setup properly.
Now whenever the motion is detected on the camera, this will send an android notification from the ifttt app.
Tested and it works perfectly.
No comments:
Post a Comment