- #16 Best Toners ever 2020-08-08
- #15 Eletronics Stuff 2020-08-05
- #14 Create SSH Reverse Tunnel in rapid way, reliable and programmaticaly 2019-08-08
- #13 Automate, silence smartphone at work 2019-07-07
- #12 Control your lights without sonoff or other things 2019-06-06
- #11 Google Home and IFTTT, turn on the stove 2019-05-05
- #10 Google Home Hack, send voice programmaticaly with Python 2019-04-04
- #9 Google Home Hack, hidden REST API 2019-03-03
- #8 1.05 A quick WebApp for your thermostat 2019-02-02
- #7 Root for my Huawei P8 Lite 2017 PRA-LX1 2019-01-01
- #6 1.04 Relais board and Thermostat script 2018-12-12
- #5 1.03 Reading the DS18B20, prepare some libraries 2018-11-11
- #4 1.02 Use temperature sensor DS18B20 2018-10-10
- #2 1.01 Initially setup your RaspberryPI 2018-09-25
- #3 1.00 The Silvano idea – the beginning 2018-09-23
- #1 Welcome 2018-09-21
Google Home and IFTTT, turn on the stove
In this post we can view a method for turn on the stove. It’s very comfortable and futuristic send command by voice to the stove… 😉 For make this things you have to knok the IFTTT service. Do you know? The website is http://www.ifttt.com/\" target=\"_blank\" rel=\"noopener\" title=\"\" style=\"box-sizing: border-box; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: "Open Sans", serif; font-size: 15px; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38); letter-spacing: normal;\">http://www.ifttt.com.
How works IFTTT?
IFTTT works in this way. First of all, login and subscribe with your Google Account. In this way your Google Home is automaticaly recognized. Now you have to create your first Applet. One Applet is composed by 2 parts…. the input or “This” part, and the output or the “That” part. In “This” part (the input) you have to select the service Google Assistant. Now I selected “Say a simple phrase” and i write “Turn on the stove” (realy I’m italian and I write “Accendi la stufa”).
In the second part, the “That” part, I select the service WebHook… that is a method for call a URL…. Most probabily you have just understand that we call a URL in our raspberry… we call an API like we saw in this post http://www.gioexperience.com/1-05-a-quick-webapp-for-your-thermostat/index.html\" title="http://www.gioexperience.com/1-05-a-quick-webapp-for-your-thermostat/index.html\" target="_blank">http://http://www.gioexperience.com/1-05-a-quick-webapp-for-your-thermostat/index.html\" title=\"\" style=\"box-sizing: border-box; border: 0px; font-variant: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38);\">https://www.gioexperience.com/1-05-a-quick-webapp-for-your-thermostat/
I have a static IP in my home… but if you don’t have a static IP you can resolve using a DinamycDNS… I suggest https://www.duckdns.org/\" title="https://www.duckdns.org/\" target="_blank">https://www.duckdns.org/\" target=\"_blank\" rel=\"noopener\" title=\"\" style=\"box-sizing: border-box; border: 0px; font-variant: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38);\">https://www.duckdns.org/
In my case, the url is http://xxx.xxx.xxx.xxx/api/ifttt/?key1=stufa&key2=accendi&token=xxxxxxxxxxxxxxxxx
Obviously I inserted xxxxxxx for my privacy.
Now, when I say “Turn on the stove” to my Google Home, IFTTT website calls the URL, and the script turn on the stove!
Now, you can write another Applet for TURN OFF the stove.
Use your script controlled stove
Obviously this post is based on the other post in this website where we make a stove controlled with a raspberry 🙂
Look at this posts
http://www.gioexperience.com/initially-setup-your-raspberrypi/index.html\" style=\"box-sizing: border-box; border: 0px; font-variant: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38);\">1.01
http://www.gioexperience.com/use-temperature-sensor-ds18b20/index.html\" style=\"box-sizing: border-box; border: 0px; font-variant: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38);\">1.02
http://www.gioexperience.com/1-03-reading-the-ds18b20-prepare-some-libraries/index.html\" style=\"box-sizing: border-box; border: 0px; font-variant: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38);\">1.03
http://www.gioexperience.com/1-04-relais-board-and-thermostat-script/index.html\" style=\"box-sizing: border-box; border: 0px; font-variant: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38);\">1.04
http://www.gioexperience.com/1-05-a-quick-webapp-for-your-thermostat/index.html\" title="http://www.gioexperience.com/1-05-a-quick-webapp-for-your-thermostat/index.html\" target="_blank">http://http://www.gioexperience.com/1-05-a-quick-webapp-for-your-thermostat/index.html\" style=\"box-sizing: border-box; border: 0px; font-variant: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-style: inherit; font-weight: inherit; outline: 0px; vertical-align: baseline; color: rgb(38, 38, 38);\">1.05
The API in Raspberry
In my raspberry I created a file ifttt.php dedicated for receive commands from IFTTT. In this way I can control all voice commands.
This script is almost this
<?php include(*****/init.php\"); if( $_GET[\"key1\"]==\"stufa\" ) { $json=json_decode(file_get_contents(\"http://127.0.0.1/api/temperature/\"),true); if( $_GET[\"key2\"]==\"accendi\" ) { if( $json[\"statoStufa\"]==1 ) die(); //imposta le soglie come piu alte della temperatura attuale. $t0=ceil($json[\"t0\"])+0.5; $t1=ceil($json[\"t1\"])+0.5; } if( $_GET[\"key2\"]==\"spegni\" ) { if( $json[\"statoStufa\"]==0 ) die(); //imposta le soglie come piu basse della temperatura attuale. $t0=floor($json[\"t0\"])-1; $t1=floor($json[\"t1\"])-1; } file_get_contents(\"http://127.0.0.1/api/temperature/?op=set&soglia0=$t0&soglia1=$t1\"); }
You can see that in the first case, “accendi” or “turn on”, the script write a thresold temperature higher than current temperature. In the second case, “spegni” or “turn off”, the script write a threshold temperature lower that current temperature.
I use this script and this way almost from 6 months and it’s comfortable and very usefull. : )