What settings are you guys using for best battery life?

Posted on
Tue Sep 22, 2015 10:57 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

What settings are you guys using for best battery life?

I thought I had set fairly moderate settings but I'm seeing 10% battery drain about every 2 hours with the phone sitting on the table locked, in my Home geo. Maybe my idea of moderate is skewed? Here are my settings, I'm not sure that polling any slower than this is going to be useful for the things I want to do.
Attachments
Screen Shot 2015-09-22 at 9.55.07 PM.png
Screen Shot 2015-09-22 at 9.55.07 PM.png (95.62 KiB) Viewed 3851 times

Posted on
Thu Sep 24, 2015 3:22 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: What settings are you guys using for best battery life?

Bueller? :mrgreen:

Posted on
Sat Sep 26, 2015 3:32 pm
nev offline
Posts: 48
Joined: Aug 19, 2015

Re: What settings are you guys using for best battery life?

I am just using the default settings and wanted to make it more active (by reducing the times), but my battery really gets drained quick. iFindStuff is an amazing, actually astounding plug-in which has a huge potential in what it can do now, but will be able to do in the future. However, it does suck battery quickly because its getting pinged by FindMy iPhone. Before this plug-in, I was using geo fences in IFTTT (iOs channel) to create a file (eg. Left work) on my Gdrive which my mac would see and execute the scripts that i want to run as i am on my way home for example. I was thinking of again utilizing it to active and deactivate the iFindStuff device when i arrive and leave work. Then, the iPhone would be the one controlling the frequency of FindMyIphone pings. When you left work, the iFindStuff app would take over in all its glory lol. The other way would be if the iPhone Indigo app would do this, but until then the IFTTT iPhone app may be the answer.

Now if there was a way to create a channel for IFTTT to use to integrate with iFindStuff plugin, that would be the best. IFTTT app could directly tell iFindStuff to start up again or activate that iFindStuff device.

I may be totally off with my logic of how everything works, but it makes sense as i see it with what i currently know. I am curious of other's experiences?

Posted on
Sun Sep 27, 2015 4:15 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: What settings are you guys using for best battery life?

It was always going to be a playoff between battery life and functionality. There's no doubt that it does impact the battery life but I don't see as much of an impact on my iPhone 6 which might be simply that the battery is new and on my son's iPhone 6 plus it hardly dents it with the right setting. If you're polling the Find My Phone every 60 seconds then you'll see a high impact. I tend to use 5-10 mins between polls and that gives me a balance between battery drain and functionality.

The alternative to IFTTT is to use Life360 (http://www.life360.com) but although you can get one GeoFence free the rest will cost you a monthly fee of $5.99. That said it works pretty well and with any phone - it just isn't integrated into indigo. You can get some integration by using the send an email feature which I used to trigger indigo events but it's too slow for me. They keep promising an API for 3rd parties but it hasn't arrived on the scene yet. If it ever comes to fruition I'll integrate iFindStuff with that instead :D

The original use case for iFindStuff is a result of me a) proving it could be done :roll: , b) wanting a more responsive & flexible geolocation solution that was free at point of use and c) as a response to people who wanted more NEST Home functionality. I'm researching ways of managing performance and saving battery life (Night, Holiday and Power Saving Geofence modes are an example of that - I should point out that Stationary isn't yet because I haven't implemented it fully). I think that we could use scheduling as well to impact when checks are made and the algorithm could be more intelligent on when it needs to check a device rather than following a strict cycle.

One example of this is a second piece of code that I developed called 'Wasp in the Box'.

You can read my original post on that here: http://forums.indigodomo.com/viewtopic.php?f=133&t=13343&p=91333&hilit=wasp+in+the+box#p91333

I don't use iFindStuff as a presence indicator in the house. Actually I use a number of 'rules' that together give me a probability that the house is, or isn't, occupied. As the only way to leave the house is via a door and these all have sensors, then I know if I need to check presence if someone leaves otherwise if I know they were there a while ago and none of the doors have been opened then they must still be there (unless they've used the windows and they've got sensors as well :D). My article gives a better explanation. Upshot is that if a light is switched manually, or the TV is on, or the iron is being used, or the motion sensors see something, or my son's computer is on, etc... then I know that there is someone in the house. Once I know that then I only have to check again if one of the outside doors, or windows, is opened. The combination of rules means that I can make intelligent decisions about presence so that I can eliminate some false results (e.g. the dogs or cats moving about). I'm happy to share the code if anyone wants to see it - but it is rough.

