- Posts: 2
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Nanang85 wrote: Hi Friend,
Please advice to make an automation base on time ( clock ). I use raspberry pi 2 as server & arduino + esp12f as client. I want to turn on / off the relay base on time, such as @ 8.30 relay off & @ 17:30 relay on every day. Can i use cron?
I follow the tutorial scene control to turn off all relay. But i cannt use it or i dont know its work. Here is my code :
turn off
cron name : 30 8 * * *
code
*
This code is running one time when program is enabled
*/
public void Setup()
{
EventHelper.ModuleChangedHandler((o, m, p) =>
{
// filter digital switch - change module address
if (m.Domain == Domains.ESP8266 && m.Address == "N0S1" && p.Property == "Sensor.DigitalValue"){
// filter when switch on event
if (p.Value == "1")
{
//Console.WriteLine(m.Address + " in program id "+ Program.ProgramId.ToString()+ " driver "+ m.Domain + " address "+ m.Address + " property "+ p.Property + " value " + p.Value);
//here are commands to execute in sequence - change commands to suit your configuration
DriverHelper.ProcessCommad(Domains.ESP8266, "N0S1", "ControlOff", "");
}
}
return true;
});
}
public void Run()
{
}
Please Log in or Create an account to join the conversation.
So like this?EasyIoT wrote: Hi, in Ru function use DriverHelper to switch ON and OFF:
iot-playground.com/blog/2-uncategorised/...-automation-part-iii
Setup function is in this case empty.
Please Log in or Create an account to join the conversation.