PIR - Lights on schedule

Hi There,
Gday from Perth,

Got the M1 connected to Vera Ui5 no worries.

  • Created a light to turn on when motion detected and another to turn off when zone safe after 5 mins

How can I do the following:

  • Not make this activate during the day
  • Not make this activate when the zone is armed
  • Depending on time of day trigger for shorter duration and not as bright (night light path)

Thanks for any help. Awesome work on the plugin. I have literally been waiting 10 years for this to eventuate.

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

Cheers

Thanks Zoot,

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

By the way welcome to another WA user :slight_smile:

Cheers :slight_smile: