[Updated] Presence Central

smartapp_presence
project_presence

(Andy - United Kingdom) #1

Presence Central
I created this SmartApp for my own use but thought I’d share it in case anyone else finds it useful.
I have been testing it for a while and it seems to work fairly consistently.
The reason I wrote this is because I had lots of separate apps controlling different presence actions.
I just wanted to bring everything together in on Parent/Child app

First of all I have to credit Brian Gudauskas (@bridaus -Reliable Presence) & Eric Roberts (@baldeagle072 - Everyone’s Presence) for stealing some of their code for multiple presence sensor determinations.

Without their great work this app would not have been possible to create.

This is a Parent/Child app to control presence sensor actions. Once installed you can setup any number of ‘child’ apps.
You need to install & publish the Parent in the IDE but there should be no need to publish the Child app

Inputs for events:

  1. Single Presence Sensor – arrived/departed

  2. Group Presence1 – This sets presence to ‘home’ if ANYONE arrives and sets presence to ‘away’ if ANYONE leaves

  3. Group Presence 2 – This sets presence to ‘home’ if ANYONE is present and sets presence to ‘away’ only once EVERYONE leaves.

  4. Group Presence 3 – This sets presence to ‘home’ if EVERYONE is present and sets it to away if ANYONE leaves

  5. Check for presence at a certain time - Useful if you want to do something at a certain time but only if someone is present

Actions:

  1. Control a Switch – Configurable for arrival or departure to turn on/off a switch

  2. Speak a Message – Using ‘Sonos’ or equivalent speakers to play a message when someone arrives/departs
    This has the ability to create a ‘quiet’ time so different volumes can be used at night/in the evening

  3. Send A Message – on arrival or departure (Push or SMS)
    Will use ‘Contacts’ if enabled on your account

  4. Change Mode – on arrival or departure

  5. Run A Routine – on arrival or departure

  6. Control a Door - open on arrival, closed on departure

  7. Control a Lock - Unlock on arrival, lock on departure

  8. Flash Lights - on arrival or departure

Each child app can be configured to be enabled/disabled via an optional switch.
There are also optional restrictions for mode, within a certain time period, sunrise to sunset & sunset to sunrise.

Latest Parent here: (Current Version: 1.0.0)

Latest Child here: (Current Version: 1.4.0)

This is integrated with GitHub if you want to use this to keep up-to-date with any changes I make.

Owner: CobraVmax
Name: SmartThings
Branch: master

Breaking News!
Presence Central is now included in the brilliant "Community SmartApp Installer"
So, it’s even easier to install and keep up to date


Life360 and ST presence sensor
Presence sensor smartapp that looks at state?
How to trigger routine with a delay
Smart home monitor when working late
Presence Sensor Automation combined with time of day?
Garage Door Opener Relay Smartapp
Poor Mans Garage Door Opener help
How to deal with multiple vehicles, multiple people and multiple garage doors?
Advantage of using home/away
Automation Routine Door Unlock?
(Keith) #4

I am installing now and will test with 2 presence sensors, garage door etc. I am actually using the webCoRE presence sensor app for one of the users so I will see how it goes.


(Keith) #6

My initial thoughts are to remove the, “Allow Actions from/until,” requirement. Or make it so you have to choose that or days of the week.

My first use was to control the garage door switch. If someone leaves, regardless of the time I want to evaluate the garage door sensor (open or close). If that sensor is open, trigger the garage door switch (momentary relay).

Thanks.


(Andy - United Kingdom) #7

@kxavier23
Keith
Good idea on the compulsion - It was just easier to code with forced entries, but I have re-coded it now
I have removed the requirement for both time and days
These are both now optional and will only apply if something is entered
(I might move them to the third page)

I’m not sure what you are looking for with the second part.
The door should report if it is open or not.
Are you asking for the ability to use an additional contact to confirm if the door is open or closed?

Uploading updates to GitHub in the next few minutes


(Andy - United Kingdom) #9

@kxavier23
Quick question…

Is your garage door controlled by separate momentary switches?
Do you use the same switch to open & close?

If so then I might need to look at re-coding the door section to use this, rather than separate open/close actions

I’ll look at putting this in anyway… might be useful for someone else


(Andy - United Kingdom) #10

Ok a few updates…

Door control

  1. Ability to control single momentary switch
  2. Ability to control two switches - one for open - one for close

I have added an optional contact switch to confirm/restrict operations


(Keith) #11

It might be easier to see my current piston in webCoRE

