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
tiCeR 0
Hey FIBARO Community,
i started to code my own scenes in lua some days ago and finally finished some automated parts. The script is working well but there is a part i don't know how to fix. I will comment inline so please read the whole topic.
1. Define the motion (ID 102) after the properties to tell the script to act if the value of motion changes
Please login or register to see this code.
2. Define all ID's i want to use in this script
Please login or register to see this code.
3. Time in seconds the lamp should be activated
Please login or register to see this code.
4. Write the motion value to a variable and convert it from string to integer to be able to work with it later
Please login or register to see this code.
5. Check if this scene is already active and stop if its true
Please login or register to see this code.
6. If motion is activated (value is > 0), activate the lamp
Please login or register to see this code.
7. Set the current time to the variable timer and as long as the current time minus the 'timer' is smaller then the 'starttimer' that was set on top, let the script sleep. If there is still movement reset the timer to hold the lamp activated.
Please login or register to see this code.
8. If the difference in seconds is higher then defined on top, disable the lamp again
Please login or register to see this code.
9. End the if and kill the scene
Please login or register to see this code.
Okay this is the script and its working well but?
This is right -> If i activate the lamp on the switch the lamp stays activated and works.
This fails -> If i disable the lamp on the switch the motion sensor does not activate the lamp again if i walk into it.
It looks like the motion sensor still sleeps and i need to wait like 30 seconds before it is working again. I already tried to change some parameters (2,6) on the motion settings but nothing helps me out here. I want that the motion always works and checks and starts the scene also when i disabled the lamp with the switch some seconds before.
I already tried to write another scene that kills the motion scene from above when i turn the switch because i was thinking its still running and can't run twice but it feels for me that the motion needs like 30 - 40 seconds to get back to working.
I really hope you can help me out here.
Greetings,
tiCeR
Link to comment
Share on other sites
13 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.