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: Condition to trigger changes of any device? (off all devices)


Question

Posted

Hello,

 

I use a scene that transmits changes of any value of all devices. I use at the moment the following condition (and ist works)

 

Please login or register to see this code.

 the three points in the center stands for all other devices.

 

Now I have to adopt the scene with every device I add to my network.

 

Is there a possibility to trigger to all devices in one block?

Like this:

 

Please login or register to see this code.

 

The "ID = 000" should stand for any device?

 

Is such a condition possible?

 

Thanks for hints

Oliver

5 answers to this question

Recommended Posts

  • 0
Posted

lol

unfortunately you can't use wildcard or "anyvalue" abbr for handling events from any devices.

it's not possible. it's designed by Fibaro devs

 

alas

  • 0
  • Inquirer
  • Posted

    Hi,

     

    Tanks for the answer. That's a real pity. That would be a very powerful function.

     

    I wonder, how the app developer solve the problem to react very fast on a change of e.g. a switch status? I think it is not the best solution to poll every second the status of all devices?

     

    best regards

    • 0
    Posted (edited)
    6 hours ago, cervicor said:

    Hi,

     

    Tanks for the answer. That's a real pity. That would be a very powerful function.

     

    I wonder, how the app developer solve the problem to react very fast on a change of e.g. a switch status? I think it is not the best solution to poll every second the status of all devices?

     

    best regards

    We typically call /refreshStates for the current HC3 events.

    If  there are no events the call hangs so it  doesn't  take cpu and when it returns events we use some sort of hashtable lookup to decide if it was an event we were interested in. Probably as fast reaction as you can get... Probably not a big difference from the underlying scene mechanism that invokes scenes....

    Edited by jgab
    • Thanks 1
    • 0
  • Inquirer
  • Posted (edited)

    jgab@ thanks for the answer.

     

    Can you give me please a hint how you call the refreshStates from the HC3? That can not work with the REST-API, except you poll in a high frequency.

     

    --Oh, I saw you wrote a QA "EventRunner4". Do you mean, that this QA is calling the refreshStates and not a other device like a SmartPhone-App.  I think I misunderstood this. I guess, that you QA EventRunner4 is not working on a HC3L?

     

    On the other hand the smartphone -Apps can react very fast on events without a special program on the HomeCenter.

    Edited by cervicor
    • 0
    Posted
    On 2/2/2022 at 7:09 PM, cervicor said:

    jgab@ thanks for the answer.

     

    Can you give me please a hint how you call the refreshStates from the HC3? That can not work with the REST-API, except you poll in a high frequency.

     

    --Oh, I saw you wrote a QA "EventRunner4". Do you mean, that this QA is calling the refreshStates and not a other device like a SmartPhone-App.  I think I misunderstood this. I guess, that you QA EventRunner4 is not working on a HC3L?

     

    On the other hand the smartphone -Apps can react very fast on events without a special program on the HomeCenter.

    The smartphone app is supported by the whole FW on the  HomeCenter + Fibaro's servers...

    the refreshStates api react as soon asa there is an event. If you call /refreshStates and there is no events it will hang until there are events.

    So the poll  frequency depends on the frequency of events on the HC.

    For an code example look at 

     

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