The project helps the user to know the current Room temperature.
Start by saying "Hey Google, What's the room temperature".
IFTTT will notify you by a notification of your current room temperature where you have set the Temperature sensor.
1. Connect the VCC pin of LM-35 sensor to 5V pin of the Bolt device.
2. Connect the GND pin of LM-35 sensor to GND pin of the Bolt device.
3. Connect the analog output pin of LM-35 sensor to Analog input (A0) pin of the Bolt device.
- Make use of the male to female jumper wires to connect the temperature sensor to the bolt module
Type the below command to generate a public URL for a localhost
- ssh -R 80:localhost:PORT_NUMBER ssh.localhost.run
- Replace the [PORT_NUMBER] which you want to use for getting the POST request
A link has been generated: http://saksham-41d7db3c.localhost.run
Step 4: Setup the IFTTT modulesGet the IFTTT app from this link:
- Open the IFTTT app
- Click on create
- Now, we have to set up two things: (If This, Then That)
- Click On If This and search for Google Assistant and Fill the required forms
- Save it.
- Now, click on Then That
- And Then search for webhooks (and set up it by filling required data)
Notice that I have put /temperatureRead after my URL that I have generated It is the python decorator that I'll talk later.
- Save the current module.
- Now, go and create another module to receive the notification
- Same, as the above procedure GoTo create
- Setup If this using webhook and then that as notifications
- In the message, I have chosen value1.
- Now, The IFTTT setup is complete.
Get The IFTTT API key form this link
Click on Documentation to get the API_KEY
Installation(s):
---------------------------------------------------------
Python Installation
sudo apt-get update
sudo apt-get install python3.6
check if the Installation was successful
python3 --version
If correctly installed it will show the python version
---------------------------------------------------------
Flask Installation
pip3 install Flask
To check the Installation
flask --version
It correctly installed it will show Python and Flask version
---------------------------------------------------------
Type the below command to setup an URL for your localhost
ssh -R 80:localhost:PORT_NUMBER ssh.localhost.run
Replace the [PORT_NUMBER] which you want to use for getting the POST request
That's it! We now have an app that listens for a webhook with python and flask.
Once deployed, POST requests made to the endpoint will trigger the respond function.
For example: https://exampledomain.com/webhook.
This is also the URL that you will provide the service that sends the webhook.
---------------------------------------------------------
Running:
---------------------------------------------------------
Perform the necessary Installation(s)
---------------------------------------------------------
Place the main.py and conf.py file in same directory
make an environment variable FLASK_APP which has the value main.py by:-
export FLASK_APP=main.py (Don't put a space)
Then run the app by
flask run
---------------------------------------------------------
setup an URL to listen for requests by:
ssh -R 80:localhost:PORT_NUMBER ssh.localhost.run
Replace the [PORT_NUMBER] which you want to use for getting the POST request
---------------------------------------------------------
Comments