Specify A Time Range For Notifications

I have a scene that notifies me when the ambient temp reaches a certain point, but I want it to only do that between certain hours. I can set a time to start this scene but not to end it. Normally I would do this by creating a scene to disarm/turn off whatever device I’m working with but I don’t see a way to turn off notifications at a certain time. How to I stop the scene when I want?

Look at PLEG and consider Vera Alerts for notifications.

I am UI7 and can add a schedule to any existing trigger.
If you add a schedule along side the original trigger will it only trigger the scene during the time frame you specify in the schedule? Or will it still be triggered by the original trigger any time?
Sorry as I do not have time to test this. I am sure someone already has.

@Jamr
You misunderstand how this works.

In Vera a scene can be triggered by any of following:

  1. User Request
  2. Some Defined Schedule
  3. Any one of the defined triggers
  4. Appropriate LUA call.

In these cases it is the OR of all of the previous … and NOT the AND!
The schedules on the scene do not have ANY effect on defined triggers.

I suggest you look into PLEG to define the events you want to be notified with. (There you can use LOGICAL AND with Schedules and Triggers).
Then add a notification on the PLEG when your defined condition is satisfied.
You may also want to look into Vera Alerts to provide you greater control on how notifications are delivered.

[quote=“RichardTSchaefer, post:4, topic:187101”]@Jamr
You misunderstand how this works.

In Vera a scene can be triggered by any of following:

  1. User Request
  2. Some Defined Schedule
  3. Any one of the defined triggers
  4. Appropriate LUA call.

In these cases it is the OR of all of the previous … and NOT the AND!
The schedules on the scene do not have ANY effect on defined triggers.

I suggest you look into PLEG to define the events you want to be notified with. (There you can use LOGICAL AND with Schedules and Triggers).
Then add a notification on the PLEG when your defined condition is satisfied.
You may also want to look into Vera Alerts to provide you greater control on how notifications are delivered.[/quote]

Richard, misunderstand and never tried are two different things. I did state them as an OR in my theory.
But thank you for the lecture…lol

Thanks. I figured the answer was going to have a PLEG in there somewhere.

Try inserting the Luup code in the trigger.
http://forum.micasaverde.com/index.php/topic,18679.msg141962.html#msg141962

I tested it and it worked. Just put this luup in the scene and it will control when the scene and its notifications work.
Adjust your time you want to allow the scene to run. Change true to false to block the scene during the time specified.

local pStart = “22:30” – Start of time period
local pEnd = “06:15” – End of time period
local allow = true – true runs scene during period, false blocks it
local hS, mS = string.match(pStart,“(%d+)%:(%d+)”)
local mStart = (hS * 60) + mS
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

I believe there are differences in how this will work between UI5 and UI7.
Did you test on UI7 ?

This doesn’t appear to be working for me in UI7. I am getting alerts outside of the time set (08:00 & 10:00).

I use one PLEG called “Notifications” and I base my conditions mostly with home or away settings, a timer could be used in this case. When timer is true and temp above a setup point fire a notificaion. Can also set another timer so it would not fire again for so long.

That is weird as it works flawlessly here on FW 17569.
Try putting the Luup code on the trigger itself and not the luup code of the scene in step 3. Do this by clicking on the “L” button located on the top right of the trigger.
Make sure you use a 24 hour time in the then time area of the code.
Make sure the 3rd line of the code says “local allow = true”
Set up the scene to turn on a light or something you can notice immediately to actually see if the scene is running correctly. Notifications are not the best way to see the result of a scene trigger.