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


Simple Timer / Scheduling Scene 1.0.0

   (0 reviews)

About This File

Sankotronic's scene for scheduling time based events (Topic 23510) is a shining example of LUA coding and impeccably documented. It's very powerful and caters for just about every scheduling requirement that you could think of, as well as adding a lot of useful variables that can be used to check whether a scene is running at different periods in the day, week, month, year etc.  However, with that power comes a little added complexity, and it's possible that your requirements are much simpler.  If you're one of those people and haven't already implemented your own scheduling scene, then that's where this scene may help.

 

SIMPLE TIMER SCENE

This scene will simply update global variables, either on a periodic basis, or at selected times of the day.  These global variables can then be used to trigger other scenes by adding them to the %% globals section in the header, eg:

--[[
%% globals
fiveMinuteTimer
--]]

It will automatically create the global variables, so you don't need to worry about doing this manually.

 

At the beginning of the scene is a table that contains the timers that you want to create, and you should modify this table according to your requirements.  For each timer, as well as the timer name, you also specify either:

 

  1. The frequency in seconds that the timer will be triggered, or
  2. The set time(s) that the timer will be triggered, in HH:MM format.

 

Two special values for 'sunrise' and 'sunset' can be used to trigger scenes to run at these times.

 

This is the table that you should update:

local timers = {
                 timer1 = {name="oneMinuteTimer", frequency=60},
                 timer2 = {name="fiveMinuteTimer", frequency=300},
                 timer3 = {name="fifteenMinuteTimer", frequency=900},
                 timer4 = {name="twelveHourTimer", frequency=43200},
                 timer5 = {name="garageDoorCheckTimer", setTimes={"20:00", "21:00", "22:00"}},
                 timer6 = {name="sunriseTimer", setTimes={"sunrise"}},
                 timer7 = {name="sunsetTimer", setTimes={"sunset"}}
               }

 

It is recommended that you set on the 'Do not allow alarm to stop scene while alarm is running'.  If not, then whenever Fibaro's alarm is triggered, then all your scenes that depend on these timers will stop.

  • Like 4

Other Files from Dave_H


User Feedback

Recommended Comments

Great, simple timer. Love it!

 

One small request: I wanted to add 15 minutes to the sunset time, to replace my current timer. Unfortunately, this is not as simple as "timerDateTime.min = sunrise:sub(4,5) + 15". Any idea how to solve this elegantly, simplistic but still accurate? ;-)

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
Add a comment...

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