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

setValue for several dimmers


cashe

Question

Hello, everybody!

I stuck in a problem. I tried to setValue for few dimmers simultaneously with no luck.

Initial:

Please login or register to see this code.

Then I make a loop to set all the values:

Please login or register to see this code.

What could be simpler? But not as it seems...

 

Usually, first few dimmers accept "setValue" command and successfully set up. But few last ones set up the desired level with a big lag (2-20 seconds) or even have no reaction at all.

I thought it is because of z-wave network be overloaded within multiple commands were sent during a short period of time. I tried to make some pause between each fibaro:call

 

Please login or register to see this code.

But it has no effect also.

 

I tried to make an acknowledgment mechanism:

 

Please login or register to see this code.

It helps - all dimmers eventually set up. But regarding debug screen, a number of attempts were needed for some dimmers to setValue. So time to setValue for all 6 dimmers varies from 3 to 20 seconds.

 

So the question is there some method available for setting up multiple dimmers (or any other actors) with values. Something like this:

 

Please login or register to see this code.

So it will be not a number of sequential commands but one "broadcast command" for example?

 

Thanks for helping!
 

 

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi and Wellcome. I can see that you are new to Lua or at least you are struggling with the concept of tables and enumerating them.

 

I highly recommend to read this tutorial, then come back here:

 

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 2 hours ago, petergebruers said:

    Hi and Wellcome. I can see that you are new to Lua or at least you are struggling with the concept of tables and enumerating them.

    I highly recommend to read this tutorial, then come back here

     

     

    Hi, Peter.

    Actually, I'm not a newbie in Lua, as you may seem. If you thought so looking at this:

    Please login or register to see this code.

    do not pay attention to this. It is just as an example of what I mean speaking about "broadcast command".

     

    Do you have something to say on the substance of the matter?

     

    Link to comment
    Share on other sites

    • 0

    :-)

     

    I see. No, I was triggered by the # syntax (nothing wrong with that, but I'd use ipairs).

     

    No, there is no group send command (only "all off" and "all on" but that is a special thing).

     

    Yes, your idea that it's a Z-Wave issue might be correct.

     

    Some questions:

     

    Does it work if you add at least 5 seconds pause between sending commands?

    Did you recently add (and possible remove) a secondary controller? Any controller?

    If you turn several devices on/off from the web ui, do you observe the same delays?

     

    Here is a script that does a "safe send". Can you run it on 2 or 3 of your devices?

     

    It sends 'turnon' instead of multilevel=99 so it works both on dimmers and relays. It will give me an idea of the response time of the devices and if they get status "dead".

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0

    There actually is a very handy group command called fibaro:callGroupAction. See the following post for discussion and examples how to use it

     

    Link to comment
    Share on other sites

    • 0
    3 minutes ago, ReneNL said:

    There actually is a very handy group command called fibaro:callGroupAction. See the following post for discussion and examples how to use it

     

     

    Yes, but it's not magic. Loops over the devices. So, if your version has delays, I expect this to have delays to. If it solves your problems... Well... Then there's some magic going on.

     

    If the delays haven't gone, drop me a note. I'll be available again this evening.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 25 minutes ago, petergebruers said:

    I see. No, I was triggered by the # syntax (nothing wrong with that, but I'd use ipairs).

    That doesn't matter in this case. There no need to go through in order this linear array (a particular case of a table) using ipairs. So I used # instead. Never mind.

     

    34 minutes ago, petergebruers said:

    Does it work if you add at least 5 seconds pause between sending commands?

     

    I never tried to set 5 seconds pause (it is too long, because of light to be on while motion sensor detected a motion, so any lag is unacceptable). I tried to set 1 seconds pause and it worked better than when pause was 200 ms, for example.

     

    Quote

    Did you recently add (and possible remove) a secondary controller? Any controller?

    No.

     

    Quote

    If you turn several devices on/off from the web ui , do you observe the same delays?

    I will try.

     

    Quote

    Here is a script that does a "safe send". Can you run it on 2 or 3 of your devices?

    It sends 'turnon' instead of multilevel=99 so it works both on dimmers and relays. It will give me an idea of the response time of the devices and if they get status "dead".

     

    Thank you, I will try it. Using the "log" value will help with debugging. First of all, I will add log values into my script's debug.

    turnOn will not suites me, 99 levels are just for example only, I'm using different dimmer levels in the real script.

     

    23 minutes ago, ReneNL said:

    There actually is a very handy group command called fibaro:callGroupAction. See the following post for discussion and examples how to use it

    Hah, very interesting command. I never heard about it. I will try!

     

    17 minutes ago, petergebruers said:

    Yes, but it's not magic. Loops over the devices. So, if your version has delays, I expect this to have delays to. If it solves your problems... Well... Then there's some magic going on.

     

    If this command takes into account, roughly speaking, some z-wave network low-level characteristics (network load, queue, mesh structure etc.), it will be much better than a rustic setValue loop. I will try and share the results.

       
    Link to comment
    Share on other sites

    • 0

    Some quick words, I have more time this evening:

    • The sleep(5000) I suggested is for testing only. If you have lots of traffic, I'd say usually things settle down after 5 seconds. It's just a test.
    • I posted the script to get an idea of the delays. It does not matter if you set a specific level or turn on the dimmer. If you prefer different levels, that's entirely possible and you can post the result of your modified version. If you want to adapt the script, to turn it into a kind of "safe send", I'd add a mail command if the device still didn't get an update after the 45 second timer.
    • It's quite possible that callGroupAction has some magic... But don't you agree that your simple for loop on a list of dimmers should work too? I have a few of these loops, device response is < 0.5 seconds... Don't get me wrong, I think it's a good thing to try! And it's great if you want to try this and share the results.
    • What other devices experience delays, when you run your "for" loop?
    • What other devices experience delays, when you use the web interface?
    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...