Garage Door Sensor Notification

I have a door sensor on my garage door (SM103-1) and it is working fine. What I want is this. When the garage door is open of course it’s tripped so at a certain time only like 10pm if someone leaves the door open I would like it to be notified, if it’s closed it would send nothing. I only want this notification at 10pm daily. I have a Vera-3 I’m sure there is a way to do this but have been unable to figure this out.

I have these sensors on my garage doors as well, and would like to find a way to be notified if a door is left open. Did you find a way to do this yet?

Thanks.

I’ve tried many different ways and have been unable to figure it out. I will be installing a Evolve LFM-20 hopefully this weekend that will allow me hopefully just to close the door at a certain time. I have good sensors on my doors and have down pressure set correctly and am not concerned about causing an issue. I would still prefer to receive notification but hopefully I can make this work.

You could do this with some LUUP code.

I use something similar with Prowl (iPhone app notifications)

local doorStatus

-- Check Door (device XX)
doorStatus = luup.variable_get("urn:schemas-micasaverde-com:device:DoorSensor1","Tripped",XX)
if (tonumber(doorStatus) == 1) then
  luup.inet.wget("https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Garage+Open")
end

return true;

NOTE: This is just off the top of my head. My Vera is down, and I can’t log in to check this. You would have to change XX to be your device number, and YYY to be your Prowl API key. I am also unsure of the name of the variable to check in the door sensor, if it’s “Tripped” or “Status”, etc.

OK I received and installed my Evolve LFM-20 and am now able to close the door. I’m still unable to check the status and if open close. I agree some Luup code will be needed. I will admin I was looking for a solution without having to use custom Luup code. I will have to do some work some weekend.

[quote=“PurdueGuy, post:4, topic:170671”]You could do this with some LUUP code.

I use something similar with Prowl (iPhone app notifications)

local doorStatus

-- Check Door (device XX)
doorStatus = luup.variable_get("urn:schemas-micasaverde-com:device:DoorSensor1","Tripped",XX)
if (tonumber(doorStatus) == 1) then
  luup.inet.wget("https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Garage+Open")
end

return true;

NOTE: This is just off the top of my head. My Vera is down, and I can’t log in to check this. You would have to change XX to be your device number, and YYY to be your Prowl API key. I am also unsure of the name of the variable to check in the door sensor, if it’s “Tripped” or “Status”, etc.[/quote]

Hi PurdueGuy,

This looks very interesting but I’m not a programmer (by profession, but I do a little programming here and there) and I’m not familiar with Prowl. Does the line “https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Garage+Open” run a script of some sort from the Prowl website? If I purchase the Prowl app on iTunes does that give me access to this site? This sounds like it would be very useful.

Thanks,
Don

[quote=“ufd108, post:6, topic:170671”]Hi PurdueGuy,

This looks very interesting but I’m not a programmer (by profession, but I do a little programming here and there) and I’m not familiar with Prowl. Does the line “https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Garage+Open” run a script of some sort from the Prowl website? If I purchase the Prowl app on iTunes does that give me access to this site? This sounds like it would be very useful.

Thanks,
Don[/quote]

@Don/ufd108,

Yes, the “https” line will send a Prowl notification to your iPhone if you buy the app. I think you can send it to Growl on a Mac (maybe PC) for free for testing. You can change the “Vera” and “Garage+Open” to whatever you want. (Note: the “+” is translated into a space when it goes to your phone.)

There are a number of priorities you can set to get your attention, has quiet hours (that an emergency can override). It’s a pretty decent and fast notification system.

More info here: http://forum.micasaverde.com/index.php/topic,4508.0.html

Hi PurdueGuy,

Thanks for the feedback. I bought the Prowl app today for my iPhone and already got notifications working when the garage door is opened (as in when someone comes home). Over the next couple of days as time permits I’ll work on the automatic Prowl notification if the garage door is left open at night. If I get it to work I’ll post it here.

