Fully automated location, sleep and smart home monitor mode for any chaotic household

First post and project and foremost the reason why I joined Smartthings: to automate our chaotic household and save time and money by not having to manage everything.

Me and my partner have, due to the nature of our jobs, very different workhours (daycare, nightwork, etc). Also our cleaning lady needs to be taken into account.

So I created this piston, wich I would like to share with others who struggle to achieve stable automation of the basic modes.

The IFTTT entries are actually triggered by Tasker on our Android devices, wich track our location and sleeping cycles (charging state phone), and my calendar (cleaning lady).

Love to hear about any suggestions about optimizing the code. Since this is my first contribution.

Cheers

(edited: cleaned up some code)

4 Likes

This is awesome thank you for sharing.

1 Like

Logic is Solid. The Force runs deep in you!

1 Like

Nice. My brain just doesn’t work this way, so really appreciate it when others share their solutions. Our household definitely qualifies as chaotic too!

1 Like

Nice… and welcome to the community of contributors. A version that works without relying on Tasker for us iPhone users would be good. I have tried all sorts of screwy logic to account for our dog sitter and cleaning lady with limited success. One has an Android and one an iPhone and neither want to put software on just for me. So I have to rely on door open sensors and motion detectors when my phone isn’t home and same for my wife. How does Tasker know you are asleep?

1 Like

I think it’s based on phones being plugged in and charging.

We have iPhones in our house too (and don’t always plug in our phones at night anyway), so this piston wouldn’t work for me verbatim. But since I could never write something like this from scratch, it’s a great jumping off point!

Dogsitter and cleaning lady can be added to your own (google) agenda and thus trigger the Home mode. I use Tasker for this, but I can’t imagine there is no alternative. IFTTT can trigger when the event starts, but unable to send httpget when event is done. A presence keychain may also be a solution, another is to listen to wifi and scan periodically for mac-adress.

Sleeping is triggered by tasker: conditions are not between 18u-22u AND Phone charging AND at home (location). So we can charge our phone in the evening or at work, when battery is low, without triggering sleepmode. Alternatives may be, NFC tag, contact sensor on nightstand, pressure mat, etc. If you don’t charge your phone at night, you may try to trigger on the state of your phone like longer than 5 minutes inactive with screen down when at home and between specific hours.

This works for us. Your situation may differ, but unless you have grown up kids in the home alone, I don’t think this piston needs to be changed a lot. How to apply triggers on the other hand is personal. Personally I prefer Tasker, because it’s reliable, low cost. It’s also usefull to test new pistons when not at home.

Oddly enough there isn’t anything parallel to Tasker for the iPhone. The wifi scan for MAC address might work. I do have adult kids in and out of the house sometimes and they have a mix of iPhones and Androids. I think the best approach for me will be to continue using quiet down detection with motion sensors.