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

Question

Posted

Dear all,

 

I have a script, I want to run automatically 1x per hour. 

 

Please login or register to see this code.

This is only a snipped of the whole scrip... it also checks, if the notification has been sent already once, etc.... 

 

But I don't know why, but I'm not able to rund that script 1x per hour automatically. Could someone help me please? 

 

Thank you very much!!

 

Dan

 

8 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    ....no ideas? I'd be very happy if someone could help...thanks in advance!

     

    Dan

    • 0
    Posted

    Hi!

    You can make a block scene. As a trigger you can use the timers. If you only want Lua scenes you can convert the block scene to Lua after saving:

     

    Please login or register to see this attachment.

    • 0
  • Inquirer
  • Posted

    @Cafun: Thank you. I know the block scene creator... but when I created it, the following LUA code was generated:

     

    Please login or register to see this code.

     

    So do I really need to add my code twice? (both where is the fibaro:startScene(125) as placeholder? Isn't there a way to only add once the script?

     

    Thank you for your expertise....

     

    Dan

     

    • 0
    Posted
    5 hours ago, Danielos said:

    do I really need to add my code twice?

    Fibaro codegen always add second block code for manual calling. Just remove it 

    • 0
    Posted

    Indeed, just remove it.

    • 0
    Posted

    Or you can just download:

     

     

    and setup this scene to run any other scene at wanted interval or even press button on virtual device etc. :-) 

    It will also take care of time of day, darkness, season time etc.

    • 0
    Posted

    And here is probably the easiest  way if you just want to schedule a script to run hourly. It relies on installing the Timer.lua script to run in the background of you HC2. The script doesn't need to be configured, you just add a new "%% time" header to your own script and define how you want to run it.

     

    Please login or register to see this code.

    (I don't know the how you want to handle the notification_sent logic. Only once per day? You need to set and reset it then)

    • Like 1
    • 0
  • Inquirer
  • Posted

    It works perfect, thanks a lot!!!

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