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
Barry Kripke 0
(I'm a n00b. Using a Home Center 2)
I have a space where I want any one of three (motion) sensors to be able to switch lights on, and when not more activity has been sense for some time, switch them off.
I'd like to extend it such that the lights only come on between sunset and sunrise.
I have created 4x scenes, 3x Turn On, 1x Turn Off.
The logic I am using is:
I created a Global Variable (called LastOnTime) to track the last activation/on time.
All of the motion sensors trigger a scene that turn the lights on; and set the LastOnTime to os.time() - I have three copies of that scene.
I created one more scene that is triggered off a timer; then if [os.time() - LastOnTime] > 600 turn the lights off.
The scripts are below.
Questions I have are:
----------
The On scenes look like:
Please login or register to see this code.
The Off script looks like:
Please login or register to see this code.
3 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.