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

All off / All on


Question

Posted (edited)

Hi

 

I want to generate a schene that switch off all devices (lights + wall plugs).What is the best way to implement this?

 

I have hard time generating an block scene for it quite a clicking.

 

I think the LUA Scene might be the way to go but how to get the list of my device ID:s ? Is Opening the device one by one the only way to do this?

 

 

 

  

Edited by Markoe

8 answers to this question

Recommended Posts

  • 0
Posted (edited)

for lights this should work

 

Please login or register to see this code.

Switches are normally "multidevices", so it might be useful to add as well into the filter line 

Please login or register to see this code.

to get only turned off these which are normally visible in UI

 

 

for wallplugs (if you wish to turn off only wallplugs which has been set as "light", uncomment the line "--properties = { isLight = "true" }"

 

Please login or register to see this code.

the extra sleep is not always necessary

 

Both scripts does not check if device has been really turned off, as this takes some time, but of course can be easily implemented as until loop inside for loop

 

Btw, isTypeOf = "com.fibaro.FGWP" can be as well isTypeOf = "com.fibaro.FGWP101" to turn only old wallplugs, or isTypeOf = "com.fibaro.FGWP102" to turn off the latest zwave plus wallplugs.

 

These debug lines are for test only, it is the best to comment them out after checked out if everything what was supposed to be included got selected by the filter.

Edited by tinman
  • Thanks 1
  • 0
  • Inquirer
  • Posted

    Hi

     

    Thank for your help @tinman . I was only after the quick way the get the list on devicename and deviceid's so i did modify ours code slightly.

     

    I did also try different filter just to better understand the system. :-)

     

    Quote

      fibaro:debug( fibaro:getName(deviceIds) .. ": " .. i )
    --  fibaro:call(deviceIds,"turnOff")

     

    I think it is better to generate an dedicated lua schene for "all off event" with hand picked id:s .

     

    BTW There must be a document  where those fibaro:XXX "fuctions are documented with all possible parameters .

     

     

     

     

     

    • 0
    Posted

    @tinman, would you know an easy way to exclude certain devices? e.g. by roomid?

    Thanks!

     

    • 0
    Posted

    sure, just add into filter roomID = xxx 

    • 0
    Posted

    Hi @tinman, that would include rather than exclude, right?

    • 0
    Posted

    depends how you use it, do something on all minus filtered or do something on filtered

    • 0
    Posted
    On 8/25/2018 at 9:06 AM, tinman said:

    depends how you use it, do something on all minus filtered or do something on filtered

     

    Hi @tinman, the reason for my question was that I now exclude a whole lot of devices in the for loop through if statements. That does not sound very efficient to me, but I lack the experience/knowledge to come up with something smarter. :) See the example below.

     

    Please login or register to see this code.

     

     

    However, I am not entirely sure what you mean with "do something on all minus filtered". Can you tell me what syntax you would suggest based on the above?

     

    e.g. devices 7, 8, 12, 13, 25, 26 and 212 are all in the same room that could be excluded.

    • 0
    Posted

    Would it be possible to filter by the value of the dimmer?

    Say i would ikke to switch off all dimmers where the lightlevel were > 80? or change the level of them.

     

    How do i filter based on the value is it possible?

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