This is a simplified Alarm Clock that was created to work in conjunction with @Sankotronic Main Scene 1.2.4
You need to have this installed for my VD and code below to work
Thanks to @Sankotronic for allowing me to leverage his scene
Step 1
Create 3 variables (top variable panel)
WakeUp_weekend
WakeUp_weekday
WakeUp_time
Step 2
Import the VD 'Simple Clock' below
Adjust the preset alarm times to suit your household patterns
I have it setup so the middle one of the normal one and the left and right are a little earlier and a little later
Step 3
Open @Sankotronic Main Scene v1.2.4 and adjust as follows
~ line 266
local runSceneSchedID = {jT.scene.goodMorning, jT.scene.upTidyUp};
Ensure the scene you want executed is added here.
Make note of position relative to other scenes in the list. In my example it is the first entry ~ line 282
local runSceneSchedHour = {{"wakeup_time"},{"07:55"}};
Ensure some reference to you scene is added here.
Normally you would add the time for the scene to be executed but in this case just add a descriptor.
~ line 412
function extraUserCodeFirst()
Add the following line of code within this function. (This reads the global variable and assigns it to the scheduler variable)
runSceneSchedHour[1][1] = fibaro:getGlobalValue("WakeUp_time")
Adjust the table reference values [1][1] in the code to match the relative position of the scene within the list on line 266 (runSceneSchedHour)
The table reference is set out as [table][sub-table] so If it is the scene you want to execute is the first entry use [1][1], if its the second use [2][1] and so on, If you have multiple times for a give scene you may need to adjust the [subtable] reference to 1, 2, 3 etc.
in my example the scene is the first one so the reference [1][1] is correct
Step 4
Save the scene and close
That's it.
Alarm_Clock_1.0.0.vfib