Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
Jay Ess 5
I have a scene which is triggered by a sensor on movement does this. while it all works nicely the issue i have is if the timer is interupupted the scene starts counting again and this throws an error as this:
[02.01.2022] [17:12:49] [ERROR] [SCENE109]:
What would be a better way to run this kind of countdown which would allow a restart from the begining without throwing this error?
for k,i in ipairs(GroupToiletOn) do
if fibaro.getValue(i, "state") == false then
fibaro.call(i, "turnOn")
end
end
--run timer for light
safeTime = 0
maxTime = SwitchOffImeDelay*60
while safeTime < maxTime do
fibaro.sleep(1000)
safeTime = safeTime + 1
--fibaro.debug("Scene109", "Timer for Toilet light - "..safeTime.." of "..maxTime.." seconds.")
end
--switch off light
for k,i in ipairs(GroupToiletOff) do
if fibaro.getValue(i, "state") == true then
fibaro.call(i, "turnOff")
end
end
Link to comment
Share on other sites
20 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.