Hello
I am trying to learn how to use the schedule.
Is there a whey to do an “if then” statement in the schedule?
e.g.
If a virtual module has a value of more than 500 (at time of scheduled activity) defer or don’t run schedule.
IanR
Hello
I am trying to learn how to use the schedule.
Is there a whey to do an “if then” statement in the schedule?
e.g.
If a virtual module has a value of more than 500 (at time of scheduled activity) defer or don’t run schedule.
IanR
Hi @IanR,
Yes, scheduler scripts are also a sort of programs and they have access to some APIs. So you should be able to do something like
if($$.boundModules.WithName("Kitchen light").Get().Parameter("Status.Level").DecimalValue > 0){
// act
} else {
// act
}
Also you can run a program as a scheduled action like this: $$.program.Run(programId)
(programId
should be string).
Thanks
I will give it a go.
Ian R