@kfc01
Answer has a fairly wide scope and there are lots of different ways to achieve this but suggest you start by looking at the following plugins: -
Day or Night plugin.
PLEG plugin
This question may be better in the “Scene” forum as the questions are generic and you may get a more descriptive answer there.
Whilst waiting I did more research, will look into the plugins I did the following in the meantime
Not make this activate during the day
Sunset to wake up:
Code: [Select]
local pStart = 0 -- Start of time period, minutes offset from sunset
local pEnd = "06:15" -- End of time period
local allow = true -- true runs scene during period, false blocks it
local mStart = math.floor( (luup.sunset() % 86400) / 60 ) + pStart
local hE, mE = string.match(pEnd,"(%d+)%:(%d+)")
local mEnd = (hE * 60) + mE
local tNow = os.date("*t")
local mNow = (tNow.hour * 60) + tNow.min
if mEnd >= mStart then
return (((mNow >= mStart) and (mNow <= mEnd)) == allow)
else
return (((mNow >= mStart) or (mNow <= mEnd)) == allow)
end