22.09.2018, 18:50
I have a event based script, that turns off the toilet light after ten minutes. This is working very well, but I want to control the script so that if we have guests we can turn it on while the guests are here. The Gira tastsensor with three rows are somewhat difficult for everyone to read.
I have created a virtual object thet I can control with a mosaic widget. If I set it to off the script turns off the light after ten minutes. If I set it to on the lights stays on.
Problem is it is not working. Here is the script
value = event.getvalue(0/2/10)
keep_on = grp.getvalue(32/1/4)
if keep_on == false then
if value == true then
os.sleep(600)
grp.write('0/2/10', false)
end
end
I have created a virtual object thet I can control with a mosaic widget. If I set it to off the script turns off the light after ten minutes. If I set it to on the lights stays on.
Problem is it is not working. Here is the script
value = event.getvalue(0/2/10)
keep_on = grp.getvalue(32/1/4)
if keep_on == false then
if value == true then
os.sleep(600)
grp.write('0/2/10', false)
end
end