For an automation job on the EasyIoT server Cron is used. Suppose you have a door in your house that is normally closed and you want to be alerted immediately when the door is opened (by a magnetic sensor for example). You could make an automation job that sends a certain value to one of your nodes (with a light or buzzer) but because the smallest time frame for cron is 1 minute you could miss that signal if the door is open and closed within that 1 minute. Is there any other way to solve this? I could try to use node to node communication but I prefer that these events are handled by the controller itself.
Found the solution in EventHelper. As soon as the door is opened a message will be send to the node with a buzzer so I will be alerted inmediatly. Still struggeling to get it all right. Nothing to show you right now. The good news however is that it is all there in the EasyIoT server.
Here is my configuration for SMS leak alarm. You do not need cron - it's to slow, use event helper. Code triggers only when event occurs.
/*
This code is running one time when program is enabled
*/
public void Setup()
{
EventHelper.ModuleChangedHandler((o, m, p) =>
{
// bathroom alarm
if (m.Domain == Domains.MYSENSORS && m.Address == "N8S0" && p.Property == "Sensor.Leak" && p.Value == "1")
SmsHelper.SendSms("+386XXXX","Water leak in bathroom");
return true;
});
}
/*
This code is running periodicaly when program is enabled.
Cron job detirmine running period.
*/
public void Run()
{
}