Welcome to Smart Home Forum by FIBARO
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!
Smart Home Forum by FIBARO Team
Edward Trapp 0
I'd like to share very handy function to check if time is between two other times. This is very useful for example for checking if motion sensor should at this time of day switch warm or cool lights. There are two functions
IsTimeBetween(StartH, StartM, StopH, StopM, TestH, TestM) - which checks if TestH:TestM is between StartH:StartM and StopH:StopM
IsItBetween(StartH,StartM,StopH,StopM) - this one is a wrapper to check against current time of day.
Example of usage with RGBW controller and Motion sensor:
This solution isn't idiot proof so if You put absurd hours You will get absurdal behaviour. It isn't also proof to daylight savings time. Otherwise it works just fine. Function like this should come as a standard in Fibaro API. Hope someday it will.
@Admin - for some reason I couldn't start new topic in crowds solutions so I've put it here.Edited by Edward Trapp
Link to comment
Share on other sites
10 answers to this question
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.