The Garage Door Sunset Monitor is designed to notify you if your garage door (or any other contact sensor) is open after dark, or some other preset times.
Features:
You can monitor any number of doors
You can monitor based on sunset/sunrise (+/- X minutes), or, at specific times of the day
You can decide how long the doors can be open before you’re alerted
I’ve been using the app for a while at my home and it has been working reliably.
This thing is amazing. Is it possible to have a switch activated if the threshold is reached? For example, I have some cameras in my garage where it would be nice to turn the switch on the controls the cameras and off when clearde. Thanks! You guys make me really come back to ST because of the craftsmanship in your work! That s to all smartapp community authors! Where can I donated?
@pmusselman Glad it helps! You should be able to update the app to turn on/off switches when the alarm fires. You’ll want to have a preference for capability.switch and then just turn it .on(). Let me know if you can’t get it going!
For clarification, how do you setup a time check if you don’t want to use Sunset. Say I want to do 9 PM every night. Is that possible and how do you set it in the smart app? Thanks.
I use the “Garage Door Sunset Monitor” and have had a couple of false positive notifications.
Here’s the details from this morning:
2016-11-08 5:38:04.918 AM GMT
DEVICE Door - Garage Roller contact is open
2016-11-08 5:38:06.101 AM GMT
Alert: Its sunset and Door - Garage Roller is open for 30 minutes Push (OK)
2016-11-08 5:38:54.442 AM GMT
DEVICE contact closed Door - Garage Roller contact is closed
2016-11-08 5:43:06.038 AM GMT
OK: Door - Garage Roller closed Push (OK)
Any ideas what might be causing it? As you can see from the contact sensor details above the door was open for less than 60 seconds.
I noticed this issue too so I debugged the code. I think the problem is that the state.threshold is not reset if the door closes before the threshold is met. So made this change to checkdoors(). I have not tested this code yet but I will in the next few days
def checkDoors() {
// if we're doing Time of Day monitoring, see if this is within the times they specified
if (monitoringType == "Time of Day") {
def currTime = now()
def eveningStartTime = timeToday(startMonitoring)
def morningEndTime = timeToday(stopMonitoring)
state.monitoring = currTime >= eveningStartTime.time || currTime <= morningEndTime.time
}
log.info "checkDoors: Should we check? $state.monitoring"
if (!state.monitoring) {
return
}
doors?.each { door ->
def doorName = door.displayName
def doorOpen = checkDoor(door)
log.debug("checkDoors: Door $doorName: $doorOpen, previous state: " + state.opened[doorName])
if (doorOpen == "open" && !state.opened[doorName]) {
// previously closed, now open
state.threshold = state.threshold + 5
log.debug("checkDoors: Door was closed, is now open. Threshold check: ${state.threshold} minutes (need " + threshold + "minutes)")
if (state.threshold >= threshold) {
log.debug("checkDoors: Door has been open past threshold, sending an alert")
send("Alert: It's sunset and $doorName is open for $threshold minutes")
state.opened[doorName] = true
}
} else if (doorOpen == "closed" && state.opened[doorName]) {
// previously open, now closed
log.debug("checkDoors: Door had been previously open, is now closed")
send("OK: $doorName closed")
state.opened[doorName] = false
state.threshold = 0
} else if (doorOpen == "closed"){
// Door closed before threshold, reset threshold
log.debug("checkDoors: Door closed before " + threshold + " threshold. Threshold check: ${state.threshold} minutes (threshold reset to 0)")
state.threshold = 0
}
}
}
New user question… Do I just log in to https://graph.api.smartthings.com, click on “My SmartApps” > New SmartApp" > From Code > Paste your GitHub code > Click Create > Click Publish?
Then it should show up in the ST app? That’s what I did and it’s not showing up…
This is more than likely why you can’t see it in Marketplace. After you logout / login with the above url, note the shard you are redirected to (more than likely not graph.api…). If you don’t see the SmartApp there, then recreate it again and publish for you. Then it will show in Marketplace.
Can you do me a favor and mark that post above as a solution. Click the check box ✓. That way it will help others in the future if they come across this.