[BETA] New smartapp Automation-Director choose almost any triggers and assign actions

smartapp_misc
smartapp_sensors
smartapp_remotes

#1

Automation Director

This is my first smartapp which I started because I couldn’t find any button controllers which were as customizable as I wanted. I was looking for a smartapp which would let me choose what each button or button held would do individually for both lighting and Sonos. The smartapp evolved from there, into a smartapp which allows you to choose almost any of the triggers SmartThings supports, then choose almost any action SmartThings supports, then assign the trigger state actions like assign when the Switch Living room lights is turned On to Play the Living room Sonos and turn on the Living room reading lamp, or When no presence devices are present pause all of the Sonos speakers and turn one bulb on at 30%, or when button 1 is pressed send an SMS text and when it is held send the text and setoff the siren.

This SmartApp will allow you to choose any number of triggers:

  • Button Controllers(You choose the actions per button press/hold)
  • Acceleration sensors
  • Contact sensors
  • Motion sensors
  • Tamper sensors
  • Shock sensors
  • Sleep sensors
  • Sound sensors
  • Touch sensors
  • Step sensors
  • Beacon sensors
  • Presence sensors
  • CO2 measurement levels
  • CO detectors
  • Smoke detectors
  • Sound pressure levels
  • Water sensors
  • Energy levels
  • Power levels
  • Voltage levels
  • Battery levels
  • Switch state changes
  • Illumination levels
  • Door controller state changes
  • Temperature levels
  • Humidity levels
  • UV levels
  • ph levels
  • Valve state changes
  • Shade state changes

To change any number of the following:

  • Set alarm modes
  • Activate sirens(siren/strobe/both/off)
  • Send custom Push notification messages
  • Send custom SMS notification messages
  • Send a specific sound to a doorbell
  • Control Garage doors(open/close)
  • Control Locks(lock/unlock)
  • Control Door openers(open/close)
  • Take Still Images(and photo bursts)
  • Control Bulbs(on/off/toggle/dim/brighter/favorite/full/color)
  • Control Dimmers(on/off/toggle/dim/brighter/favorite/full)
  • Control Switches(on/off/toggle)
  • Control Outlets(on/off)
  • Control Relays(on/off)
  • Control Valves(open/close)
  • Control Shades(open/close)
  • Control Speakers(play/pause/toggle/mute/unmute/next/previous/volume up/volume down)

Restrictions Allowed:

  • Certain time with Sunset/Sunrise options
  • Certain days of the week
  • Certain alarm mode
  • Illumination is above or below thresholds
  • Contact sensor open/closed
  • Acceleration sensor active/not
  • Motion sensor active/not
  • Shock detected/not
  • Sleep sensor sleeping/not
  • Sound sensor active/not
  • Water sensor Wet/Dry
  • Beacon sensor Preset/Away
  • Presence sensor Present/Away
  • CODetector Detected/Clear/Tested
  • Smoke Detected/Clear/Tested
  • Power Source sensor DC/Battery/Mains
  • Door sensor open/closed/unknown
  • Valve sensor open/closed
  • Shade sensor open/closed/partial/unknown
  • Temperature is above or below thresholds
  • Power Meter is above or below thresholds
  • Voltage is above or below thresholds
  • Energy Meter is above or below thresholds
  • CO2 Measurement is above or below thresholds
  • Humidity is above or below thresholds
  • UV is above or below thresholds
  • ph is above or below thresholds
  • Sound Pressure level is above or below thresholds

Known issues:

  • After you setup an instance, if you want to change the custom Push or SMS notifications you should deselect them from the “Assign the actions to the triggers” page and save then go back in to change them and re-assign them otherwise actions that are no longer valid will not show up in the menus and will not do anything but if you watch the live logging you will see it still tries processing them.