Thanks again for your help. You and several other real experts on this forum do more for the newbies like me than MCV ever will.

I use the following strategy to notify all of my notifications. I am using VeraAlert on Android instead of Prowl.

I recommend a single notification scene. In your case I would call it Prowler.
I would add an event for each notification. In the Luup code for THAT EVENT add your luup code to send your prowl notification.

Note if you would like for prowl to be made available as on option to the standad MCV notification UI than chime in at the following forum address:
[url=http://forum.micasaverde.com/index.php/topic,9525.0.html]http://forum.micasaverde.com/index.php/topic,9525.0.html[/url]

[quote=“PurdueGuy, post:4, topic:170671”]You could do this with some LUUP code.

I use something similar with Prowl (iPhone app notifications)

local doorStatus

-- Check Door (device XX)
doorStatus = luup.variable_get("urn:schemas-micasaverde-com:device:DoorSensor1","Tripped",XX)
if (tonumber(doorStatus) == 1) then
  luup.inet.wget("https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Garage+Open")
end

return true;

NOTE: This is just off the top of my head. My Vera is down, and I can’t log in to check this. You would have to change XX to be your device number, and YYY to be your Prowl API key. I am also unsure of the name of the variable to check in the door sensor, if it’s “Tripped” or “Status”, etc.[/quote]

hello

this code doesn’t work
have you a correct code for doorstatus with a sm103

thanks

[quote=“davidd1205, post:10, topic:170671”]hello

this code doesn’t work
have you a correct code for doorstatus with a sm103

thanks[/quote]
I do not have an sm103 to test with. When I get home, I can test more.

Try this, replacing XX and YYY as appropriate:

[code]
local doorStatus

– Check Door (device XX)
doorStatus = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,XX)

if (tonumber(doorStatus) == 1) then
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Door+Is+Open&description=Door+Event”)
else
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Door+Is+Closed&description=Door+Event”)
end[/code]

[quote=“PurdueGuy, post:11, topic:170671”][quote=“davidd1205, post:10, topic:170671”]hello

this code doesn’t work
have you a correct code for doorstatus with a sm103

thanks[/quote]
I do not have an sm103 to test with. When I get home, I can test more.

Try this, replacing XX and YYY as appropriate:

[code]
local doorStatus

– Check Door (device XX)
doorStatus = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,XX)

if (tonumber(doorStatus) == 1) then
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Door+Is+Open&description=Door+Event”)
else
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YYY&application=Vera&event=Door+Is+Closed&description=Door+Event”)
end[/code][/quote]

thanks work very well

i have modify for a notification if open since 30 minutes
and i test

thanks

i modify your code on

[code]function checkdoorstatus()
– Check Door (device XX)
doorStatus = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,59)

if (tonumber(doorStatus) == 0) then
luup.log(“Sensor Not Tripped, ending scene”)
else
luup.log(“Sensor is still tripped!”)
end
end
luup.call_timer(“checkdoorstatus”, 1, “30m”, “”, “”)

if (tonumber(doorStatus) == 1) then
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YY&application=Vera&event=Garage+est+Ouvert&description=Garage+ouvert+depuis+30+minutes”)
return true
else
return false
end
[/code]
his code works very bine rajoutter but I’d like another garage door in this code or with the same code but nothing works after
how?
I tried this but I only get the first code that notifs

[code]function checkdoorstatus()
– Check Door (device XX)
doorStatus = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,59)

if (tonumber(doorStatus) == 0) then
luup.log(“Sensor Not Tripped, ending scene”)
else
luup.log(“Sensor is still tripped!”)
end
end
luup.call_timer(“checkdoorstatus”, 1, “30m”, “”, “”)

if (tonumber(doorStatus) == 1) then
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YY&application=Vera&event=Garage+est+Ouvert&description=Garage+1+ouvert+depuis+30+minutes”)
return true
else
return false
end
function checkdoorstatus2()
– Check Door (device XX)
doorStatus2 = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,58)

