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

Turn on all wall plugs by auto approx 30 min before sundown


MSB

Question

Is it possible to make a lua which turns on all Fibaro Wall Plugs approx 30 minutes before sundown......and off again at a certain set time like 2330 or so?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Yes, can be done. Here is an example how to turn on 1 device 30 minutes before sunset.

Please login or register to see this code.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Super!

    I looks like it turns on both 5 and id 66 is that right?

    Btw do I put this in HC2 as a virtual device or as an scene?

    Does it get called at startup of HC2 due to beeing %autostart% ?

    Link to comment
    Share on other sites

    • 0
    Super!

    I looks like it turns on both 5 and id 66 is that right?

    Btw do I put this in HC2 as a virtual device or as an scene?

    Does it get called at startup of HC2 due to beeing %autostart% ?

    Yes, in my test scene it turns on both id 5 and 66.

    The %%autostart value is that scene starts when HC2 starts up but do not activate the scene until wanted time has been reached.

    Link to comment
    Share on other sites

    • 0
    Guest GG

    And if you want to make your scene a little bit easier to read, you can write it like this

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Please login or register to see this code.

    Converting scenes from block to Lua creates a lot of unnecessary code.

    Please login or register to see this image.

    /emoticons/default_icon_sad.gif" alt=":-(" />

    Regards

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Yeah I noticed. Damned. Then also the blocks need a better if then else kind of syntax....

    So why would I like this? It seems only to be used for pressing the button manualy and turning lamps on....would never do that. Or does it have any other uses?

    elseif (sourceTrigger["type"] == "other") then

    fibaro:call(5, "turnOn");

    fibaro:call(66, "turnOn");

    end

    Link to comment
    Share on other sites

    • 0
    Guest GG
    Or does it have any other uses?

    Please login or register to see this code.

    I don't think so. I never have that part in my scenes.

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