How To Get Notification When Door Sensor Open After hours?

I’d like to get a text message between 5pm and 8am when a door is open. I have installed door sensors and got everything setup, but the notification for each sensor is only if it’s triggered. There is no “if triggered after 5pm send text”. It just text’s every time a sensor is triggered.

Any help?

Also, one more tidbit. I setup to get text when battery is very low. But it texts me every 5 minutes. Can I lower the rate of texts, sucks to get texted every 5 minutes in middle of night :slight_smile:

Have a look at Conditional Scene Execution.

I tried to find but found nothing in that link related to notifications.

I know how to run scenes, but no idea how to setup where I get notified when a sensor gets triggered after hours.

[quote=“arcarocket, post:3, topic:186970”]I tried to find but found nothing in that link related to notifications.

I know how to run scenes, but no idea how to setup where I get notified when a sensor gets triggered after hours.[/quote]

Set the scene to run when you want then instead of an action add a notification when the scene runs.

I dont get it, I’m using a Vera3. I go to Automation > New Scene and it shows me all the locks/sensors, etc. My only option for the sensors is to select ARM or BYPASS. And no option for setting up a notification.

“add a notification when the scene runs.” - I don’t want a notification of a scene running, I want a notification of a sensor being tripped after hours.

The strategy is to create a scene that is triggered by the Door Sensor.
In the LUA code for the trigger you CANCEL the scene in those cases you do NOT want to get a notification.
Then you set the NOTIFICATION for the scene.

The result is that when the Sensor goes off after hours, the trigger is not canceled, the scene runs, with the sole purpose of running the scene’s notification!
Other times the scene is canceled!

NOTE: You can also use PLEG and Vera Alerts to get very explicit control over your notifications.

Over my head I believe, I looking into Vera Alerts now. Didn’t even know they had a app store for Vera!

Thanks

Vera Alert’s alone does not solve your problem. As I indicated you would need PLEG + Vera Alerts.
PLEG is a different approach to a Scene with conditional LUA code.

Professor @RexBeckett also wrote an intro for PLEG:
http://forum.micasaverde.com/index.php/topic,21603.0.html

Do you any of you guys work for hire? IE: I load vera alters and pleg and then you login via teamviewer and get it all running for me? I don’t mind paying something to save my time!

Many of us would love to help you. VERA is a tinker toy. If you don’t learn to tinker with it and always relay on someone just doing it for you, your gonna be in for a bumpy ride.

Where are you located?

I’ve attached a screen shot.

You will begin by setting up your scene, which you’ve stated you know how to do. Within that, you will click the arrow for ‘notify these people’. Assuming you’ve setup an account on your vera, you can just choose that username and you’re done. Or you can install Vera Alerts and use that, but that should probably be a 2nd step once you get this basic setup down.

Now, the second part I’ve highlighted - ‘Also execute the following Luup code’ - is where you are going to tell this scene whether to perform the action you specified or not. The following code is lifted directly from RexBeckett’s conditional programming guide. Just change the times to match what you want and save it and reload luup and it will work.

local pStart = "20:30" -- Start of time period local pEnd = "07:00" -- End of time period local allow = false -- 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

You don’t say whether you’re on UI7 or not. The screenshot is from UI7. It may look slightly different in UI5, but the concepts are the same…you have to setup the notification as an action and tell the scene to perform the action between the times you specify in code.

The following statements might not be 100% technically correct, but conceptually they help me understand what is going on.
Notice my choice of words…I did not say “whether the scene will run or not”. The scene will run every time the trigger for it happens (in this case the armed door sensor is opened). The Luup code tells it whether or not to perform the actions (or quit and do nothing) when it runs.

You could use the night mode perhaps. The simplest way is to have one scene to arm the door at 5:00pm and another to disarm at 8:00pm. Unless you have the door sensor set to send a message when tripped, you will need one more scene to send a message when the armed door sensor is tripped. No need for plugins with this one. I use the night mode, but I don’t turn it on until after 11:00pm.

