TexMike Posted May 20, 2019 Posted May 20, 2019 Not really a noob, been having great fun and success with ISY for a couple of years. One gaping hole in my functionality is the lack of a reliable geofence for multiple Android phones. UDI Mobile looked like a great solution, light weight client and portal integration, but it just doesn't work, see link below. @Michel Kohanim said they have something in the pipeline, but in the mean time I thought I would tap the collective knowledge and see what the best practices are. While I would be comfortable managing Tasker on my phone, I need to geofence four Android phones to include wife and kids so Tasker doesn't meet the requirements of a lightweight client easy to manage client for family phones. Locative is no longer available for Android, so it's no longer a possibility. Also, I want to be able to trigger my "Arriving Home" program, so I need a true geofence, network connection status would be too late (close) to be effective. Please chime in with best practices for geofencing multiple Android phones. Thanks, Mike
simplextech Posted May 20, 2019 Posted May 20, 2019 Well there are as many "hacks" and opinions to this subject as there are solutions. I started, ran, shutdown a system specific to this use case Simplex Locate. It was not cost effective on my part but it was cheap for users. Too bad users want free and so I shutdown. Anyways... This is what I use for myself now. Amazon EC2 Instance running Traccar server. This is the connection point for GPS trackers to send data to. This runs all the time and costs very little each month. I have GPS trackers in my vehicles that update every 5 seconds to give me very accurate location information. We also have android/iphone with the Traccar client. The client is not updating as quickly otherwise it would kill the phone battery. I wrote a nodeserver that uses polling to pull data from the Traccar server and create the geofence devices to create rules from. This is early beta and I've been running/using it and it works well for me. YMMV. What I've found from a year plus of exploring this subject extensively is that using phones for GPS location and home automation are slow and not appealing when you want things to be reliable and fast. If you want fast and reliable you need GPS trackers connected to a real GPS system with geofence capabilities and push notifications. If you want decent fast and reliable you use the same setup but polling the GPS server (what my nodeserver currently does). At some point I plan on moving the nodeserver to polyglot cloud at that point Traccar can send live event feeds to the nodeserver causing programs to then run in realtime. This is what I did with Simplex Locate and it was excellent.
TexMike Posted May 20, 2019 Author Posted May 20, 2019 @simplextech Thanks, when you get the nodeserver running on PGC, I would certainly give it a try.
TexMike Posted May 22, 2019 Author Posted May 22, 2019 Can anyone recommend a functional solution that is currently available? Thanks.
Geddy Posted May 22, 2019 Posted May 22, 2019 @TexMike Do you happen to have any Echo devices in the home? If so, have you looked at Alexa location routines and reminders? I'm not sure how it works on 4 phones, but each phone would need to be assigned within the Alexa account. It works for us with 2 phones (iphones) as household users of Alexa. I have general routines and alerts setup that work flawlessly. If you're trying to do more complex triggers with the ISY it might be more difficult. The good thing is you don't have to have any apps running (at least not on our iphones). Doubtful that Google Home has anything similar at this point. I gave up on those like Google gave up on making Chromecast a viable streaming "platform" and just a "stupid" device. Perhaps you can check with @James Peterson to see if he has any geofence triggers going into Agave development.
LFMc Posted May 22, 2019 Posted May 22, 2019 1 hour ago, TexMike said: Can anyone recommend a functional solution that is currently available? Thanks. Just brain storming... If one needed a simple geo-fence for smartphones just for coming and going near your wifi network and your ISY (i.e. our home for most of us) is there a way to use the ISY or a node server to ping the a phone's IP address and send a signal when it changes from responding to not responding and vice versa. This could be limited to every 15 seconds or so depending on the "accuracy" needed to set off a program on the ISY. I typically have network linkage to my home router as I pull in the driveway. Any way to use ISY network resources a node server to do a ping and read the response?
TexMike Posted May 22, 2019 Author Posted May 22, 2019 4 minutes ago, LFMc said: Just brain storming... If one needed a simple geo-fence for smartphones just for coming and going near your wifi network and your ISY (i.e. our home for most of us) is there a way to use the ISY or a node server to ping the a phone's IP address and send a signal when it changes from responding to not responding and vice versa. This could be limited to every 15 seconds or so depending on the "accuracy" needed to set off a program on the ISY. I typically have network linkage to my home router as I pull in the driveway. Any way to use ISY network resources a node server to do a ping and read the response? @LFMc Good idea and I know people use Tasker to detect network connections. One of my use cases requires early triggering, if I open the garage door before the network connection is detected, alerts will go off, lights will start flashing and Alexa will be screaming "intruder alert". I need to detect if a phone is inside a geofence early enough to run my arriving home program. Thanks, Mike
LFMc Posted May 22, 2019 Posted May 22, 2019 8 minutes ago, TexMike said: @LFMc Good idea and I know people use Tasker to detect network connections. One of my use cases requires early triggering, if I open the garage door before the network connection is detected, alerts will go off, lights will start flashing and Alexa will be screaming "intruder alert". I need to detect if a phone is inside a geofence early enough to run my arriving home program. Thanks, Mike Put another access point up front where you come in. (-; I have my second access point up front and it covers my driveway fairly well. I guess when the network connection is made, you could flash your house lights to signal you it is OK to open the garage door. I may have answered my own question. I guess there are several ways to do this. I just realized I can use my Node-Red server running on my Rpi to do the ping and signal my ISY to my presence. Sounds like another fun project to add to the list. Now if I could just get it to tell Alexa to warn me when the wife drives up to start looking busy to impress her...
TexMike Posted May 22, 2019 Author Posted May 22, 2019 52 minutes ago, Geddy said: @TexMike Do you happen to have any Echo devices in the home? If so, have you looked at Alexa location routines and reminders? I'm not sure how it works on 4 phones, but each phone would need to be assigned within the Alexa account. It works for us with 2 phones (iphones) as household users of Alexa. I have general routines and alerts setup that work flawlessly. If you're trying to do more complex triggers with the ISY it might be more difficult. The good thing is you don't have to have any apps running (at least not on our iphones). Doubtful that Google Home has anything similar at this point. I gave up on those like Google gave up on making Chromecast a viable streaming "platform" and just a "stupid" device. Perhaps you can check with @James Peterson to see if he has any geofence triggers going into Agave development. Interesting... Didn't know Alexa could trigger on location, but sure enough I just set up a test routine. I have both Google Homes and Echo's, I've found Google better at correctly identifying devices so I use it for all my spoken commands. However, I use Alexa because I can make it say stuff. I wish Alexa could send a REST command to change a variable, but the only usable option I see is to run a program or I could toggle a dummy device. The only complication is I don't have portal accounts for the kids and with no restrictions available, they would have full access. Not a big deal, they are good kids, I would just have to give them a warning not to play around with anything. I will definitely give this a trial run and thanks for information.
TexMike Posted May 22, 2019 Author Posted May 22, 2019 8 minutes ago, LFMc said: Put another access point up front where you come in. (-; I have my second access point up front and it covers my driveway fairly well. I guess when the network connection is made, you could flash your house lights to signal you it is OK to open the garage door. I may have answered my own question. I guess there are several ways to do this. I just realized I can use my Node-Red server running on my Rpi to do the ping and signal my ISY to my presence. Sounds like another fun project to add to the list. Now if I could just get it to tell Alexa to warn me when the wife drives up to start looking busy to impress her... I do have an access point in the front of the house, but still with polling delays, etc, I wouldn't want to count on it to be timely. Wife is getting more friendly with home automation and using it more with spoken commands and such, but I don't think I want to tell her to sit in the driveway until she gets an OK to open the garage door:-) Why couldn't you have Alexa announce your wife's arrival?
Geddy Posted May 28, 2019 Posted May 28, 2019 On 5/22/2019 at 5:43 PM, TexMike said: The only complication is I don't have portal accounts for the kids and with no restrictions available, they would have full access. Not a big deal, they are good kids, I would just have to give them a warning not to play around with anything. I will definitely give this a trial run and thanks for information. You don't need portal accounts for the kids. The portal is only tied in with the primary account. It's about having access in the Alexa app on the phones. Kids will look for something new and something they can do in the app (trust me...I've got a good 13 year old, but he's always wanting the Alexa app on his phone so he can turn his light and fan on/off). Last thing I want is for him to be turning lights on/off in the middle of the night. So he doesn't get phone access in the room overnight. Anyway, once the skill is linked with your portal account just running the apps on the phones should allow Alexa locations to trigger as they enter/leave geofence areas. It's certainly the easiest way that I've attempted without having to get into the subscription method with MobiLinc. I have MobiLink Pro without the connect and just connect through the port forwarding. But, I don't think it works as well on Androids. @LFMc You certainly can get Alexa to announce arrival. The location alerts allow the devices in the house to announce arrival for people running the app. I know our Echo and Dots alert my family of my arrival from work. It somewhat freaked my electrician when he was here and I ran out for a meeting and came back. He thought it was cool, but a little creepy at the same time.
LFMc Posted May 28, 2019 Posted May 28, 2019 11 minutes ago, Geddy said: You certainly can get Alexa to announce arrival. The location alerts allow the devices in the house to announce arrival for people running the app. I know our Echo and Dots alert my family of my arrival from work. It somewhat freaked my electrician when he was here and I ran out for a meeting and came back. He thought it was cool, but a little creepy at the same time. Yep, found it by updating my app. Thanks.
TexMike Posted May 29, 2019 Author Posted May 29, 2019 @Geddy The kids both have their own Alexa accounts for the echo's in their rooms. The problem as I see it is how to notify ISY of Alexa geofence status. No HTTP or REST capability, so the only way I see is to change the state of a dummy device and to do so their Alexa accounts must have access to the ISY portal and since it's all or nothing access, they would have full access. Is there another way, am I missing something? For now it's really a moot point because the Alexa geofence is not working reliably. It seems that Android Pie has concentrated so much on battery saving and limiting background task activity that it has broken geofencing. It will work if the Alexa app is open in the foreground, but even with battery optimization turned off for the app, it will not work reliably in the background. This is probably what broke UDI Mobile too. I've looked at IFTTT (never really in the running because it's too slow to update), Tasker Autolocate, Life360 and Auto Magic and all the forums are full of people saying they have problems recently on Android, ios seems to work fine. Until UDI or @simplextech comes through with a solution, I'm going to continue to look at Auto Magic for the following reasons. It uses the Google location API (called modern method) so should be best case for Android Pie compatibility One app for geofencing versus needing Tasker and Auto Locate Can issue HTTP so compatible with ISY portal location nodeserver and can send REST commands Can combine WiFi and geofence status. Great to reduce false positives on exit, but no help on signaling early entry Some users claim success using multiple geofences, outer entry turns on inner scan using settings that react quicker, but would kill battery if used all the time. I still have a ways to go to see if I can get it to work. Can export/import flows. While it's not anywhere near a lightweight client, that would help if I did need to set it up on other phones. So bottom line for now, I still have to issue a spoken or press a bookmark that runs my arriving home program via a REST command when I get close to home:-(
simplextech Posted May 29, 2019 Posted May 29, 2019 @TexMike, I have not looked at AutoMagic but I did find the link to it and it does look interesting. There's also Automate for Android that is akin to the functionality. I have to agree that the Task + Auto Locate can be a hassle to work with and Auto Locate has been reported many times to be a battery drain if not done correctly. I gave up for the most part with Phone based GeoFencing after Google made so many changes to their Location API's that the developer of EgoGeoFence just gave up and called it quits. That really was an excellent Geofencing app as it didn't consume too much battery and was local to the phone sending HTTP requests to your endpoint (ISY in this case) to trigger the event. GeoFency for iOS is much the same and I've heard a lot of good things about it and it also supports beacons which adds a nice factor to it. The system I have been using is based around stand alone GPS hardware and not phones. These are OBDII vehicle units, hardwired or battery powered portables. The powered units in vehicle work great but are expensive upfront for a quality unit and there's the cell cost to consider depending on your update frequency you want. From a practical stand point in a vehicle anything slower than 15 seconds is too slow for practical use otherwise the geofence has to be huge. This fast update requirement becomes very costly with the existing GPS fleet providers. The system I was running was much more affordable but with only a few users I couldn't sustain it (as mentioned before). The Traccar nodeserver I've been working on uses the Traccar GPS server system and is compatible with lots of trackers. The current nodeserver uses polling but you can set the level to 1 second if you want (I don't advise it) but you can. However this is again dependent on the GPS device update frequency which will be based on your cost for a data SIM. This system is compatible with the Traccar mobile client, but now we're back in the same problem area of Android killing background processes. I've reverted to looking into an older project I worked on a year ago focused around beacons. The problem I found with that scenario (at the time) was the lack luster range of common beacons for in vehicle use to penetrate the walls to a gateway to then trigger the present status. This may have changed some in the last year with higher powered beacons and weather resistant that could now be mounted to the outside of a vehicle rather than sitting inside or with weather resistant gateway's that could be external to the garage with wifi. I'm going to try this approach again. I've contacted a few BLE suppliers of beacons and gateway's to try and find a good gateway system with local connectivity rather than cloud connectivity to try and package into a solution. No luck yet as everybody thinks the cloud is the bee's knees. This is all fully possible and documented with many DIY setups, however I prefer to provide clean solutions that are consistent. The GPS route with hardware devices has for me been the most consistent and reliable with quality GPS units (Calamp preferred) but it is not a cheap system by any means nor is it for everyone. The cheaper GPS units tend to have connection issues and are sometimes "late" in their responses which is fine for 99% of common GPS use but for geofencing for events/actions the late responses can be frustratingly annoying and the jitter from those devices (vehicle bouncing out and back in the geofence at 3AM) is annoying with the garage door opening for no apparent reason Links to apps discussed: https://automagic4android.com/ https://llamalab.com/automate/
TexMike Posted May 29, 2019 Author Posted May 29, 2019 @simplextech Yes, I forgot to mention EgoGeoFence, looked great until I read the developer got fed up with trying to keep it running and threw in the towel. Perhaps Android phone based GPS will never meet my seemingly simple needs. Thanks for the input and I'll stay tuned to your progress. Thanks, Mike
simplextech Posted May 29, 2019 Posted May 29, 2019 Many have had good luck with Life360. I use that on our phones as I also developed the HomeSeer plugin for Life360. It works well for some and not so well for others. I think most anything on Android currently is going to have issues though. I don't have a newer Android device but is there no way to turn off battery optimization anymore? Used to be a per app level... [EDIT] I do use Life360 but not for GeoFencing or automated events. Thought I'd clarify that
TexMike Posted May 29, 2019 Author Posted May 29, 2019 1 hour ago, simplextech said: Many have had good luck with Life360. I use that on our phones as I also developed the HomeSeer plugin for Life360. It works well for some and not so well for others. I think most anything on Android currently is going to have issues though. I don't have a newer Android device but is there no way to turn off battery optimization anymore? Used to be a per app level... [EDIT] I do use Life360 but not for GeoFencing or automated events. Thought I'd clarify that You can still turn it off at app level and I always do when testing, most geofencing apps don't work at all with it on and sometimes work with it off.
Geddy Posted May 29, 2019 Posted May 29, 2019 @TexMike I don't have the Alexa feed back to the ISY. I have a program that I linked to the Alexa skill and it can activate the program upon arrival, but for ISY location I've been happy with the MobiLinc ability (again, on the iPhone). Sucks that Android doesn't allow the location to update Alexa if not active. Just another over sensitive setting in Android that went away as the OS advanced. Good luck getting something soon. Sounds like it's OS issues more than app driven dependability.
markv58 Posted June 5, 2019 Posted June 5, 2019 I have a RPi 3 B+ Polyglot running the Presence Poly node in my garage. It pings my iPhone and Watch bluetooth, it can also ping the ip but that can be a bit unresponsive if the phone is locked. This has been working for me quite well for some time now.
TexMike Posted June 6, 2019 Author Posted June 6, 2019 Thanks, I'm rethinking my approach and looking at adding a delay when the garage door opens while in away mode to make time for a network connection based arrival status. Much simpler and more battery efficient then trying to get a geofence to reliably trigger. Won't give HVAC a head start, but I can still manually initiate my "arriving home" program or adjust stat remotely if I know HVAC needs recovery time. Some compromises, but would meet the goal of having an automated arrival.
larryllix Posted June 6, 2019 Posted June 6, 2019 For several years here, I have seen reports that Android cannot do geofencing while iPhones work quite well. My phone only identifies one tower beacon so it cannot tell location, only aprox. distance in any direction.
Athlon Posted June 6, 2019 Posted June 6, 2019 Using the Alexa app on my iPhone here with great success. It makes an announcement when either of us arrives home, and turns the driveway and garage lights on if it's after sunset. I could easily have it trigger a program on my ISY, but I don't have a need for it to do so. I suppose I could have it open either of our garage doors upon arrival, but I'm not comfortable with that capability for now, so the only thing I use my I/O Link for is to text me if a garage door has been left open while we are not home.
TexMike Posted June 13, 2019 Author Posted June 13, 2019 To tie a bow on this topic for now, this is the compromise I ended up implementing in case it helps anyone. Use Automagic to toggle presence in ISY based on Home WiFi connectivity. Had to debounce disconnects since WiFi will sometimes momentarily disconnect, so I wait 20 seconds and recheck before setting ISY presence to false. When presence is false in ISY wait another minute, then check to see if garage door is closed, doors locked, etc. So the person who just departed will get an alert within one minute if the house was left unsecured. Automagic uses google families, so I don't have to purchase again for wife and kids and with ability to export/import flows, it's not too troublesome to set up on multiple phones. Since the objective to automatically run my "arriving home" program a few miles out via geofence was crushed because of unreliable geofencing on Android Pie, I took a different approach. If I don't manually run "arriving home" and ISY is still in away mode when the garage door opens, I change the mode to home. Considering I have a modern garage door opener with rolling codes and I will get a Pushover notification that mode was changed from away to home, it seems an acceptable risk. Unless I run "arriving home" manually (via spoken or press bookmark icon on phone) I won't get desired arriving lighting and HVAC recovery time. So it's a compromise and doesn't meet the fully automated goal. Until something better comes along...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.