Hi,
I've a FGS221 where one relay is connected to a light and the other to a fan. I want to turn off the fan 30m after turn off the light.
I did some code but is not working because virtual module is not getting caught on the event change.
When.ModuleParameterChanged( (module, parameter) =>
{
if (module.Is("WC Fan") && parameter.Is("Status.Level"))
{
if (module.Is("WC Fan") && parameter.Is("Status.IsOn"))
{
Pause(1800);
Modules.WithName("WC Fan").Off();
return false;
}
}
return true;
});
However module.Is("WC Fan") never returns true but if I use another node that is not virtual, everything works.
Thanks + BRegards,
Nuno