I've started to apply the same type of logic to iFindStuff. For example, if I've left (the house is empty based on the Wasp algorithm) I start to look at other things. Is my distance from the Home getting bigger on each check? - if so then reduce the checks because I'm moving away from the house. By the same argument, if it's getting smaller then increase the frequency of checks because I may be coming home. It's a little more complicated than that but you can see the start of a logical method. The same argument applies to stationary. I could also introduce 'time' as a factor as well as an 'I'm out at a meeting according to my calendar so don't bother checking until after this time...'

The ideal solution would be to have a solution actually on the phone itself so that it can trigger the update frequency depending on what's happening on the phone itself. Of course, that requires an app but I'm starting to look at that as well now. The only issue is that I have to learn SWIFT and JAVA to make it work, then get it through the Apple process, to get it on the Store. That's said, it's a challenge so I'm going to give it a go and maybe I can solve this issue using an alternative approach. Let's see - just watch out for improvements and updates because they'll all be focussed on performance for the next few weeks.

IFTTT, unless it's integrated fully, is very slow to respond to events as well. I know that the Indigo Community has been lobbying IFTTT for a channel but no response. If that could happen there are a whole raft of development plugins that would follow :mrgreen:

Regards

Mike

Posted on
Sun Sep 27, 2015 10:35 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Re: What settings are you guys using for best battery life?

Mike,

That was a great explanation and is certainly something to think about - I really need to re-read your Wasp in a Box post.

I'm still putting all the pieces together, adding devices, tweaking settings, adding triggers and schedules when something crosses my mind. One thing that've been thinking for some time is what I'm calling vector tracking. Now, iFindStuff with or without other plugins may already be able to this, but I'll explain myself anyway.

A way for Indigo to know I'm coming home based on my path and not my location - I might be near my house but don't intend to go home. For example, I leave work, next I'm at the train station, then at the midway point home, next up is I arrive at my destination train station, and finally I'm approaching the house. All these locations are to determine the probability that I'm coming home, similar to what it sounds like you're doing.

Reason I'm mentioning this is I like to read what others are doing with Indigo, like you previous pos, so just throwing this out in case other have done something like this and are willing to share how.

As for working on an iOS app and trying to get it through the AppStore, well, you don't have to. iOS 9 allows anyone to sideload apps now.

Simon

Posted on
Sun Sep 27, 2015 12:15 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: What settings are you guys using for best battery life?

Shutter wrote:
Mike,

That was a great explanation and is certainly something to think about - I really need to re-read your Wasp in a Box post.

I'm still putting all the pieces together, adding devices, tweaking settings, adding triggers and schedules when something crosses my mind. One thing that've been thinking for some time is what I'm calling vector tracking. Now, iFindStuff with or without other plugins may already be able to this, but I'll explain myself anyway.

A way for Indigo to know I'm coming home based on my path and not my location - I might be near my house but don't intend to go home. For example, I leave work, next I'm at the train station, then at the midway point home, next up is I arrive at my destination train station, and finally I'm approaching the house. All these locations are to determine the probability that I'm coming home, similar to what it sounds like you're doing.

Reason I'm mentioning this is I like to read what others are doing with Indigo, like you previous pos, so just throwing this out in case other have done something like this and are willing to share how.

As for working on an iOS app and trying to get it through the AppStore, well, you don't have to. iOS 9 allows anyone to sideload apps now.

Simon



You and me both - I get my best ideas from others.

I like your thinking - predicting routes... I need to think about that some more. Good idea :) A sort of Wasp out of the Box concept.

I didn't know about iOS9 sideload apps - I'm reading about that now. Thanks for the tip :-)

Mike

Posted on
Sun Sep 27, 2015 7:04 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: What settings are you guys using for best battery life?

Mike,

Thanks for the response! I also need to re-read your Wasp In A Box post and think about that some more, perhaps I will try to implement some of that stuff for those who use iOS devices in my house. I love the ideas you've outlined and am actually glad to hear you haven't really implemented the stationary detection yet, because I think that has the potential to damper the battery drain enough for me to use it for presence tracking (I was pretty surprised to see the battery get hit so hard in my initial testing because I figured that the stationary mode would work). I will definitely be using this for its other features either way, so thanks again for the awesome plugin!

