Page 1 of 2

Adding ring fencing to NEST Home

PostPosted: Sun Jul 26, 2015 9:25 am
by Chameleon
Hi all

I'm about ready to add location finding to NEST Home for iPhones and potentially other devices.

The plugin will run independently of NEST Home and will create devices that represent iPhones and iPads, their status and their location using the Apple Find my Phone API. NEST Home will be able to create 'ring fences' that allow you to control your heating depending on the location of a family of phones (e.g. if all phones are outside the HOME Fence then set to AWAY).

I'm going to run an Alpha on this in the next week or so. If anyone would like to try it out let me know.

Regards

Mike

Re: Adding ring fencing to NEST Home

PostPosted: Sun Jul 26, 2015 5:51 pm
by mikeL
I'm going to run an Alpha on this in the next week or so. If anyone would like to try it out let me know.

I'm using a capability like this based on fingscan to set home/away status for my Nest. I am interested in trying out your solution, too.
Cheers,
MikeL

Re: Adding ring fencing to NEST Home

PostPosted: Sun Jul 26, 2015 6:25 pm
by manoncloud9
I would be interested in this. I do not have a Nest.


Sent from my iPhone using Tapatalk

Re: Adding ring fencing to NEST Home

PostPosted: Sun Jul 26, 2015 7:54 pm
by Swancoat
Man, if you could get it working that well, I'd rather it be a whole separate plugin. I could connect it to the Nest plugin with a couple of triggers, but I'd like to be able to use something like that for other things.

Adding ring fencing to NEST Home

PostPosted: Sun Jul 26, 2015 9:36 pm
by kw123
There is a plugin "find my idevice"
It stopped working after Apple changed their security settings


Sent from my iPhone using Tapatalk

Re: Adding ring fencing to NEST Home

PostPosted: Mon Jul 27, 2015 2:14 am
by Chameleon
What I'm interested in is knowing where the devices are and if they are in a particular location. Fing is a great package but it will only tell me when the phones are at home and I'd like it to be more proactive than that and let me know when phones get within a certain distance of a particular trigger place - hence the new plug in.. I've also got a proof of concept system working outside of indigo which takes user information and returns iPhone status. I can achieve a similar thing in another proof of concept using Life360 for non-iPhones.

Since iOS 8 the API seems more stable and able to manage on-going calls to the API on locations but as usual we'll be at the beck & call of Apple. I believe they are more committed this time to their developers especially with a Siri API mentioned/stated again.

I will make the plugin run separately to others with the ability to use the information that it provides as triggers for other events or plugin solutions. I'm testing the pre-Alpha now and I'll include all of you on the Alpha list as I think field testing will be even more important.

Regards

Mike

Re: Adding ring fencing to NEST Home

PostPosted: Mon Jul 27, 2015 3:31 pm
by DU Lou
Mike, Will the plugin be able to support battery status on iOS devices? (Feature request)

Thanks,
~Lou


Sent from my iPhone using Tapatalk

Re: Adding ring fencing to NEST Home

PostPosted: Tue Jul 28, 2015 1:04 pm
by Chameleon
DU Lou wrote:
Mike, Will the plugin be able to support battery status on iOS devices? (Feature request)

Thanks,
~Lou


Sent from my iPhone using Tapatalk


Lou

It already does :D

Fields are:
    Unique Device Id Code (Alphanumeric)
    Type of Device (iPhone, iPad)
    Device Status (Apple Status Code)
    Battery level (Current level %)
    Name of Device (user set)
    Model Number (Apple defined)
    Location enabled (True/False - Setting defined)
    Is Locating (True/False - Setting defined)
    Date/Time Last Seen (TimeStamp)
    Location Fix Type (Cell, GPS or WiFi)
    Location Accuracy (m)
    Latitude
    Longitude
    Is Old (True/False - False if not connected on last refresh)
    Is Inaccurate (True/False - defined by Apple)
    Tracking (User set True/False - Can be used for tracking)
    NEST Tracking Device (User set True/False - Can be used to control NEST)
    In GeoLocation range (True/False - Calculated)
    Name of Current GeoLocation (True/False - Calculated)
    Entered Geolocation in last refresh (True/False - Calculated)
    Left Geolocation in last refresh (True/False - Calculated)
    Distance to nearest Geolocation if in range (m)

Sample output from the original test file pre-Alpha plugin I've been running (cleansed to protect the innocent :D )...

