08.03.2023, 11:21
Hello,
I am using event script to control auto/manual function for heating system.
If the users set manual, it will turn the auto after the entered time. But I have two question;
1- How can I stop the timer if user set the auto before the entered time expires?
2- How can I retrigger the delay time if the user set auto before the entered time expires and then set manual with new time?
Thanks.
The event script is;
I am using event script to control auto/manual function for heating system.
If the users set manual, it will turn the auto after the entered time. But I have two question;
1- How can I stop the timer if user set the auto before the entered time expires?
2- How can I retrigger the delay time if the user set auto before the entered time expires and then set manual with new time?
Thanks.
The event script is;
Code:
--auto/manual status
value = event.getvalue()
--duration of manual in minute
duration = grp.getvalue('33/1/53')
second = duration * 60
if value == false then
os.sleep(second)
grp.write('33/1/55', true)
end