Hi. I set up an Arduino Uno with some sensors and relays for control lights and check temp of a fishtank. I control two types of light with buttons in the app, wich are assigned to digital pins. The buttons work well, I set up Eventor with time rules, for turn on and off the relays but nothing happend (the notification of the event not working too) Here are a screenshot of the app and the Eventor rules:
https://drive.google.com/open?id=1FtNs8XtjXf05L2BR1rNwU7SufCecmESH
https://drive.google.com/open?id=1SMbiJS2PUZI-vD9KCPPD_3m8mW42njXF
and here is the code:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>
#include <SPI.h>
#include <DHT.h>
#define ONE_WIRE_BUS 6 //Data wire plugged to pin GPIO2 (DS18B20 sensor)
#define DHTPIN 7 //Data wire plugged to pin GPIO12(DHT22 sensor)
#define DHTTYPE DHT22 //DHT 22 Change this if you have a DHT11
DHT dht(DHTPIN, DHTTYPE);
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
char auth[] = "Authtoken"; //Put your Auth Token in the Blynk App here
SimpleTimer timer;
void setup()
{
Serial.begin(9600);
Blynk.begin(auth);
sensors.begin();
sensors.setResolution(10); //More on resolution: http://www.homautomation.org/2015/11/17/ds18b20-how-to-change-resolution-9101112-bits/
timer.setInterval(3000, readTemp); //Data reading interval
}
void readTemp()
{
sensors.requestTemperatures();
float floatTempC = sensors.getTempCByIndex(0); //Stores temperature. Change to getTempFByIndex(0) for F.
char t_buffer[15];
dtostrf(floatTempC, 8, 9, t_buffer);
float h = dht.readHumidity();
float t = dht.readTemperature();
Blynk.virtualWrite(0, t_buffer); //DS18B20 temperature virtual pin
Blynk.virtualWrite(2, t); //DHT22 temperature virtual pin
Blynk.virtualWrite(1, h); //DHT22 humidity virtual pin
}
void loop()
{
Blynk.run();
timer.run();
}
Any suggestion? Thank you!