Howdy all?
I have been using Cayenne for a couple of weeks now. I have tried several digital sensors and they all work. The notifications also work. I have started using a DHT11 temperature and humidity sensor. It works and I can display the temperature on my dashboard. However what does not work are notifications based on this sensor readings. I set a notification to be sent to me whenever the temperature exceeds 80 F. I have not been able to receive any notifications so far even after long periods of time where temperature has exceeded the limit.
I did search the forums but nothing has helped so far. My guess is that notifications based on analog values are not working.
Anybody knows what is going on?
I am including my code below so you can see what it does.
Thanks
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include <DHT.h>
// WiFi network info.
char ssid = “ssid”;
char wifiPassword = “password”;
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username = “cayenne username”;
char password = “cayenne password”;
char clientID = “client ID”;
DHT dht(D2,DHT11);
float tf;
void setup() {
Serial.begin(115200);
dht.begin();
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}
void loop() {
tf = dht.readTemperature(true);
if ( isnan(tf)) {
Serial.println(“Failed to read from DHT sensor!”);
return;
}
Cayenne.loop();
Cayenne.virtualWrite(1,tf,“temp”,“f”);
}