Homey Community Forum

Homey Who is Home?

Hi,

Start by installing Life360 on your Android phone (Assuming you don’t already have it) and define a ‘place’. As you leave or arrive at that place Life360 will know.

Then (assuming you already have Node JS installed on you computer) install the Life360-hack from https://github.com/rkuzsma/life360-hack.

The javascript example from a few posts back produces the information.

I’ve copies alle node_modules from the life360-hack app to my Homey app, and added this to my app.js:

		life360.authenticate(username, password, phone).then(session => {
			return life360.circles(session).then(circles => {
				if (circles.length == 0) {
					throw new Error("No circles in your Life360.");
				}
				let circleId = circles[0].id;
				return life360.circle(session, circleId).then(circle => {
					// console.log(circle);
					circle.members.forEach(function (item) {
						switch (item.firstName) {
							case 'PersonA':
							if (PersonA != item.location.name) {
								PersonA = item.location.name
								http('http://192.168.x.x/api/app/com.internet/whitelist/PresencePersonA/' + item.location.name).then(function (result) {
									console.log('Starting PrecensePersonA Flow with parameter ' + item.location.name)
									console.log('Code: ' + result.response.statusCode)
									console.log('Response: ' + result.data)
								})
							}
							break;
							case 'PersonB':
							if (PersonB != item.location.name) {
								PersonB = item.location.name
								http('http://192.168.x.x/api/app/com.internet/whitelist/PresencePersonB/' + item.location.name).then(function (result) {
									console.log('Starting PrecensePersonB Flow with parameter ' + item.location.name)
									console.log('Code: ' + result.response.statusCode)
									console.log('Response: ' + result.data)
								})
							}
							break;
						}
					})              
				});
			});
		})
		.catch(err => {
			console.log(err);
		});
	}, 30 * 1000); // 60 * 1000 milsec

Hope this helps! Looking forward to an app that allows me to just add ‘circle members’ as a device, with capabilities like home of not, location, battery etc.

If I can help in any way, let me know.

Hi,

Thanks, I have now all the information and I am already started :slight_smile:

First version testing :slight_smile:


Please let me know what sensors are important besides the one I show. I have seen Life360 update not as often as iPhone does. So last seen will show the last know location.

1 Like

This is really great to see and so fast already. I really didn’t expect that. It is possible to show where the device is, for example, it is at home or at work.

Love to test that too! Is it on github somewhere? Edit: Nevermind, found it :slight_smile:

Great Job Marcel :+1::+1::+1:

/me is happy :slight_smile:

Maybe include current location? Don’t know if thats possible besides a predefined place in Life360 or the GPS coördinates. Not sure if streetnames are in the JSON. Device history could then state the places someone arrived at of left. If that’snot possible device history will just state when the phone left or arrived home?

As for the flow stuff; can you add a trigger “Device changed place”? This means only one flow is needed for arriving and leaving home. Now I need a flow for when I come home and a flow for whenI leave home (to set my presence.)

Anyways, thank you very much, this is what I had in mind, but couldn’t code myself.

Cheers,
/Cacti

The current location (I suppose street, city etc ) is not available in the data. I could ask this on google but currently for this Google API you need a key and enter your creditcard when you hit a certain limit :slight_smile: I have tried for other projects free version but they are limited in the number request per hour.

I am not understand how this trigger should work. As this will fire then also when you leave work or in a traffic jam and start riding again :slight_smile:

I have put the app into the store and wait for approval :). Then when a few people are using it I will collect the feedback and start working with the highest wish.

PS do you know the item wifiState when it is 0? Does this mean it uses location based on GPS?

I am very happy with the app :smiley:. I think you misunderstand us about the location. You can give places a name in life360. For example: home, school, gym, work, shop etc… I think this can be seen in the javascript example from a few posts back by name or by address1. If possible I would like to see that in the app.


When I charge my mobile this does not change in the app. I have not been able to test the speed yet, I will check when my wife leaves work to see if this has changed.

My wife is now driving but the speed in the app does not change. The status of the wifi means that it is on or off, and not position type.

I am working on an updated version that hopefully will better fulfill the needs. I have also fixed the above errors.





1 Like

Super! Thanks. Keeps getting better and better!

Really great job done. Everything does it, except for one thing and that is driving, this remains off. Really well done for the rest :ok_hand: I think the speed is indicated in mph?

I have already converted it from mph to kmh but still it displays to low value. I saw the interface from homassist and they multiply it with 2.5. Which is wierd. That means the api is not displaying in mph or kmh🙄.

This interface of homassist is pulled offline by life360 as it was illegal :grimacing:

1 Like

I have updated the version. Hopefully it fixed the error.

Hey @MarcelT I noticed this morning with the new version and after my update to the stable version of homey my iPhone is constantly prompting me to authenticate the sign in.

I cant seem to stop the two factor prompts even after approving
icloud

Any ideas how to fix it ?
I did try and delete my phone and set it up again but still the same result!

Thanks heaps!

I think you are on the wrong topic. This goes about life360. Should not have this error.

Hey @MarcelT , This was happening in the Family iphone app, After making the change you suggested it has stopped it ?

Let me know if you think i am still in the wrong topic

Thanks

Hi, no there are two apps. The family iphone app works only with iphone devices and is in another topic. This will be developed further. In addition to this I am also building an app that communicates with life360 app or iPhone and Android. This is the thread for the life360 app.

Whoops thanks! :-/

To make things more clear I started a new Topic: Devloping a new App that communicates with Life360

1 Like