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
chaicka 195
Hi,
I am trying to write a piece of script to determine the 'time since last breached' of motion and door sensors.
If the 'time since last breached' is more than 1 hour (3600 mins), it will set variable to be 'Away'.
If the 'time since last breached' is more than 24 hours (86400 mins), it will set variable to be 'Vacation'.
The current script I wrote seems to always meeting the 'Vacation' criteria. I found that the formula "(os.time() - fibaro:get(motionSensorID, "value")) always result in 1453051047 seconds and higher.
Please login or register to see this code.
Is the formula to determine 'time since last breached' wrong? If so, what is the right command or formula to use?
Please login or register to see this code.
Thanks for helping.
5 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.