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

Time Switch with Fibaro Plug


AlexK88

Question

Hallo,

 

i warnt to create a time Switch with the Fibaro Hub on HC2. I Could do it with many scenes, but that’s not nice.

 

6:00 the device should go on for 5 Minutes, then 10 Minutes off, 5 Minutes on, 10 Minutes of, ... til 8:00

16:00 the device should go on for 5 Minutes, then 10 Minutes off, 5 Minutes on, 10 Minutes of, ... til 22:00

 

Thats impossible in my mind with magic or block scenes, because i must create many many scenes. Can I Do this with one LUA scene and variables?

 

I have no more idea. Hope you can help me.

 

Thank you very much.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Hi there

Yes, that works very well with LUA.

You can do that with a "cron" job.

How much do you know programming?

I could send you my main scene, just I think it'll kill you.

Start slowly and create a block scene and then convert it to Lua.

Then you try to understand how it works.

 

Here are some sources of information.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

 

However, I only have some in German (my mother tongue).

 

Greetings Frank

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hello, thank you for your fast reply. In general I am familiar with programming (C, PHP, Python, ...). But with LUA I am not as good as possible.

     

    I think I could understand your Code (after a while). But thank you for the hint “Cron Job”. That’s a nice idea for searching.

     

    I am back if there are more questions ore I have the solution.

    Link to comment
    Share on other sites

    • 0
    1 hour ago, AlexK88 said:

    6:00 the device should go on for 5 Minutes, then 10 Minutes off, 5 Minutes on, 10 Minutes of, ... til 8:00

    16:00 the device should go on for 5 Minutes, then 10 Minutes off, 5 Minutes on, 10 Minutes of, ... til 22:00


    and you could create it with two blockscenes

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Really? I didn’t find any solution to do this with 2 block scenes. Could you share your Idea with me, please?

    Link to comment
    Share on other sites

    • 0

    Add the trigger for 6:00. You can add the first device, turn it on, add the same device, turn it off and use the red (red) delay part, turn the device on with delay etc. etc. Until 8:00 
     

    Here is an example of a holiday blockscene: 

    Please login or register to see this link.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Do you mean in this way (the time is different from the example)?

     

    Please login or register to see this attachment.

     

    Edited by AlexK88
    Found an error, i think now its ok
    • Like 1
    Link to comment
    Share on other sites

    • 0

    Hi there

    Here is a possible example on the fly in LUA

     

    Declaration 

    Please login or register to see this code.

    Action

    Please login or register to see this code.

     

    Greetings Frank

    • Like 1
    Link to comment
    Share on other sites

    • 0
    3 hours ago, FBerges said:

    Hi there

    Here is a possible example on the fly in LUA

     

    Declaration 

    Please login or register to see this code.

    Action

    Please login or register to see this code.

     

    Greetings Frank

     

     

    It only needs to be converted to HC2 format. 

     

     

    9 hours ago, AlexK88 said:

    Do you mean in this way (the time is different from the example)?

     

    Please login or register to see this attachment.

     

     

     

    I think this wil work. Otherwise repeat the on an off cyclus in the blockscene. 

    Link to comment
    Share on other sites

    • 0

    See

    Please login or register to see this link.

    .. two lines and you're done

    Link to comment
    Share on other sites

    • 0

    Hi there

    You may be right about that, but there is still the complete block All in One behind it and how many program lines does it have?

    Here the question was asked how a newcomer can do this.

    It doesn't help much to give such a chunk. I don't think my program snippet is that screaming, but it might help a newbie get started.

    In addition, you don't need a truck to get a case of beer from the beverage market if a small car does too. ?

    Greetings Frank

    • Like 1
    Link to comment
    Share on other sites

    • 0
    7 minutes ago, FBerges said:

    Hi there

    You may be right about that, but there is still the complete block All in One behind it and how many program lines does it have?

    Here the question was asked how a newcomer can do this.

    It doesn't help much to give such a chunk. I don't think my program snippet is that screaming, but it might help a newbie get started.

    In addition, you don't need a truck to get a case of beer from the beverage market if a small car does too. ?

    Greetings Frank

    Yeah, as why you need expensive HC2 to turn on/off switches...?

    The code size is doesn't mater if it works properly... do you know what the code size of HC2 just to create a block scene?

     

    Link to comment
    Share on other sites

    • 0
    3 minutes ago, SmartHomeEddy said:

    Please login or register to see this attachment.


     

    ????

     

     

     

    ?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thank you for the great help. I did it with my posted Block Scene for the first Time. I changed the Interval from 15 to 10 minutes, because the Time between the up cycles should be 10 (not 15). But the rest will be ok. There is a little delay in the energy panel, I don't know why.

    • Like 1
    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...