- Posts: 111
- Karma: 2
- Thank you received: 12
public void Setup()
{
{
EventHelper.ModuleChangedHandler((o, m, p) =>
{
Console.WriteLine(m.Address + " in program id "+ Program.ProgramId.ToString()+ " property "+ p.Property + " value " + p.Value);
if (m.Domain == Domains.MYSENSORS && m.Address == "N11S3" && p.Property == "Sensor.DoorWindow" && p.Value == "1")
DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOn","");
if (m.Domain == Domains.MYSENSORS && m.Address == "N11S3" && p.Property == "Sensor.DoorWindow" && p.Value == "0")
DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOff","");
return true;
});
}
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
public void Setup()
{
EmailHelper.SetupSmtp("me@gmail.com", "password", "smtp.gmail.com", 587, true);
{
EventHelper.ModuleChangedHandler((o, m, p) =>
{
Console.WriteLine(m.Address + " in program id "+ Program.ProgramId.ToString()+ " property "+ p.Property + " value " + p.Value);
if (m.Domain == Domains.MYSENSORS && m.Address == "N11S3" && p.Property == "Sensor.DoorWindow" && p.Value == "1")
DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOn","");
EmailHelper.SendEmail("me@gmail.com", "tome@gmail.com", "EasyIoT server", "Module Door Open status alarm");
if (m.Domain == Domains.MYSENSORS && m.Address == "N11S3" && p.Property == "Sensor.DoorWindow" && p.Value == "0")
DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOff","");
return true;
});
}
}
Please Log in or Create an account to join the conversation.
int i = 0;
public void Setup() {
EmailHelper.SetupSmtp("me@gmail.com", "password", "smtp.gmail.com", 587, true);
EventHelper.ModuleChangedHandler((o, m, p) =>
{
Console.WriteLine(m.Address + " in program id "+ Program.ProgramId.ToString()+ " property "+ p.Property + " value " + p.Value);
if (m.Domain == Domains.MYSENSORS && m.Address == "N11S3" && p.Property == "Sensor.DoorWindow")
if(p.Value == "1" && i == 0) {
DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOn","");
EmailHelper.SendEmail("me@gmail.com", "tome@gmail.com", "EasyIoT server", "Module Door Open status alarm");
i = 1;
}
if(p.Value == "0" && i == 1) {
DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOff","");
i = 0;
}
return true;
});
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.