Posted on
Sun Sep 27, 2015 7:43 pm
nev offline
Posts: 48
Joined: Aug 19, 2015

Re: What settings are you guys using for best battery life?

Whether its Wasp in a box trigger or IFTTT trigger, I'd love a NEW FEATURE of iFindStuff where we can create an Indigo Trigger that has an Action to deactivate a device or change update frequency. Then we could use the best of both worlds. The phone app will tell iFindStuff to startup again if we exit a geolocation.

Posted on
Mon Sep 28, 2015 5:09 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: What settings are you guys using for best battery life?

nev wrote:
Whether its Wasp in a box trigger or IFTTT trigger, I'd love a NEW FEATURE of iFindStuff where we can create an Indigo Trigger that has an Action to deactivate a device or change update frequency. Then we could use the best of both worlds. The phone app will tell iFindStuff to startup again if we exit a geolocation.


Actually that used to exist but I took it out because no one had a use for it :D I can put it back in. The use case reads something like this:

1. Indigo Trigger. If event occurs then toggle activation state of a device/activate a device or deactivate a named device
2. Indigo Trigger. If event occurs then cause an immediate refresh of a device
3. Indigo Trigger. If event occurs then change update frequency to a value held in a variable for a device

Is that what you've in mind?

Regards

Mike

Posted on
Mon Sep 28, 2015 6:52 am
nev offline
Posts: 48
Joined: Aug 19, 2015

Re: What settings are you guys using for best battery life?

Yes, EXACTLY for 1 & 3. But one (2) think is already there... Wow thats perfect Mike!


Then I can use iFTTT (via iOS location channel) to activate/deactivate the device in iFindStuff, thus stopping batter loss only when I leave/enter work or home geo locations.

Posted on
Tue Sep 29, 2015 12:44 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: What settings are you guys using for best battery life?

nev wrote:
Yes, EXACTLY for 1 & 3. But one (2) think is already there... Wow thats perfect Mike!


Then I can use iFTTT (via iOS location channel) to activate/deactivate the device in iFindStuff, thus stopping batter loss only when I leave/enter work or home geo locations.


I've created the code for 1&3 now... but I'm testing it before a release tomorrow. Watch this space.

It does mean that you'll have a 'frequency' variable for each device in your set up that you'll have to maintain for #3 but that should be ok. I'm also going to set up a standard overall frequency variable and a command to match.

#1 was easy because the functionality already exists - I just needed to create an iFindStuff action for you to use.

Once I've tested it through tonight I'll release it tomorrow and let you know.

Regards

Mike

Posted on
Tue Sep 29, 2015 12:45 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: What settings are you guys using for best battery life?

nev wrote:
Yes, EXACTLY for 1 & 3. But one (2) think is already there... Wow thats perfect Mike!


Then I can use iFTTT (via iOS location channel) to activate/deactivate the device in iFindStuff, thus stopping batter loss only when I leave/enter work or home geo locations.


BTW - when you get it working it would help the group if you explained how you used IFTTT to trigger the events :D

M

Posted on
Tue Sep 29, 2015 5:38 pm
nev offline
Posts: 48
Joined: Aug 19, 2015

Re: What settings are you guys using for best battery life?

Ok, I'l be the first one to admit that this solution is clunky, but it works. I have been using this method to utilize ANY IFTTT channel with my Indigo setup which (thanks to the talented plugin developers) then interacts with my WeMo lights, switches and motion detectors, out door IP cameras, online weather station API, watering system, security system, Netatmo Weather Station, Nest Protect, Nest Thermostat....etc. Seeing how this thread was on battery life using iFindStuff, I'll stick to that in my explanation, but it can be applied to much much more.

Tools:
Indigo with iFindStuff plugin
IFTTT with iOS Location & Google Drive channels
Hazel app - watches for new files in a folder and then can execute a script based on the file name
GDrive app locally installed on Mac
IFTTT app on my iPhone

I setup an entry and an exit IFTTT recipe for each of the GeoFences I had setup in iFindStuff. Example: When I enter geofence1 (using iOS Location channel), then create a GDrive file called "Enter_geofence1". Then, that syncs to the GDrive app on your mac running Hazel. Hazel is triggered when it sees the file and runs the corresponding apple script.