Updates:

  • 1.6 Added the ability to have the Audio Notification (AEON Labs Doorbell) play only once in a time period for door openings or any other trigger, this has been tested with contact sensors, light switches, motion, presence, and illuminance so far
  • 1.5 Beta
  •  	Added the ability to turn a light on via a switch on, motion active, contact open, or button pushed/held and have it turn off after a specified amount of time
    
  •  	If a light was already on before the event happened the light will remain on after the timer period finishes,
    
  •  		except if there was still motion when the timer finishes then it will wait for the specified amount of time again
    
  •  		and when there is no longer motion it will turn off all of the lights it turned on which are set to turn off after a certain amount of time
    
  •  	If a light is turned off and back on during the timer period the light will remain on after the timer period finishes
    
  •  	If you add multiple motion sensors with the same lights then motion must not be detected on any of the motion sensors for the lights to be turned off
    
  •  Corrected a motion restriction setting
    
  •  Added the ability to select multiple sensors instead of just one for each requirement in the restriction setting, if you select multiple contacts they all must be in the required state
    
  •  Added the AllPresent option for presence and beacon sensors
    
  • 1.4 Fixed button held
  • 1.3 Added the ability to disable the instance of the SmartApp
  • 1.2 Added additional requirement options
  • 1.1 The smartapp now only asks for the numberofbuttons and if it supports holdableButton if the information isn’t provided by the DTH
  • 1.0 Initial release

Here is an example:

The source code is available on GitHub

I have only been able to test about half of the functions since I don’t have all of the devices that are currently in this smartapp.


(Roy) #2

Hi @Terk,

This is GREAT, just what I was looking for seeing as for some reason recently, I’ve lost the ability to “push” notifications when setting routines, all I have is contacts.
I liked the comfort as all of are seen to be away, I’d receive a push stating the alarm was then set. But for a reason, I don’t know, I no longer have that option. Now this allows me to receive all sorts of Push notifications for things I may want them for. Many, many thanks! Tested it on my back door contact, and received my first push telling me it was open. Great!!

Thanks again


#3

Hi

Just to be devil’s advocate, stir the pot, ruffle some feathers… What advantage does this app give me that CORE doesn’t? For all I know I may a legit usage case waiting for a solution! :slight_smile:

Thanks
J


(kojak) #4

Its a good start, but it is a work in progress for sure. I just tried to use it for my kitchen lights using motion and I already found a few problems.

First off, I have 2 motion sensors for the kitchen so they are able to see the entire kitchen. One is by the sink and the other is by the entrance to the kitchen. With CORE I am able to use these together so that the lights will not turn off unless both sensors stop sensing motion.
With your app this is not possible because each motion sensor trigger is set up separately to turn on or off depending only for state of that sensor. This is a problem for me for sure.

Second I have CORE to turn off kitchen lights when motion has not been detected for 5 min. That way if by chance the sensors don’t see me for a few seconds or even a minute it will not turn the lights off on me. Again your app is missing the option for delay on motion sensor and also for lighting.

Third, I have my kitchen lights in CORE setup with latching and a variable so that if the lights are already on the motion sensors will not have any effect on them. If already on it will not turn them off when motion is not detected. This is great so that way if I know I may be in the kitchen for a while and don’t want to take the chance of the lights turning off on me. Not able to do that with your app.

But hey I am not trying to be rude or anything. Its a good app, just not going to work for me at this time. I can tell you that it is better than anything I could have designed because I don’t have the coding skills. Hopefully you can implement these options and I will be able to use it in the future.


#5

Great, I’m glad you found a use for it, thanks for letting me know which functions worked for you!


#6

Thanks for the creative feedback, I’ll look into adding those features in a future release.


#7

One advantage is the simplicity of setting up the automation. CoRE is definitely powerful but it can be intimidating for some people to setup.


(Dana ) #8

This looks interesting - excellent to contribute to the community.

Just wanted to note that you might want to make this available for IDE integration to make it easier for folks trying this out to keep up w/updates. I just tried to add this to my IDE and got:

“You don’t have access to therkilt/SmartThings-Projects”


(Roy) #9

Yeah! Got my push back

Thanks @Terk :yum:


#10

I made this available via IDE integration at https://github.com/therkilt/SmartThingsPublic/tree/master/smartapps/terk/automation-director.src I’m trying to edit the first post to update the location but it doesn’t seem to want to let me edit it now that people have replied to it. Update, I had to use the pencil at the bottom instead of the top, so the location has been updated.


