Jump to content

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


  • 0

LUA light script


Fabian78

Question

I am testing with some LUA scripting.
I have my own script for lighting in my hallway. In short:
 
- If Fibaro Sensor (21) sees movement
- Then start the script
- Then the lights must be to 99%
- After 7.5 min (450.000 milliseconds) then
- If SchemerJaNee (Dutch for dusk) = Yes, then dim to 20%
- If SchemerJaNee = No, then turn off
 
The scene works. Sometimes. But all the other scenes (mainly block scenes) aren't working anymore. I think my scene is messing up something, but I don't know what :-)
Can you help me with this??
 
 
DECLARATIONS
 

Please login or register to see this code.

 

ACTIONS

 

Please login or register to see this code.

 

 
 
 
Edited by Fabian78
Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Quote

    What if there is within the 7.5 minutes movement, should the timer reset?

     

    Yes, this would be the best.

    Edited by Fabian78
    Link to comment
    Share on other sites

    • 0

    With a loop like this code

     

    (Did some fast copy paste, didn't test anything)

     

    Please login or register to see this code.

    Please login or register to see this code.

    Please login or register to see this code.

    Please login or register to see this code.

    Please login or register to see this code.

    Edited by SmartHomeEddy
    Link to comment
    Share on other sites

    • 0

    Goodluck

     

    The essence is the while - do loop. It loops 7.5 minutes, but is there is movement, it resets the timer. 
     

    maybe test with one minute ?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Quote

    maybe test with one minute ?

     

    I think that will be a good idea.... ;-)

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Is the Conditions/Triggers still necessary?

     

    Please login or register to see this code.

     

     

    Link to comment
    Share on other sites

    • 0

    Please try to use

    Please login or register to see this link.

    . Could be done very easily.

    In addition you can control your HCL from HC3.

    No more endless block scenes   ?

    Link to comment
    Share on other sites

    • 0
    2 minutes ago, cag014 said:

    Please try to use

    Please login or register to see this link.

    . Could be done very easily.

    In addition you can control your HCL from HC3.

    No more endless block scenes   ?

    I can assure it is true ?

    Link to comment
    Share on other sites

    • 0
    2 hours ago, Fabian78 said:

    Is the Conditions/Triggers still necessary?

     

    Please login or register to see this code.

     

     


    yes (and also fill in the motion ID in the motion variable in the action)

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Yes. It's works!

    There was one error in the scene, but I made a correction.

     

    Thank you.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Please login or register to see this code.

     

    On 1/7/2021 at 7:45 PM, jorge rintaro said:

    Fabian78, 

    Please login or register to see this code.

     

    I have only one problem...

    When entering a room, a takes sometimes a few seconds before the light goes on. Not always, but sometimes.

    How can I solve this?

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...