Hello everybody, now i’m using dht 22 humidity and temperature sensor, i’ve made some dashboards to monitor microclimate in grow room, but now i want to make an endpoint to get a notification to my email when temperature or humidity will be too high. I’ve tried to use documentation and tutorials of how to use endpoint but nothing seems helped. Sorry for asking this, im just a beginner in arduino
Can someone can help me with the endpoint code? Im adding my code that im using right now
#define _DEBUG_
#define _DISABLE_TLS_
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerWifi.h>
#include <DHT.h>
#define ONE_WIRE_BUS D2 // Data wire is plugged into port 2 on the Arduino
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);// Pass our oneWire reference to Dallas Temperature.
#define USERNAME "xxx"
#define DEVICE_ID "xxx"
#define DEVICE_CREDENTIAL "xxx"
// Define and initialise the sensor
#define DHTPIN D1
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
#define SSID "xxx"
#define SSID_PASSWORD "xxx"
ThingerWifi thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
void setup() {
Serial.begin(115200);
pinMode(BUILTIN_LED, OUTPUT);
thing.add_wifi(SSID, SSID_PASSWORD);
// Define the 'thing' with a name and data direction
thing["dht11"] >> [](pson& out){
// Add the values and the corresponding code
out["humidity"] = dht.readHumidity();
out["celsius"] = dht.readTemperature();
};
sensors.begin();
}
void loop(void) {
thing.handle();
}