When one of the presence sensors leaves the geofence, I trigger the garage door switch (momentary contact DH). I wait 15 seconds (the time it takes to actually close the garage door), then send a message to the user that left. In the message, i am reading the current state of the tilt sensor on the garage door. Then when they get the message i know if the garage door actually closed.

Hope that makes sense.


(Andy - United Kingdom) #12

hmmm… this might be easier to stick with webcore - If you are already doing this then I’m not sure why you would change to use my app


(Keith) #13

I totally understand.

The reason I liked your app is that I am having issues with my piston. I was having similar issues with a room manager piston and someone made a cool app that has removed all those pistons.

Your app is actually pretty close to my piston which I have been having issues with. In my opinion, these apps are nicer and cleaner than my piston.

I would be more than willing to work with you to create/modify this app. :slight_smile:


(Andy - United Kingdom) #14

Ok…
I’ll have another look…
Originally I misunderstood your use of ‘contact’ sensor… I didn’t realise you meant tilt sensor.

So the additions I would have to make are

Add optional capability for 3-axis sensor
Optional input how long to wait for door to open/close before checking with 3-axis sensor
Find out if open or closed according to the sensor to confirm operation
Send confirmation sms/push


(Keith) #15

Awesome.

I am traveling for work today and won’t have time to test or provide feedback until maybe Monday.


(Andy - United Kingdom) #16

Ha!
it will probably take me longer than that to code :slight_smile:
As I work from home I only code during the week when my job is quiet…
I got told off too many times at the week-end that I was spending too much time on the PC and not enough with the wife :slight_smile:


(Andy - United Kingdom) #17

I just looked at your piston and realised that you are not using a 3-axis sensor - just a normal contact sensor…
That is much easier (I think)


(Keith) #18

Yes, it is just a, “Z-Wave Door/Window Sensor.”

Showing open/close.


(Andy - United Kingdom) #19

Much easier to deal with…


(Keith) #20

I am slightly confused on what the first device selection is. Is this the garage door, “switch”, which will actually trigger the garage door to open/close?

If so, I can’t select my contact switch.

Also, on the second screen:

  1. Actions - Would it be more appropriate to have anyone arrives or departs separate?

I am just wondering how I would set up only to close or activate a switch, light etc, only when either presence sensor leaves, because I may want to turn something on when we leave and off when we arrive. Or would you make 2 separarate triggers?

  1. #1 plays into this. In the case of a momentary contact sensor, such as a garage control, it would be turning it on both on arrival and departure. Not sure how to make that more flexible.

In general, how are you handling SMS/Push notifications? Is the text hard coded?


(Andy - United Kingdom) #21

In all the apps I create I always put an enable/disable switch on the first page
(Usually just a virtual switch)
This is because sometimes I might want to stop the app doing something… like saying a message when I’m having a doze on a sunday pm.
As this is optional you don’t need to configure anything here if you don’t want to… the app will just ignore it and work normally.

  1. If you want to have different actions for different people or the same action for different people but not as a group then configure multiple Presence Automations - one for each person
    I have different actions for myself and the wife
    Don’t forget this was originally created for my own use so uses only groups that I needed when I created it.

  2. Not sure what you mean

As for sms/push this has been configured for only part of the app… not finished yet - stillworking on it - hopefully get it finished tomorrow or monday

If you select single momentary switch as the action then input the contact at the bottom, then you will see a place where you can configure the messages and who to send them to


(Andy - United Kingdom) #22

Ok
I think I have completed the door section now - Uploaded new files to GitHub
Once you select the ‘contact’ you should have additional options to send a message via push or sms and the ability to configure the message and a delay before sending
Do you have the contact book enabled on your account? - It’s much better if you do as you can select ‘push’ for individuals as well as individual sms

BTW.
If your door control also presents itself as a contact (the virtual one does) then you could get rid of your contact on the door and get the door control to report open/closed (try selecting your door control as the contact to see if it will work.)

I have noticed that if you update then try to edit an existing automation it sometimes retains the old settings… better to delete and recreate the automation.


(Andy - United Kingdom) #23

Added ‘Flash Lights’ to presence responses


#24

Good Day Cobra!

I have been following these posts, and tried using your Smart App yesterday. Thanks so much for your work on this creative app!

Regarding the previous comments about the “Allow Actions from/until,” requirement, is it possible to modify the options for entering a specific time, to also allow a user to select sunrise or sunset?

I am trying to create 2 different versions of this app, which would run a different routine depending on whether I arrived home in daylight hours, vs. evening or nighttime hours. Obviously, using specific times for this is problematic.

Any thoughts are much appreciated.