Predict when tracked person is on their way home

Hello,
after tracking all my family for a couple of years I’ve now a little bucket of location data I would like to put to good use: predictions.

Detecting when someone is at home has proven fairly useful to save or restore a home’s state.
But what if the state takes time to be restored?

Example scenario: during the summer I’d like to come back to a cool house (~24C) but leaving the AC on for the whole day it’s just a waste of resources.
The smart solution would be having the AC turning on only when it’s needed, so an X amount of time before I come home, long enough to chill the house.

Understanding how long the house takes to cool down, given a starting internal temperature and the outside temperature, is relatively trivial.
What I’m missing is the “tun on” cue.

I’m looking for something, ideally a Neural Network, able to:

  • digest all the location data I collected
  • given a person and their recent location history (ex: location data for the last half an hour), return if the person is coming home.
  • nice to have: predict at what time the person will be home.

Is anyone interested in this kind of automation?

1 Like

The build in Proximity Integration will give you feedback, if someone is approaching a home assistant predefined zone. Using the Waze integration you can get an estimated time to arrival.

I mean it is nothing as advanced, meaning you are responsible to filter out false positives, or find a way how to use the data to detect if a person is really approaching said zone.

You could do it with the data that you have by creating a trend sensor for each person.

Yeah I ran an experiment like that for a couple of days, it “worked” but highly suboptimal.

Oh, interesting: I wasn’t aware of this feature.
I don’t think it can help me predicting people, but it can def be useful for another part of the system I was thinking for the future: prehemptive chilling → figuring out when te external temperature goes above a given limit, where it might be more effective to start chilling early rather than let the house absorb more and more heat

It might be easier if I use the correct verbiage:
https://www.home-assistant.io/integrations/derivative/
I use the derivative sensor to develop trends. I specifically used it for barometric pressure.
You could use it for distance from house to calculate the trend if they are coming towards or away the house and set up the automation that they must be coming towards the house at a certain minimum rate (to minimize false reporting).
With the companion app you get Lat and Long of current location, compare that to the Lat Long of your house to get distance. I could dig that calculation up if needed.

I think I’ve come across others using the derivative sensor to emulate the function of a Nest Thermostat, so search for that and you might find all the code you need.

Yeah…I found that if I let it get too hot in my house then there is a point of no catch-up. Meaning that the AC can’t cool it back down fast enough. It can run all night long before the temp comes down so there is no energy savings. In fact I spent more money on energy when trying to save by doing this.
Key is to keep it cool by using AC during the day because it won’t ever cool down enough if you don’t.

This will of course vary from house to house. This is just what I’ve found.

1 Like

I hate to possibly drag this a bit offtopic, but how are you tracking presence now? I’m dying for something that works well.

mainly the HA iOS app, I also log HomeKit’s presence detection (via a couple of fo fake switches) but that’s just for logging purposes and having 1 more data point during data analysis (and if they don’t agree I check the device GPS’s position as tie-breaker)
Everything that reacts to people in/out relies on the iOS app.
There’s no silver bullet but with enough data points, you can get close enough.
I started with a home-zone geofence of 70m, and I was able to progressively lower it down to 10m. Not amazing by any means, but enough for my purposes.

1 Like

Exactly!
And since it’s a thing I did struggle with last summer, I’m pretty sure I’ve enough data points to find the sweet spot :smiley:

Nice. The Android app is atrocious for presence. #FML

no idea: I’m not a fan of been profiled for advertising, so I don’t really have much experience on those :man_shrugging:

Doesn’t the house then actually absorb even more heat, as the temperature difference is higher? Agreed it stays cooler but it’s using energy to do that.

I can see that the a/c has higher demands if you are cooling from a higher initial temperature and the length of time to cool becomes critical but it should be more cost effective, but not a workable solution. It’s the same reasoning I think as heating your home all day in the winter even though you are out at work.

Very interested in an accurate ‘heading home’ prediction though…

In a mock isolated system I think you’re right, but I guess when a applied to a house more factors come into play (walls, insulation, hardware, etc)

I wrote a simple Network last fall to manage my heater during the winter based on historical data both of my sensors and local weather data from some years as an experiment. It did save me quite a bit of money and what I noticed then looking at the data is: rather than letting the temperature fall to the minimum allowed it was running the heater for short bursts keeping the temperature fluctuating close to my confort point even when I was away. And then just do a higher burst when I was pushing the “I’m cold” button.
The aim I gave it it was to minimize consumption.

That’s where my idea comes from, but I’ve no idea if it’s right or not.
I’m curious to look at the data if I do it tho :smiley:

Hello everyone !

I’m making a Python program for AppDeamon that could help to solve this problem, I leave you my github, any help or support is welcome !

Hoping not to have disturbed you, I thank you for reading and for any interest!

1 Like

I know this is an old post, but it was one of the ones I found that actually had responses on it for trying to also find the same thing. Just in case someone finds this thread again later, I setup an automation to do this through setting up proximity sensors, and using the state and dir_of_travel attribute. Evaluating those, I set a few boundaries on proximity zones. One for in town another for home.

The function evaluates direction of travel, and the distance from home. if you are more than 2mi from home, it does a 2nd evaluation and runs the logic on the proximity sensor for in town and then will set the state to vacation and prompt the user if they want to put the house on vacation mode.

If you are traveling towards “in_town” it ignores all responses outside of 50mi, then once you are within 10mi, it sets a state to arriving home. if it’s evaluating the home proximity, I have it set to a 2mi proximity to switch to arriving home.

This logic flow makes a few assumptions.
-That most of the time we do our driving around in town.
-That we usually aren’t driving towards home within 2mi of our house if we aren’t coming home.
-That we don’t typically run errands outside of town.

Proximity buffers could obviously be changed for your every day. But there are basically 2 zones where you drive 90% of the time aka in_town, and the proximity buffers for how far outside of town you are normally when you are going on vacation, and how far out when returning from vacation you need to cool/heat your home back up. Where the logic hole is, is if you are running errands outside of town. But this is such an anomaly, and I designed this node red flow to only handle my thermostat, that I’m okay with that.

I’ll post the function logic once I get it a bit more polished.