Egregius wrote:Quite simple in my pass2php script:
Code: Select all
//Dimmer 50 %
sl($i['mydimmer'],50);
//Wait 120 sek
sleep(120);
//dimmer 100% if dimmer not = off
if($s['mydimmer']!='Off') sl($i['mydimmer'],100);
//wait 2 sek
sleep(2);
//Turn off Dimmer if dimmer not equal = Off
if($s['mydimmer']!='Off') sl($i['mydimmer'],0);
But I'd like to know the purpose of this action...
Perfect - and the sleep will not "freeze" domoticz..? Have read a thread where sleep in Lua will freeze domoticz while it sleep.
I know it dont make sense

But the script is for my light in the kitchen, when i turn off my tv in the evening - it turn on the light in the kitchen (Normaly i dont have any light on when i watch tv, so it is quite dark when the tv turn off.) A kind of "directing light"

But if i turn off the kitchen light when i leave the room, i dont want the script to turn on the light and turn it off 2 sec later.
Hope it make sense - my english is not so good.