16.04.2017, 15:25
(This post was last modified: 16.04.2017, 15:27 by PassivPluss.)
Hi
I have another way of running this logic that works perfect for me.
Here is a resident script with 60 seconds interval.
My motion/door detector sends 70%( or 1 in case of on/off object) to the light output(Kjøkken Hvit) and sets timer lys kjøkken to 10(this is the wanted off delay)
Then the first script underneath checks if the object is greater than 1, if it is it subtracts one from the object each minute until the object is 1.
Then it turns of the light.
This script support retriggering as it sets the timer back to the wanted off delay.
In case you want a warning or two step off lightning you could on object =2 or 3 make the light dim down to for instance 20%.
You can put many different light object in same resident script. That is the reason I got three in this one
The first and the third script is only triggering when the house is in nightmode. It dims the light up and down automatically by night and works as a normal switch controlled Zone by day
The second script is the garage that always is on motion detector.
Lykke til
Ruben
kjøkken = grp.getvalue('Timer Lys Kjøkken')
if kjøkken > 1 then
grp.write('Timer Lys Kjøkken', kjøkken - 1)
elseif kjøkken == 1 then
grp.write('Timer Lys Kjøkken', kjøkken - 1)
if grp.getvalue('Scene Natt') == true then
grp.write('Kjøkken Hvit', 0)
end
end
garasje = grp.getvalue('6/2/3')
if garasje > 1 then
grp.write('6/2/3', garasje - 1)
elseif garasje == 1 then
grp.write('6/2/3', garasje - 1)
grp.write('Bryter Rele 3 kanal 6', 0)
end
gang = grp.getvalue('6/2/1')
if gang > 1 then
grp.write('6/2/1', gang - 1)
elseif gang == 1 then
grp.write('6/2/1', gang - 1)
if grp.getvalue('Scene Natt') == true then
grp.write('Sluse 1 Etg Dim', 5)
grp.write('Bad 1 etg Dim', 0)
end
end
I have another way of running this logic that works perfect for me.
Here is a resident script with 60 seconds interval.
My motion/door detector sends 70%( or 1 in case of on/off object) to the light output(Kjøkken Hvit) and sets timer lys kjøkken to 10(this is the wanted off delay)
Then the first script underneath checks if the object is greater than 1, if it is it subtracts one from the object each minute until the object is 1.
Then it turns of the light.
This script support retriggering as it sets the timer back to the wanted off delay.
In case you want a warning or two step off lightning you could on object =2 or 3 make the light dim down to for instance 20%.
You can put many different light object in same resident script. That is the reason I got three in this one
The first and the third script is only triggering when the house is in nightmode. It dims the light up and down automatically by night and works as a normal switch controlled Zone by day
The second script is the garage that always is on motion detector.
Lykke til
Ruben
kjøkken = grp.getvalue('Timer Lys Kjøkken')
if kjøkken > 1 then
grp.write('Timer Lys Kjøkken', kjøkken - 1)
elseif kjøkken == 1 then
grp.write('Timer Lys Kjøkken', kjøkken - 1)
if grp.getvalue('Scene Natt') == true then
grp.write('Kjøkken Hvit', 0)
end
end
garasje = grp.getvalue('6/2/3')
if garasje > 1 then
grp.write('6/2/3', garasje - 1)
elseif garasje == 1 then
grp.write('6/2/3', garasje - 1)
grp.write('Bryter Rele 3 kanal 6', 0)
end
gang = grp.getvalue('6/2/1')
if gang > 1 then
grp.write('6/2/1', gang - 1)
elseif gang == 1 then
grp.write('6/2/1', gang - 1)
if grp.getvalue('Scene Natt') == true then
grp.write('Sluse 1 Etg Dim', 5)
grp.write('Bad 1 etg Dim', 0)
end
end