Newbie question - I have several temp sensors deployed in my residential properties which I monitor via wigits on the arduino iot website dashboard. I am using ESP 32's and Nano 33 IOT's with a dht 11 to collect the temp/humidity data. I would like to use a webhook function to trigger the IFTTT website to email me an alert when the temperatures are below a certain value - ie 65F/18C.
Is this even possible? It seem simple enough, but all of the example code that I am seeing exports data to google sheets - and I can't see anything in the code that would only initiate a webhook when certain conditions exist, like I am trying to do.
It seems like the Arduino site would have this function readily available since they promote using arduinos to perform functions such as monitoring greenhouses. Unless someone wants to look at streams of data 24 hrs a day, a simple alert when humidity or temps hit certain values seems to be kind of a necessity.
The code i'm using is below:
<CODE/>
float boardHUMID;
float boardTEMP;
#include "thingProperties.h"
#include <DHT.h> #include <DHT_U.h>
#define DHTPIN 8 #define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
initProperties();
dht.begin();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
Another question - if I hypothetically write code on my ESP-32 to turn on an led (wigit) on the arduino IOT site dashboard when the temperature of the DHT-11 sensor is below 18C, and attach a webhook URL (to the IFTTT site) to the "THING" associated with this ESP-32, will this webhook be initiated only when the led comes on - or will the webhook just continuously stream data whether the led is "on" or "off" ?
Theoretically in this scenario, the webhook to the IFTTT site would only generate an email to me when the led is "on"...
I have completed that project, but manually clicking a counter to initiate an email is different than having the webhook initiated by an "if then" command when temperatures are above a certain value. Would you care to take a stab at my next question as to whether the webhook can be initiated only when temperature from the DHT-11 exceeds or falls below a certain value? My experience so far is that the webhook is simply initiated on every change of value or update from the DHT-11 as opposed to when it exceeds a certain value, but I hope to be proved wrong...
@fa20driver
the intended use of the webhook is to get all the data available and then move to an external system to manage them.
we are workin on sending selective data out via webhook and make alarms and notification available.
now, you can implement an alert system in your sketch, detecting when the value exceeds a threshold , and populate a value in the cloud and from IFTT only send emails when that variable is true.
you can also make this threshold value changeable from the Cloud: create a variable called threshold, here you can write the temperature to check.
in your sketch you can read it and check against the temperature read from the DHT sensor.
if it goes up or below you can decide what to do from your sketch.