Ligne 100 : | Ligne 100 : | ||
|Step_Title=<translate>Sign in using gmail</translate> | |Step_Title=<translate>Sign in using gmail</translate> | ||
|Step_Content=<translate>Use your gmail to sign in to sheets</translate> | |Step_Content=<translate>Use your gmail to sign in to sheets</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_SelectGmail.png | ||
}} | }} | ||
{{Tuto Step | {{Tuto Step | ||
− | |Step_Title=<translate>Source Code for thonny</translate> | + | |Step_Title=<translate>Configure spreadsheet</translate> |
+ | |Step_Content=<translate>Select all the values you want returned to the spreadsheet, along with the path the sheet has to follow in your drive</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_Create_-_IFTTT_-_spreadsheet.png | ||
+ | |Step_Picture_01=ESP32___DHT22___IFTTT_Create_-_IFTTT_spread.png | ||
+ | }} | ||
+ | {{Tuto Step | ||
+ | |Step_Title=<translate>Finish applet</translate> | ||
+ | |Step_Content=<translate>Once you have finished all the previous steps, hit continue on the applet page</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_Create_-_IFTTT_continue.png | ||
+ | }} | ||
+ | {{Tuto Step | ||
+ | |Step_Title=<translate>Name applet</translate> | ||
+ | |Step_Content=<translate>Rename the applet to an appropriate name</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_Screenshot_1_14_23__11_24_AM.png | ||
+ | }} | ||
+ | {{Tuto Step | ||
+ | |Step_Title=<translate>Get API key</translate> | ||
+ | |Step_Content=<translate>Select the '''Webhooks''' icon on the finished page</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_If_Maker_Event__esp32___then_Add_row_to_sidharthsandeep17_gmail_com_s.png | ||
+ | }} | ||
+ | {{Tuto Step | ||
+ | |Step_Title=<translate>Go to documentation</translate> | ||
+ | |Step_Content=<translate>Click '''documentation''' on the webhooks page</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_DocumentationWebhooks.png | ||
+ | }} | ||
+ | {{Tuto Step | ||
+ | |Step_Title=<translate>Get API key</translate> | ||
+ | |Step_Content=<translate>Once you get onto this page, copy the api key and URL to paste into the code</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_IFTTT_Maker_Webhooks.png | ||
+ | }} | ||
+ | {{Tuto Step | ||
+ | |Step_Title=<translate>Source Code for thonny (insert api key and URL from previous step)</translate> | ||
|Step_Content=<translate><syntaxhighlight lang="python3" start="1"> | |Step_Content=<translate><syntaxhighlight lang="python3" start="1"> | ||
import network | import network | ||
Ligne 146 : | Ligne 178 : | ||
</syntaxhighlight><br /></translate> | </syntaxhighlight><br /></translate> | ||
|Step_Picture_00=ESP32___DHT22___IFTTT_Thonny__-___Users_sidharthsandeep_DHT22_Code_public_py_____13___6.png | |Step_Picture_00=ESP32___DHT22___IFTTT_Thonny__-___Users_sidharthsandeep_DHT22_Code_public_py_____13___6.png | ||
+ | }} | ||
+ | {{Tuto Step | ||
+ | |Step_Title=<translate>View output in spreadsheet</translate> | ||
+ | |Step_Content=<translate>Go to whichever path you set the spreadsheet to in your drive</translate> | ||
+ | |Step_Picture_00=ESP32___DHT22___IFTTT_IFTTT_Maker_Webhooks_Events_-_Google_Sheets.png | ||
}} | }} | ||
{{Notes | {{Notes |
Auteur Sid | Dernière modification 15/01/2023 par Disisid
Pas encore d'image
Creation
+ pin on DHT22 to VCC on ESP
out pin on DHT22 to GPIO pin 15 on ESP(can change depending on code)
- pin on DHT22 to GND on ESP
Once you are on choose a service, type in Webhooks in the search bar and click Webhooks
- If you already have a webhooks account, skip this step
Otherwise, click the connect button and follow the steps on their website to create a webhooks account
Name the event for the trigger esp32 (it is case sensitive so be careful)
Select all the values you want returned to the spreadsheet, along with the path the sheet has to follow in your drive
Once you have finished all the previous steps, hit continue on the applet page
import network
import urequests as requests
from machine import Pin
from dht import DHT22
from time import sleep
wifi_ssid = "WIFI NAME"
wifi_password = "WIFI PASS"
webhook_url = "https://maker.ifttt.com/trigger/esp32/with/key/<insert api key here>"
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
if sta_if.isconnected() == False:
sta_if.connect(wifi_ssid, wifi_password)
while sta_if.isconnected() == False:
#sta_if = network.WLAN(network.STA_IF)
#sta_if.active(True)
#sta_if.connect(wifi_ssid, wifi_password)
sleep(1)
print(".", end = "")
dht22 = DHT22(Pin(15))
while True:
dht22.measure()
temperature = dht22.temperature()
humidity = dht22.humidity()
temp = temperature * 9/5 + 32
url = webhook_url + "?value1=" + str(temp) + " F" + "&value2=" + str(humidity) + "%"
try:
r = requests.get(url)
print(r.text)
except Exception as e:
print(e, "error")
sleep(30)
en none 0 Draft
Vous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #