With your purpose “light on and off every 10 seconds”, your rule can be :
rule “SonOff_152”
when
Time cron “0/10 * * ? * * *”
then
if (SonOff_152.state == ON) {
SonOff_152.sendCommand(OFF)
}
else
{
SonOff_152.sendCommand(ON)
}
end
With your purpose “light on and off every 10 seconds”, your rule can be :
rule “SonOff_152”
when
Time cron “0/10 * * ? * * *”
then
if (SonOff_152.state == ON) {
SonOff_152.sendCommand(OFF)
}
else
{
SonOff_152.sendCommand(ON)
}
end