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
Morcegolas 6
Hello, I have some scenes to control my lights:
Scene 1- If motion is detected, then turn ON light and change Variable = AUTO.
Scene 2- If Variable == AUTO, then change Variable = RUNNING and after 60s ( turn OFF light and change Variable = Manual ).
Scene 3- This is for stoping the Scene 2, If I press a switch, then turn light ON ( because it turned OFF when I press the switch ) and Stop Scene 2 and change Variable = Manual.Scene 4- If motion is detected and Variable == RUNNING, restart Scene 2 ( to restart the 60s timer if motion is detected ).
This is the code of the scenes:
Scene 1:
Please login or register to see this code.
Scene 2:
Please login or register to see this code.
Scene 3:Scene 4:
Please login or register to see this code.
My question is, as I'm really new to Lua, and Fibaro HC2 I want to know if somehow I can optimise this to use less scenes, I think that Scene 2 ( 60s timer ) have to be separated, so I can restart the 60s timer but I can be wrong.
If anybody is in the mood and want to help I'll be appreciated.
Please login or register to see this image.
/emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />Thanks.
Edited to say that I have to remove the Scene 3, I don't now why but that was messing up with all the rest, and with the Scene 4 to restart the timer I can remove the Scene 3.
Please login or register to see this image.
/emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> Edited by Morcegolas2 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.