apple script example: (where 12345 is the device ID number for my iPhone setup in iFindStuff)
indigo.device.enable(12345, value=False) #disable
set folderPath to ("MacPro:Users:MacPro:Google Drive:IFTTT") as text
tell application "Finder"
try
delete (every item of folder folderPath whose name begins with "Enter_geofence1")
on error
# do nothing
end try
end tell

Then the file is processed and deleted by the script. My iPhone is then deactivated until it leaves that GeoFence. When it does leave, then then the IFTTT app on the iPhone creates the new Gdrive file "Exit_geofence1" and it follows the same process, but for exiting the geo fence and re-activating the iPhone. This will stop battery loss and data use while I am in those geofences i spend most of my time. I know there are probably much better ways of doing it, but this is the one I landed on after a lot of playing around with other ideas. I'm sure someone is thinking, why are you doing all this when iFindStuff does it "out of the box". That is a great point and the only reason is that in my mind, the iPhone needs to trigger the leave event vs a server checking to see if its still there. Then when its on the move or not in one of the two geofences where you spend 90% of your time (home & work), then iFindStuff has it covered! Another reason I use this method is that I use it for many other purposes by utilizing many IFTTT channels in the same way. Another example is the WEMO motion sensor to set off my security alarm....

I hope this is useful to someone... Many Many thanks to iFindStuff & Nest Home creators, you rock!

Posted on
Tue Sep 29, 2015 8:53 pm
scsmith offline
Posts: 6
Joined: Sep 20, 2015

Re: What settings are you guys using for best battery life?

I've only just installed "IF" and see that it has potential, but it does seem a bit "clunky" as you put it. I see that IF can send an email when you enter/exit a geofence, couldn't you just send it to indigo's address and then let an indigo trigger do what you want? I'm still new to indigo as well, but that seems less "clunky" (no need for Hazel or Gdrive (btw, couldn't you use a folder action to check for new files/folders without hazel?)

However, I'm curious how IF's location is in terms of battery life. It still must poll the GPS on a fairly regular basis to determine whether you are in/out of the geofences?

Posted on
Wed Sep 30, 2015 7:55 am
scsmith offline
Posts: 6
Joined: Sep 20, 2015

Re: What settings are you guys using for best battery life?

I've been doing a bit of testing with "IF" on my iPhone, and it really does seem to work well, and so far doesn't seem to be effecting battery life significantly. I set up a "Recipe" using iOS Location to "if Entered" around my home then send email (using gmail) to my dedicated indigo email address. Using Better Email Plugin I sets a variable for "Scott's iPhone" to "Home" and increases a variable "occupants" to +1. I created another "recipe" for "if exit" around my home and it sends an email with a different subject, setting "Scott's iPhone" to "not home" and decreases occupancy by 1. Then I created a trigger to check occupancy and if 0 turn on alarm (etc) and another that checks if occupancy >0 to turn off alarm (etc). Then another if it increases past 1 to just turn on driveway lights (if dark).

It is not a "perfect" solution, but in just an hour of testing it does seem to do what I want/need. Better Email Plugin allows indigo to check for emails every 1 minute, and so far the emails from "IF" seem to be received almost immediately, so it seems to be effective. The main drawback is that it will require my spouse and children to run IF - which was the thing I like about iFindStuff (only requires phone to be on, and location services active), and I fear they won't always have it running - but I think with training they will "get it" :)

To test battery life I have temporarily disabled iFindStuff, and will report back after a day of testing (if anyone is even interested). I'm also setting up other geofences in "IF", like I had in iFindStuff to see how it effects battery life.

The main drawback I already see is that iFindStuff can make a really nice "control page" with maps where everyone is. It is also much "clunker" to setup (will need to set up IF recipes and Indigo triggers for each phone user, and multiple geofences will require more recipes and more triggers.

I am HAPPY to continue testing iFindStuff and help in any way I can to find ways to decrease the battery drain, and am very hopeful that "Chameleon" can get his plugin to perform as intended without killing the battery and using up a significant use of my phone's data plan. I'd prefer if it doesn't need an App on the phone to run, but if an App is needed to preserve battery life, IF could work well I think.

Off to go "exit" and "enter" some geofences and see how well it performs.

Who is online

Users browsing this forum: No registered users and 6 guests