Statemachine w/ IFTTT for Presence


#1

I have a piston that works pretty darn well, however it does not like the internet being down or WiFi being turned off on the phone for obvious reasons. I think I need to turn this into a state machine. I have already added the necessary params in the IFTTT message, however the next step is not coming to me. I use WiFi check to determine if I am home and GPS for when I leave.

Here is what my IFTTT pushes in the body for me. It does the same for my wife.
{‘userIFTTT’:‘Frank’,‘presenceIFTTT’:‘home’,‘methodIFTTT’:‘Wi-Fi’}
{‘userIFTTT’:‘Frank’,‘presenceIFTTT’:‘away’,‘methodIFTTT’:‘GPS’}

Here is a copy of my piston thus far. I use global variables that can be then used as triggers for the home/away.

Thanks!
Frank