Homey Who is Home?

Hi All i am not sure if i have missed this but I have not been able to find anything, Does anyone know if there is a way to find out who Homey thinks is at home and then even better to tell Homey that person has left,

My iPhone app works well with presence but my Girlfriends Pixel 2 app the presence is horrible it hard works and then when it does it works once and then Homey thinks she is always at home so the flows i created get confused and things do not fire off properly!

Not sure if anyone else has this type of issue!

Cheers

Maybe this app can be a solution for your problem Smart Presence

1 Like

Thanks Heaps @HansieNL I will check it out, i was hoping it was inbuilt but will see if this works ! :slight_smile:

Hmm so this didnt really do what i was after, I really hope this is something that might get built into the system in the future!

Thanks!

Presence still seems to be inreliable. It is expected to be better when firmware 2.0 with the new app comes out.

You can use one of the following solutions maybe:
-Use the app to toggle your presence when leaving / coming home manually
-I use a tablet using homeydash, here I can also toggle presence for everyone
-Make a dedicated button next to the front door and using a flow toggle the presence

1 Like

The Life360 app works for me. It shares your location with the people you add to your group. It can be added as Homey app to make the connection.

@Kooswillem How do you add the life360 to homey, and is it accurate enough?

For me Life360 is the best option. Within 30 seconds of leaving or arriving at a location I get notified on my smart phone. At first I tried with an Android Tasker solution which worked OK, but that needs a dedicated phone to run on. Then I found this: GitHub - rkuzsma/life360-hack: NodeJS module to interface with life360 to find your friends.

It come with an example javascript file:

Javascript Example

const life360 = require('life360-hack');    

username = YOUR_LIFE360_USERNAME;    
// Or: phone = YOUR_LIFE360_PHONE;
password = YOUR_LIFE360_PASSWORD;  
     
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);    
		});    
	});    
})    
.catch(err => {    
	console.log(err);    
});    

I was able to concoct my own Homey Life360 app which runs OK. I make it loop every 30 seconds to see where my family members are, and let it start a flow (with “HTTP request flow cards”) when someone arrives or leaves home.

I’m not a programmer/developer (passwords are hardcode in the app, it’s using a lot of memory, and looping is a no-go as I understand it) but for me it was exactly what I needed since Athom’s own presence detection isn’t what it ought to be :slight_smile:

I hope some day real developer picks up on this, and writes an app that is worthy of publishing.

You can also enhance the performance by using a sensor.
I use the following app:
https://apps.athom.com/app/nl.scanno.owntracks
which almost never fails me (http-method).

Nevertheless I decided to improve the performance by using a doorsensor and the countdown app. It requires a total of 4 flows and 2 timers.

I attached the doorsensor to my frontdoor. When this is triggered, the timer ‘Leaving’ is started (5 minutes).

When I leave the geofence within those 5 minutes, I am marked ‘away’.

The same goes the other way around. When i enter the geofence, the timer ‘Coming home’ is started (5 minutes). When the doorsensor is triggered within those 5 minutes, I am marked home.

If you like, I can PM you more details of the flows and the settings of the geofence

1 Like

Thanks.

But for the past few days I’ve been running it like this, and everythig is working exactly as I planned it and had hoped for. No performace issues, and there are times Homey know someone arriverd/left home even before I get the Life360 notification on my smart phone.

And because Homey now knows where everyone is, I could even trigger flows when people leave or arrive other places (although I’m sure your owntracks solution will do the same) like ask my kids if it’s neccesary to start the central heating when they leave school.

I’m really happy with this!

I was replying to Matt20v :wink:
He hasn’t replied yet that any of the given solutions works for him, therefore I added an suggestion.

Great to hear you made an own app which performs! That’s way over my head :open_mouth:

Thanks @Neuron44 yes I hadn’t found the right solution with the other suggestions
But looking at what you linked it does look promising if I can get that to work on my girlfriends google pixel that would be great as I had to remove her from all the flows as it was so bad on her phone

My iphone continues to be much more stable so will try and report back !

Thanks !!!

No problem @Matt20v

Let me know if you have any questions

So if I understand correctly, you have created an app for life360. Is that right? if so how did you do this? I would really like this too? Do you know of each user where he / she is and how much battery the mobile still has?

Yes, thats right. I use it only to see if people are home or not, but the following information is available through the app:

{ features:
{ device: ‘1’,
smartphone: ‘1’,
nonSmartphoneLocating: ‘0’,
geofencing: ‘1’,
shareLocation: ‘1’,
shareOffTimestamp: null,
disconnected: ‘0’,
pendingInvite: ‘0’,
mapDisplay: ‘1’ },
issues:
{ disconnected: ‘0’,
type: null,
status: null,
title: null,
dialog: null,
action: null,
troubleshooting: ‘0’ },
location:
{ latitude: ‘xx.xxxxxx’,
longitude: ‘y.yyyyyy’,
accuracy: ‘65’,
startTimestamp: 1560695458,
endTimestamp: ‘1560716022’,
since: 1560695458,
timestamp: ‘1560716022’,
name: ‘Home’,
placeType: null,
source: ‘l’,
sourceId: ‘aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee’,
address1: ‘Home’,
address2: ‘’,
shortAddress: ‘’,
inTransit: ‘0’,
tripId: null,
driveSDKStatus: null,
battery: ‘26’,
charge: ‘0’,
wifiState: ‘1’,
speed: -1,
isDriving: ‘0’,
userActivity: null },
communications:
[ { channel: ‘Voice’, value: ‘+31612345678’, type: ‘Home’ },
{ channel: ‘Email’, value: ‘email@address.com’, type: null } ],
medical: null,
relation: null,
createdAt: ‘1504729305’,
activity: null,
id: ‘aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee’,
firstName: ‘Voornaam’,
lastName: ‘Achternaam’,
loginEmail: ‘email@address.com’,
loginPhone: ‘+31612345678’,
avatar:
https://www.life360.com/img/user_images/.........jpg?fd=2’,
isAdmin: ‘0’,
pinNumber: null }

So what you need is available. The since is the number of seconds since Unix Epoch.

My skills are (or should I say time is) very limited, so I didn’t bother trying to figure out how to write drivers and flow triggers, I just let the app start a flow (have have a separate flow for every family member) that sets the presence of a circle member. This is sufficient for me for now. But I would love to see someone work this out and create a full-fledged Homey app with alle bells and whistles included though :slight_smile:

1 Like

Yes, that would be great if someone could turn this into a complete app. Basically the same as the new family iphone app from @MarcelT . I don’t have an iphone and my wife doesn’t, so unfortunately can’t use that app.

I am more then happy to make a kind of copy of the app using this information. Could you give me some information to start with so that I can install it on my android device and play with it. Could you also give me the url and possible information where to retrieve the above Json?

That would be really nice. The website is www.life360.com and I think @Le_Cactus de json from https://github.com/rkuzsma/life360-hack. But maybe he has more information about this.

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: