Door left open (with Photo Burst, Hello Home, & Speech), Version 1.3.5


(Brian S. Lowrance) #1

Door left open (with Photo Burst, Hello Home, & Speech), Version 1.3.5
(Updated to Version 1.3.5 10/26/2015 - More info here)

Receive Push, SMS alerts, Verbal announcement via speechSynthesis or musicPlayer device(s), and/or run a Hello Home (routine) when a door is left open for longer than x minutes.
Optionally take a few photos of the event.
Optionally receive repeat alerts at each x minutes until the door is closed.

Original code by olson.lukas@gmail.com. Not sure actually where I found this code initially as I have been using the original version for a while, but nonetheless, I added the ability to capture images and also repeat notifications if the door does not close by the time the next alert interval expires. I also received false alarms initially and added some protection in to prevent those.

With a toddler around the house, I want to know if someone leaves a door open for more than 1 minute. I also want to know if it remains open until it closes.

The code for this SmartApp is located here:


Notify if Lights on for x time?
Door Left Open for "X" Min = Mode Change
(Brian S. Lowrance) #3

Version 1.3.1 published at https://github.com/rayzurbock/SmartThings-DoorLeftOpen

Version 1.3.1 adds a repeat notification limit of 10 to prevent repeat alerts from being sent forever.
The final notification will announce “Last notice.” Further alerts will not be sent for the same door left open incident. If the door closes and is then subsequently left open again a new set of up to 10 alerts will be sent.


(Brian S. Lowrance) #4

Version 1.3.3 has been released here: https://github.com/rayzurbock/SmartThings-DoorLeftOpen

I recommend uninstall of the previous version for each door/contact sensor that it has been installed for prior to changing the code and reinstalling this version.

Changes from version 1.3.1 to 1.3.3:

  • Added dynamic pages
    • App initially starts with an overall configuration status page with an option to click to configure the app
  • Added option to run a Hello Home action when a door is left open
    • This action will only be run on the first alert (until the contact closes and a new alert is later caused again)
    • Added Optional Hello Home action on alert clear (contact closure)
      • Hello Home actions allow you to change your home mode, thermostat settings among other things, so rather than build these into the SmartApp, I am relying on the configuration of desired Hello Home Actions to do the same thing.
      • This feature should probably only be configured on 1 door that could be in alert state at a time as the app does not look to see if other doors have already run a hello home. There could easily be an alerting conflict where one door changes the mode/action another door set.
    • Added ability to verbally announce alert via speech synthesis devices (Sonos, VLC Thing).

(Coolcatiger) #5

Sonos does not show up in list of device. I have UBI which shows up though. I want to use sonos / obything to announce if door is left open for long time.


#6

Yeah, I’ve noticed the missing support for Sonos as well. Any chance for Sonos support to be added, as it is with the Big Talker SmartApp?

That would be awesome!


(Brian S. Lowrance) #7

@coolcatiger @pm4_1613,

Added musicPlayer (Sonos) support in 1.3.4 just published here: https://github.com/rayzurbock/SmartThings-DoorLeftOpen

Note: This version is an initial implementation for this support. It will currently interrupt your playing music in order to play the alert. It does not currently attempt to resume your playing music. This will be a future feature enhancement.


#8

Wow! What a quick turnaround. I was actually in the middle of trying to add this capability when I saw your response.

A couple things I’ve noticed…

  1. Looks like line 97 should have “capability.musicPlayer” instead of “capability.speechSynthesis”

  2. It appears that this update fails at the same point I’m currently stuck. If anything other than a single word variable is passed to the playText() method the following error is thrown:

java.lang.reflect.UndeclaredThrowableException @ line 818

Any thoughts on how to resolve? I don’t believe I’ve seen the same error for Sonos notifications with the Big Talker SmartApp.

Thanks.


SmartThings Text-To-Speech for Sonos (playText) not working?
(Brian S. Lowrance) #9

@pm4_1613

  1. Thanks for catching that. I copy/pasted the command and forgot to adjust that part. Version 1.3.5 has been posted.

  2. This error java.lang.reflect.UndeclaredThrowableException is an inconsistent SmartThings platform issue when the device type calls the SmartThings textToSpeech() function. See this thread as well as this thread for more info. Basically it will work when it wants to and throw this error when it doesn’t. I submitted a support case (150184) with SmartThings regarding this inconsistent issue when textToSpeech() is called by a device type (Sonos, VLCThing, Ubi, etc). Unfortunately, I have no way to fix this as it’s a platform issue.


#10

Ok, thanks for the info and your work on this!


#11

So, there is a fairly convoluted work around…

  1. Create a new mode
  2. Create a new routine that changes to the mode created in #1
  3. Create a new instance of the “Sonos Notify with Sound” SmartApp
  4. Setup the Sonos SmartApp to play a custom message when the system changes the mode to the mode created in #1
  5. Create a new instance of the “Door left open…” SmartApp
  6. Configure the “Door left open…” SmartApp to run the routine created in #2 when triggered

Any custom message entered with the SmartApp created in #3 seems to work just fine.


(Brian S. Lowrance) #12

So “Sonos Notify with Sound” consistently works?

I’m doing some re-writing and testing of the BigTalker Talk() function according to how “Sonos Notify with Sound” calls speech functions. Preliminary tests are good. If this turns out well, I’ll migrate the relevant portions to my version of this SmartApp asap.


#13

Awesome! Can’t wait for the update.

Yes, it does appear that “Sonos notify with sound” works in all cases.


(Coolcatiger) #14

Can this be extended to - repeat announcement when water sensor is wet ?


(Will) #15

I just installed this app but I’m not getting the notification over my Sonos. I do get the alert on my phone. Any idea what might be going wrong for me? i do use other Sonos notification apps and they are working. Just trying to figure this one out.

Thanks in advance for the help.


#16

I’m in the same situation as you. I was initially getting Sonos notifications throughout the house when I first installed this … but they seem to have stopped since then. One of the main reasons I installed the app, is for when we have company visiting (i.e.: people who don’t have the SmartThings app on their phone) and someone accidentally leaves a door open and we have a risk of the pets getting out. I want the house to talk to them and chide them repeatedly until they close the door.

Other Sonos notifications within SmartThings still work fine (i.e.: I have a simple “Goodnight!” prompt that ST sends to our bedroom Sonos when I throw the house into “Night” mode) … but this one doesn’t anymore.

I may try to see if the main purpose of this app can be met with CoRE.