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

hub.setTimeout() function not working as expected when applied to multiple devices in a single scene


JeroenL

Question

My aim was to clean up some of the scene's I have and group 3 motion sensor scene's, echt triggering a dedicated light. into a single scene using LUA. 

In the below example the triggering to turn lights on by one of the three motion sensors works fine. 

However, the timeout function, which should kick-in 2 min later, only works for the last device turned on. 

 

As an example, I want to use this sequence of events in my staircase, walking up the stairs: 

- Motion triggered on ground floor --> Light goes on        [this works]

- Motion triggered on first floor --> Light goes on             [this work] 

- Motion triggered on second floor --> Light goes on       [this works 

2 min later, light on ground floor should turn off               [this does NOT work] 

2 min later, light on first  floor should turn off                   [this does NOT work]

2 min later, light on second floor should turn of                [this works]

 

I tried 2 different ways of programming this, one option is commented out, but it gives exactly the same results as described above. 

It appears that the hub.setTimeout function only works on the last device switched on by the scene, if the scene get's activated again, previous " TimeOuts" appear to be forgotten. 

 

Any suggestions? [Making 3 scenes works, but I wanted to move away from that, to clean up the super large number of scenes that are needed otherwise]. 

Thanks all. 

 

Please login or register to see this attachment.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

This will not work. Only one scene invocation can run at a time.

Next time a sensor is breached the previous scene with its setTimeout is terminated, so in effect you will only have the last setTimeout that you setup.

The better way to do this is to make it a QA.

Link to comment
Share on other sites

  • 0
22 hours ago, JeroenL said:

to clean up the super large number of scenes that are needed otherwise

 

If you are eager to reduce the number of scenes, why not use a All-in-one solution, for example like EventRunner? 

Link to comment
Share on other sites

  • 0
43 minutes ago, SmartHomeEddy said:

 

If you are eager to reduce the number of scenes, why not use a All-in-one solution, for example like EventRunner? 

Yes, that would work. The rules in ER would look like

Please login or register to see this code.

 

Edited by jgab
Link to comment
Share on other sites

  • 0
  • Inquirer
  • Dear all, thanks. I suspected this was the case. but thanks for confirming it will not work. I will definitely check out the EventRunner. 

    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...