Hello
SM Gardenia is analog sensor from 0 to 1023. And it’s working
I make trigger from analog input on ESP8266
when value is 570 must send me email. but no email
is the trigger counter incrementing?
Where is trigger counter ? How to check it ?
Min 0
Step 1
Value 570
Max 1023
Unit nothing selected
go to My Triggers
page. Under the trigger there is
Last ran 10/2/18 5:27 PM
Ran 4 times
where Ran
shows the number of times the trigger has run.
Ran 0 times
I have the same situation with Arduino uno with analog input. And trigger is not working too
can you private message me your account eamil address
Thanks
shramik_salgaonkar
everything is working good now. Sending correct data to Cayenne is important
1 Like
// Hire is the code for soil Moisture with analog sensors - readings from 0 to 1023 ,
// the higher the value, the drier it is
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneMQTTEthernet.h>
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "****";
char password[] = "****";
char clientID[] = "****";
#define SensorPin0 A0
#define SensorPin1 A1
float senValtemp0 = 0;
float senValtemp1 = 0;
float senVal0 = 0;
float senVal1 = 0;
unsigned long lastMillis = 0;
void setup()
{
Serial.begin(9600);
Cayenne.begin(username, password, clientID);
}
void loop()
{
Cayenne.loop();
for (int i = 0; i <= 100; i++) // read 100 data from sensors and send average
{
senValtemp0 = senValtemp0 + analogRead(SensorPin0);
delay(2);
senValtemp1 = senValtemp1 + analogRead(SensorPin1);
delay(2);
}
senValtemp0 = senValtemp0/100.0; // average data
senValtemp1 = senValtemp1/100.0;
senVal0 = 100 - ((senValtemp0/1023 ) *100 ) ; // make in % and opposite
senVal1 = 100 - ((senValtemp1/1023 ) *100 ) ;
//Publish data every 1 min (1 sec = 1000 milliseconds).
if (millis() - lastMillis > 60000) {
lastMillis = millis();
//Write data to Cayenne
Cayenne.virtualWrite(0, senVal0, "soil_moist", "p");
Cayenne.virtualWrite(1, senVal1, "soil_moist", "p");
}
}
you need to use the correct data type for each widget.
hello, in my triggers counter is Run up when it nidet, but e mail is don’t coming to me?
you might hit the trigger limit. have a look at this topic Sending MQTT messages within notification limit