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

Combining Multiple Scenes Into One


Question

Guest puma
Posted

Hi I am wondering if there is a way to combine multiple scenes into the one. 

 

At the moment I have a block scene created for every room that has a blind to close at 30 mins before sunset. However they each have their own variable that if the window is open then it won't close the blind. I would like to turn the 9 block scenes into 1 if possible.

 

I have attached two just as a start I just need some help on how to mesh them together.

 

Please login or register to see this code.

 

Please login or register to see this code.

 

 

 

 

 

Please login or register to see this attachment.

Please login or register to see this attachment.

8 answers to this question

Recommended Posts

  • 0
Posted (edited)

Something like this (don't have an HC2 anymore)

Please login or register to see this code.

 

You lose the "other" part - running the scene manually - as we don't know what device to close. (we could loop through all devices and close them...)

Edited by jgab
  • 0
Guest puma
  • Inquirer
  • Posted (edited)

    @jgab Thanks this appears to make sense I will trial it.

     

    I have some follow up questions 

     

    Can you tell me is there also a way to remove the global value of "Sunset" now that I am using LUA? essentially I want it to run 30 mins before sunset. 

    To do get my 30 mins before sunset currently this I have created 2 block scenes switching a variable between sunrise and sunset this seems unnecessary now and I feel LUA could possibly do that easier?

     

    Also how do I manage a blind when it has more than two contact sensors or none at all? have a look at the revised code below I have included everything that I would like to control now.

     

     

    Please login or register to see this code.

     

    Edited by puma
    • 0
    Posted

    If you want to trigger the scene at sunset-30 you can use something like

     

    and code like

     

    Please login or register to see this code.

     

    • 0
    Guest puma
  • Inquirer
  • Posted

    @jgab

     

    Thanks for your help however I think this is a little out of my depth.

     

    I have added the timer lua code however I have no idea how to code like that I am very much at the beginner level.

     

     

    • 0
    Guest puma
  • Inquirer
  • Posted (edited)

    This is what I have ended up with and it appears to work.

     

    I did have to make one change and add an addition = just before tSunset as it was throwing an error without it.

     

    Please login or register to see this code.

     

    Edited by puma
    I Fixed it.
    • 0
    Posted
    On 9/10/2021 at 10:24 AM, puma said:

    @jgab

     

    Thanks for your help however I think this is a little out of my depth.

     

    I have added the timer lua code however I have no idea how to code like that I am very much at the beginner level.

     

     

    @puma

    May I suggest to try to use

    Please login or register to see this link.

    , could replace all your scenes in one scene only

    No LUA knowledge required

    • 0
    Guest puma
  • Inquirer
  • Posted
    10 minutes ago, AR27690 said:

    @puma

    May I suggest to try to use

    Please login or register to see this link.

    , could replace all your scenes in one scene only

    No LUA knowledge required

     

    Thanks I wasn't aware of this I will have a look into it. Could save me a lot of stuffing around. I have had the HC2 for a few years now and only starting to get into this coding stuff to run some helpful scenes. 

    • 0
    Posted

    Would definitely recommend @jgab scheduling times or eventrunner.  I am not great with Lua but found it very understandable and easy to learn. Instructions and examples are available and i will never go back to multiple scenes running for times based, global based function etc. Besides having less strain on my cpu  it also allows for clever and easy programming and gives you a better oversight with all events running from 1 scene. I have cut back roughly 20 scenes and incorporated them into one. He also has an emulator to try out the scene while experimenting. I, like many, dont have enough time to really study programming/ lua but it really helps to read a little. Can be very satisfying when you get something up and running and you start to see that your previous scenes can be greatly improved. Good luck..

    • Like 1

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