- Posts: 55
- Thank you received: 6
public void Setup()
{
EventHelper.ModuleChangedHandler((o, m, p) =>
{
if (m.Domain == Domains.VIRTUAL && m.Address == "N3S0" && p.Property == "Sensor.Motion" == (p.Value == "1"))
{
// filter when switch on event
if (m.Domain == Domains.VIRTUAL && m.Address == "N14S0" && p.Property == "Sensor.DigitalValue" == (p.Value == "1"))
{
DriverHelper.ProcessCommad(Domains.VIRTUAL, "N14S0", "ControlOn", "");
{
}
}
}
return true;
});
}
Please Log in or Create an account to join the conversation.
/*
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.VIRTUAL && m.Address == "N3S0" && p.Property == "Sensor.Motion"){
// filter when switch on event
ModuleParameter n = ModuleHelper.GetProperty(Domains.VIRTUAL, "N14S0", "Sensor.DigitalValue");
if (p.Value == "1")
if (n.Value == "0")
{
//here are commands to execute in sequence - change commands to suit your configuration
DriverHelper.ProcessCommad(Domains.VIRTUAL, "N14S0", "ControlOn", "");
}
}
return true;
});
}
/*
This code is running periodicaly when program is enabled.
Cron job detirmine running period.
*/
public void Run()
{
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.