Code: Select all
['T5h37L00HFeiqsMWt.............CVvInx8aDTfUwGkWMrILy4DY6IZLVOHYVNSUzmWV', 'iPhone 6 Plus', '200', '73%', "Mike's iPhone", 'iphone6plus-e1e4e3-e1ccb5', 'True', 'True', 'Tue Jul 28 19:30:37 2015', 'GPS', '10.0', '-0.87678666766', '51.33655123701', 'False', 'False', 'True', 'True', 'True', 'Home', 'False', 'False', 50]

['dmxz7bfbGb6DG1+xpADdhxz............k/yxBBQs4INfPw7tRHtIPmDg1rqCQfKxogJOt1x3YMrdY6Nb4ELBSqs43AqzqAK4f19b29WjPp99QoWWDOqUtuHYVNSUzmWV', 'iPhone 6', '200', '60%', "Louise's iPhone", 'iphone6-e1e4e3-e1ccb5', 'True', 'True', 'Tue Jul 28 19:30:41 2015', 'GPS', '10.0', '-0.084634555434, '51.496543515', 'False', 'False', 'True', 'True', 'True', 'Birmingham University', 'True, 'False', 250]


Geo Devices will have the following fields:

    Name
    Description
    Latitude
    Longitude
    Range (m) of Geolocation
    Active

Sample Geo Fence Device Data

Code: Select all
['Home', 'Main Home Location for Indigo', -0.8634534432, 52.98765098, 500, 'True']


Note that distances are calculated using the Haversine formula - i.e.:

    formula: a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)
    c = 2 ⋅ atan2( √a, √(1−a) )
    d = R ⋅ c

Alpha looks on schedule for the weekend :D

Hope that helps :D

Mike

Re: Adding ring fencing to NEST Home

PostPosted: Tue Jul 28, 2015 1:09 pm
by Chameleon
mikeL wrote:
I'm going to run an Alpha on this in the next week or so. If anyone would like to try it out let me know.

I'm using a capability like this based on fingscan to set home/away status for my Nest. I am interested in trying out your solution, too.
Cheers,
MikeL


Mike

I'm keen that the plugin also recognises when you're at other predefined locations (e.g. two miles from home) so it can change the status to Home or Away through the NEST Home plug in or to Away if none of the NEST Home phones are in the Home location..

I also wanted to make it generic so it could be used for other reasons (e.g. mine switches on the lights as I get into the Home location range)

Let me know what you'd like it to do for you :D

Regards

Mike

Re: Adding ring fencing to NEST Home

PostPosted: Tue Jul 28, 2015 1:10 pm
by Chameleon
Swancoat wrote:
Man, if you could get it working that well, I'd rather it be a whole separate plugin. I could connect it to the Nest plugin with a couple of triggers, but I'd like to be able to use something like that for other things.


Agreed - so it will be separate and store the results of the plugin as states on the iDevices it finds.

Re: Adding ring fencing to NEST Home

PostPosted: Tue Jul 28, 2015 9:15 pm
by Parp
Mike,

I think this will be bigger than your Nest Home plugin!

I want my garage door to open as I approach!

Lynn

Re: Adding ring fencing to NEST Home

PostPosted: Tue Jul 28, 2015 11:57 pm
by haavarda
This is definitely interesting, and I would like to participate in testing. Just one question. There is a lot of information in the iCloud account. What do you think about security?

Håvard

Re: Adding ring fencing to NEST Home

PostPosted: Wed Jul 29, 2015 3:23 am
by Chameleon
haavarda wrote:
This is definitely interesting, and I would like to participate in testing. Just one question. There is a lot of information in the iCloud account. What do you think about security?

Håvard


That's a fair question. The iCloud API does allow access to files with the correct authorisation process. Ultimately I think that the iCloud is secure with the username/password combination. Communication is completed over an ssl channel so it's not sent in 'cleartext'. Personally I'm fairly agnostic about it because I'm careful with passwords and, to be frank, there isn't a great deal on my iCloud account that many people would find that interesting!

Mike

Re: Adding ring fencing to NEST Home

PostPosted: Wed Jul 29, 2015 1:03 pm
by haavarda
Good answer. It is probably because I don't know what is possible and not, but the thought of someone snapping your keychain info is rather unpleasant... Håvard

Re: Adding ring fencing to NEST Home

PostPosted: Thu Aug 06, 2015 6:48 pm
by Cheezmo
I'm interested in helping test. 3 family members with iPhones, would love to automate away. What I really want is a feature that can tell if they are upstairs or downstairs though!