Sent from my iPad using Tapatalk

On my vera 2 I used the blow code to check if my garage door was left open for more than 30 mins. I setup a schedule to run the scene every min, then used VeraAlerts to send me a text, and placed the code in the LUUP section But with UI7(Vera Edge) this no longer works for some reason. I can set the schedule, place the LUUP code in, and set it to notify me… But it will send me a text every min regardless if the door is open or not.

local deviceNo = 23
local period = 30

local SS_SID = “urn:micasaverde-com:serviceId:SecuritySensor1”

local armed = luup.variable_get(SS_SID, “Armed”, deviceNo) or “0”
if armed == “1” then
local tripped = luup.variable_get(SS_SID, “Tripped”, deviceNo) or “0”
if tripped == “0” then
luup.variable_set(SS_SID, “TripPeriod”, “0”, deviceNo)
else
local tripPeriod = luup.variable_get(SS_SID, “TripPeriod”, deviceNo) or 0
tripPeriod = tonumber(tripPeriod)
tripPeriod = tripPeriod + 1
luup.variable_set(SS_SID, “TripPeriod”, tripPeriod, deviceNo)
if tripPeriod == period then
return true
end
end
end

return false

Check your LUA code … Vera Alerts will insert some code there … you may need to move the generated code into the appropriate conditional block.
Make sure you move the generated comments as well!

[quote=“ctguess, post:11, topic:186970”]local pStart = "20:30" -- Start of time period local pEnd = "07:00" -- 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[/quote]
ctguess,

I copied the code exactly as you noted above but, changed the false to true. I wanted the Vera to send me an email if the door was open between 2030 and 0700. The scene doesn’t fire before or during the time set. It says the scene Last Run = Never. I am UI7 and I did Reload Engine. Am I missing something? I am attaching a screen shot.

Can you confirm that your Vera time/time zone is properly set? It is not the time you see in the browser. You have to go to the location settings and confirm that. If that is correct, use the following URL (Replace with your IP) in another window to monitor the log:

http://Your.Vera.IP.Address/cgi-bin/cmh/log.sh?Device=LuaUPnP

Copy the lines around what is logged when you open the garage during the set time period and paste (highlight the text and copy into text pad/notepad first) them in your reply. There are FAR smarter and more experienced people than me on here who will be able to make sense of what the log entry is telling you.

Gentleman,

I tried to help out the original poster “arcarocket” I for the life of me couldn’t get PLEG to work right. I kept getting error getting status of any trigger or Condition I created. Even deleted both parts of PLEG and re installed. Left the t1 and c1 as trigger and condition and would get an error on both the condition and trigger when opening status page. Along with “unknown” in the report.

This was on a ui5 Vera3 and no other apps installed. Tried multiple reboots and refreshes still no go. Any ideas to check?

Any ideas to check?

Try forcing updates of PLEG and PLC - in that order using:

PLEG:

<veraip>:3480/data_request?id=update_plugin&Plugin=3066

PLC:

<veraip>:3480/data_request?id=update_plugin&Plugin=3086

With the usual reload/refresh cycle after each.

[quote=“RexBeckett, post:18, topic:186970”]

Any ideas to check?

Try forcing updates of PLEG and PLC - in that order using:

PLEG:

<veraip>:3480/data_request?id=update_plugin&Plugin=3066

PLC:

<veraip>:3480/data_request?id=update_plugin&Plugin=3086

With the usual reload/refresh cycle after each.[/quote]

Might be on to something here, but I did try to do that and I failed to get the page to load on either. Tried in both chrome and IE. Almost as if the IP was wrong, just a filed to load page. I was using the IP tho to access Vera locally. I ended up not paying much attention and just removing and re-installing.

You have to Reload LUUP after creating inputs … That will evaluate all the new inputs and conditions and give them an initial value!