if (tonumber(doorStatus2) == 0) then
luup.log(“Sensor2 Not Tripped, ending scene”)
else
luup.log(“Sensor2 is still tripped!”)
end
end
luup.call_timer(“checkdoorstatus2”, 1, “30m”, “”, “”)

if (tonumber(doorStatus2) == 1) then
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YY&application=Vera&event=Garage+est+Ouvert&description=Garage+2+ouvert+depuis+30+minutes”)
return true
else
return false
end

[/code]

I’m no expert on functions, but after you check the status from the first function, you still have the “returns” in there. The will end the code. Try removing them.

I quickly edited your code to get this (adjusted spaces too):[code]
function checkdoorstatus()
– Check Door (device XX)
doorStatus = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,59)

if (tonumber(doorStatus) == 0) then
luup.log(“Sensor1 Not Tripped, ending scene”)
else
luup.log(“Sensor1 is still tripped!”)
end
end
luup.call_timer(“checkdoorstatus”, 1, “30m”, “”, “”)

if (tonumber(doorStatus) == 1) then
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YY&application=Vera&event=Garage+est+Ouvert&description=Garage+1+ouvert+depuis+30+minutes”)
end

function checkdoorstatus2()
– Check Door (device XX)
doorStatus2 = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,58)

if (tonumber(doorStatus2) == 0) then
luup.log(“Sensor2 Not Tripped, ending scene”)
else
luup.log(“Sensor2 is still tripped!”)
end
end

luup.call_timer(“checkdoorstatus2”, 1, “30m”, “”, “”)

if (tonumber(doorStatus2) == 1) then
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YY&application=Vera&event=Garage+est+Ouvert&description=Garage+2+ouvert+depuis+30+minutes”)
return true
else
return false
end[/code]

However, your code only checks the door status after 30 minutes (when the timers expire), but you are checking the status immediately in the lines after the calls to call timer. I think you might want something more like the following (I moved the prowl calls to the timer functions):[code]

function checkdoorstatus1()
luup.log(“Checking door 1”)
– Check Door (device XX)
doorStatus = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,59)

if (tonumber(doorStatus) == 0) then
luup.log(“Sensor1 Not Tripped”)
else
luup.log(“Sensor1 is still tripped!”)
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YY&application=Vera&event=Garage+est+Ouvert&description=Garage+1+ouvert+depuis+30+minutes”)
end
end

function checkdoorstatus2()
luup.log(“Checking door 2”)
– Check Door (device XX)
doorStatus2 = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,58)

if (tonumber(doorStatus2) == 0) then
luup.log(“Sensor2 Not Tripped, ending scene”)
else
luup.log(“Sensor2 is still tripped!”)
luup.inet.wget(“https://api.prowlapp.com/publicapi/add?apikey=YY&application=Vera&event=Garage+est+Ouvert&description=Garage+2+ouvert+depuis+30+minutes”)
end
end

luup.call_timer(“checkdoorstatus1”, 1, “30m”, “”, “”)
luup.call_timer(“checkdoorstatus2”, 1, “30m”, “”, “”)[/code]

NOTE: You could actually rewrite this so that the function takes a variable, and you aren’t repeating essentially the same code. Unfortunately, I don’t have any time right now to work on that.

[quote=“RichardTSchaefer, post:9, topic:170671”]I use the following strategy to notify all of my notifications. I am using VeraAlert on Android instead of Prowl.

I recommend a single notification scene. In your case I would call it Prowler.
I would add an event for each notification. In the Luup code for THAT EVENT add your luup code to send your prowl notification.

Note if you would like for prowl to be made available as on option to the standad MCV notification UI than chime in at the following forum address:
[url=http://forum.micasaverde.com/index.php/topic,9525.0.html]http://forum.micasaverde.com/index.php/topic,9525.0.html[/url][/quote]

Why do you recommend a single notification scene? Is there an advantage to this strategy?

On a side note I did add my request to support Prowl on the thread you referenced.