(Dana ) #11

Thanks! Just added your repo and updated. :slight_smile:


#12

I think if you’re already using core and it works for you, you should just keep using core. It will do everything that this smartapp does and a lot more.

But the challenge with core is that it’s really technical. Just trying to explain to somebody what a “latching piston” is will tell you immediately whether they have a programming/technical background or not. :stuck_out_tongue_winking_eye:

There are quite a few people who have tried to use core and ended up deciding that they will only use it when someone in the core peer assistance thread gives them the exact piston they need for a particular use case. Which is fine, there are a lot of people who are glad to help, but it is a little unsettling.

So I think this smartapp creates another option, and why not? I particularly like the visual presentation, because I think that’s one of the areas which is really daunting to non-technical users of core.

Choice is good. :sunglasses:

BTW, those who want to combine multiple sensors into a zone can use @mike_maxwell’s zone manager and then just put the zone manager master sensor as the trigger in this Smartapp.


(llcanada) #13

@Terk I agree Core is and can be imtimidating especially for non programmers like me. is there anyway to flash a light for a number of times when a button is press or held?


#14

CoRE is the only app I’m aware of that can do that at the moment. I can add that but I’m not sure how quickly I can get to it.


#15

@Terk thanks for putting this together; saving me a lot of time and effort!

Very new to this and still learning how the code works, so bear with me.

I have noticed an issue with the way the temperature readings are handled with a time schedule. It appears that the temperature related events are only triggered when there’s a change in temperature. Normally this would make sense, except when there’s a begin/end schedule. What would need to be done to trigger a temperature event at the beginning (and less importantly end) of the schedule?

Also, having an option to turn off/on any switches after the schedule is complete would be great.

I wish I could contribute more directly to the code, but at this point I’d do more harm than good.

Thanks!


#16

Can you give me an idea of what schedule you are referring to? Screenshots of your setup may help me understand what your trying to accomplish. Thanks.


#17

Sorry - by schedule I meant Restric when to run.

Here’s an example of what I mean. The setup was to turn on AC if the temperature was above 70, and the time restriction was between 3:50 and 5:50. The action didn’t execute until there was a change in temperature during that time period (it was at 72 at 3:50, then registered 71 at 4:01 when the AC was then turned on).


#18

Ok, thanks that makes sense. The way that rule is setup currently it is only triggered by temperature changes and restricted on when to execute the actions which is why at 3:50pm it didn’t proactively check the temp and turn on the AC, but instead waited until the temperature changed within the restricted time frame to trigger the action.

I would need to create a new trigger of schedule so at 3:50 exactly or Sunrise or whatever is set it would check the restriction of temperature being above 70 before it would execute the action of turning on the AC. I will add this to the changes I want to make to the app but I don’t know when I’ll be able to get it finished.

If you need this soon I’d recommend CoRE even though it can be a challenge to setup it is much more widely used so most of these possibilities have been addressed in the app, if you know how to setup the piston (although there are usually plenty of people willing to help create the piston). In this case the piston would look something like this:


#19

Awesome; thanks a lot!

I set up the pistons in CoRE yesterday. Works fine and is triggering right at 3:50, but is pretty cumbersome to set up. I understand the flexibility it offers, but I prefer to be a simple minded person when possible.

Anyway, thanks again.


(Mark) #20

@Terk

Thanks for a great app!

Would it be possible for you to add a delay function into it at some stage please. For example, I have the kitchen lights come on when there is motion in the Dining Room and have them turn off when there is no motion in the Kitchen but the lights turn off instantly whereas it would be great if you delay that off action by x minutes under Configure Motion (as you can do in Smart Lighting). Not sure if anyone requires a delay for the ON actions so perhaps just add a “OFF Action Delay” to to bottom of the Configure Motion page, not sure if that would be the easiest way or not of course.

Also, probably too much to ask but in the future perhaps you could have all the Automation Director created apps list under the Main Automation Director App with an option to add a new one at the bottom of the list, again, similar as to how it displays them in Smart Lighting. It is not that important but it allows you to see exactly what is configured under the one App, useful when you have dozens of Automatons set-up.

Thanks again!