IOT with Firebase: Sensor Alert Automated Push Notification to Android App Using Python,FCM, Pusher #Part 5
In this tutorial of IOT with Firebase we’ll create python script for sending automated push notification to end user android app if fire sensor detects any fire which is connected to Adruino NodeMCU ESP8266. We’ll finish up the tutorial with demo of our project in which we will see working of smart led and sensor alert notification, on which we are working from last 4 tutorials.
I hope you enjoy this tutorial. All of the code and a transcript of the video follows the video below.
Transcript / Cheat-sheet :
Installing Required Libraries
Pyrebase is a Python interface to Firebase’s REST API. In layman’s terms, it allows you to use Python to manipulate your Firebase database. The documentation for Pyrebase can be found at https://github.com/thisbejim/Pyrebase
We will install the Pyrebase and its dependencies using pip
sudo pip3 install Pyrebase
Installing Pusher Push Notifications
Push Notifications makes it easy to send push notifications to iOS and Android apps. It takes the hassle out of managing device tokens and interacting with Apple and Google’s messaging services. WithInterestsubscriptions to notify segmented devices in each request and delivery SLAs offered on premium plans, it’s built to scale. The documentation for Pusher Push Notification can be found
The Pusher Notifications Python server SDK is available on PyPi here.
We can install this SDK by using pip:
sudo pip3 install pusher_push_notifications
Python Script Code :
from pusher_push_notifications import PushNotifications import pyrebase