WTH is there no way to start making coffee if I decide to drive home

Since I cannot integrate such a button in my Android Auto, I thought about an sensor that fires as soon as I start my navigation in Waze to “Home”.
This could also notify my Family, that I am on my way.
Sure, this would need an API from Waze which I don’t know if this exist.
But if so, a deeper WAZE Integration could make a lot of funny things.

Cheers
Rakete

That’s already possible using the current Waze integration and a device tracker. I use the following in automations as a trigger (change to below in your case) to start my robot vacuum cleaner on Saturdays whenever I’m away for more than 25km’s:

platform: numeric_state
entity_id: sensor.proximity_home_name_template
above: "25"
id: vacuum_awaysaturday

based on the following template:

- sensor:
    - name: "Proximity Home Name Template"
      unique_id: sensor.template_proximity_home_name_waze
      state: "{{ states.proximity.home_name.state  | default(0) | int(0) }}"

The template sensor isn’t even needed, but created because I couldn’t find another way to deal with distance ‘0’, which gave some errors.

But, isn’t the actual example on Waze Travel Time - Home Assistant sufficient too? You wouldn’t need a different Waze API as long as you have the Companion App installed and configured as a person tracker.

1 Like

you can use dir_of_travel in the proximity integration which will give you your distance/direction relative to a named zone

2 Likes

Thank you both!
But I don’t quite understand. I will definitely try this though.
Very specifically, I wanted to start an automation when starting the path from one zone to another. From work to home. But only exactly then. Not when I am traveling in the area for other reasons.
I will play with the proximity integration.
Thanks!
Rakete

I am not sure anything can know this (you are asking HA to read your mind). You may leave one zone, go in the direction of another zone and then ‘turn left’. You can mitigate the risk of error by adding criteria:

  • if it is a work day
  • and if the time is in the ‘leaving time’ window
  • and I am leaving
  • and I am heading in the direction of home
    then I am probably going home.
    …but I might be going shopping!
1 Like

Share the drive with Home Assistant when you drive home.
This will send a ETA and a link to the drive and can easily be used to trigger an automation

1 Like

I recall seeing a video somewhere of someone who stuck a NFC Tag to their dashboard…
(not my idea, but it would work)

2 Likes

How to share and having an eta?

Great idea!

The NFC tag triggers ‘going home’! nice.

This does seem interesting. How does one do that?

It is, but it - relatively - isn’t a true automation, isn’t it?

I have previously looked into the direction attribute as you mentioned, but since my work location is relatively stable I figured it wasn’t worth the effort. I have read (but only read) about Geofencing with NodeRed which, if I understand correctly, would enable you to draw a geofence around a typical route home. That could serve as a(n additional) criteria to determine with more certainty if I’m indeed going home…

… too many options, to little time :joy:

1 Like

Use Waze to navigate home and press share button.

Or you could use the sensor that detects the app you have open together with timespan of when you end work and a Bluetooth connection with car.

Use event mobile_app.share to listen for the share.

2 Likes

Share the Drive would be a good workaround. But there is no such button in the Android Auto integration and with this, I need to use my mobile again.
So I could also just build a Widget or use the NFC idea.
Don’t get me wrong - thanks for the idea.
The share dirve was new to me and is a cool feature.
Thanks
Rakete

So I have conditions where I would like to auto-start a preloaded coffee maker. But the other side of the question is do you have some form of coffee maker that HA can signal to start? That is what I’m looking for. I’ve found a few with “works with alexa” but haven’t found an HA integration to run them…

Interesting. I thought this was kind of a silly WTH but it turned into an interesting discussion on estimating ETA so I guess I’ll add my two cents. Ever since I realized Nest had an ETA API I’ve been trying to crack this one. Rather then when to start making coffee my goal has been “when to turn off eco mode so my house is the right temperature when someone arrives home”, same idea different goal task. My setup isn’t perfect but I have gotten it pretty good at this point. Here’s I guess a summary of what I learned and some tips from my setup:

1 - You’re not going home until after you arrived somewhere

I mean usually. Yes in some cases you simply take a lap or something (maybe trying to put a baby to sleep). But this is an edge case. Most of the time it’s safe to assume no matter which direction you go in you aren’t going home until you got somewhere.

I should note that this is one place where the different goal task does make a difference. Because I’m trying to figure out when to start heating/cooling the house that means even if I’m taking a run or something there’s no ETA if someone else is still home, I only care about ETA when no one is home. So its really rare for all of us to leave and not reach a destination before coming back. If you are focused only on one person then it might be less of an edge case that they come home without first reaching a destination.

So for each person I have an “arrived at destination” switch. After the person leaves the house this flips on if:

  1. The person arrives at any zone
  2. The person’s phone connects to wifi (this one may not work for you if you use a lot of hotspots)
  3. The person’s movement speed is walking or below for 5 minutes (unless walking is their expected mode of transit then it has to be stopped for 5 minutes, more on this in a second)

2 - Ignore dir_of_travel in proximity (or the concept in general)

I saw this mentioned earlier so I’ll mention it here, this isn’t really helpful IMO. It sounds like it should be good but it’s not. Roads are weird. They go in all sorts of strange directions especially when you need to connect from one major road to another. You’ll often be briefly going in the direction of your house multiple times on your journey. At least that’s my experience, if you are far outside any city and rarely go into any densely populated areas maybe this works better for you since I imagine roads are more predictable. But in my experience there was so much bad trigger noise trying to figure out when I was getting closer to the house for real vs. just briefly.

Focusing on destinations works much better in my experience. Assume once you get to a destination you are going home any time you leave one unless and until you stop at another. Regardless of where the route actually takes you.

3 - The detected_activity sensors from mobile_app are really good!

I spent a while mucking around with proximity sensors and the speed attribute on the device trackers from mobile_app trying to figure out my mode of transit based on how fast I was moving. I never really got it right. But these detected activity sensors are really excellent at it, just use them.

A few tips I’ve figured out with this:

  1. Make a select or something that starts at Walking when you leave the house and only goes “up”. So like once you see Cycling as the detected activity then it can never go back to Walking until you go home again. And once it sees Automotive then it can’t go back to Cycling or Walking. This is important because you don’t want traffic to affect your ETA just because you’re temporarily moving at Walking speed. If you left the house driving you’re almost certainly driving home.
  2. Unknown is super obnoxious. You can’t assume they’re stopped or that they’re still in the last state. Phones report Unknown whenever they aren’t confident of the activity and don’t tell you how confident they are. What I do is have my template entity fall back on the speed attribute in the device tracker and try and guess activity from that when it sees Unknown. But mostly you just kind of have to ignore it.
  3. Transit can’t be predicted from this. My suggestion is to pick a location that if you go through you are definitely using transit and make a hidden zone there. Then if you see a zone entered event for that zone set the expected mode to transit and don’t let it change.

Obviously this whole section only applies if your mode of transportation varies. If you’re always driving you can ignore all this. But sometimes I bike or use transit to go places so my setup has to guess the ETA according to my mode of transportation.

4 - Travel time sensors to figure out the ETA

I use the google maps travel time sensors. There’s also something called a here travel time sensor and a waze one. Haven’t tried these two but assume they work fine as well.

To avoid going over the quota and paying money, set the scan interval arbitrarily high and call homeassistant.update_entity on it. I have one of these sensors for each person and each possible mode of transit. When a person is not at a destination and has reached a destination I update the one entity that matches that person and their expected mode of transit every couple minutes and otherwise they don’t update. Have never come close to the quota.

5 - Send yourself a notification

When my system things someone is going home and it has started to track their ETA I send myself a notification with the following:

  1. Who’s going home
  2. What’s their expected mode of transportation
  3. What’s their ETA
  4. Action to cancel (changes their “reached a destination” switch back to off)

Handy for debugging since you can double check it.

Also would recommend sending yourself a second one when your key action fires. For me that is when ETA <= “estimated minutes required to get house to correct temperature”. At that point I turn off eco mode and notify myself. For you that would likely be when ETA <= “time required to make coffee”.

6 - High accuracy mode is helpful

When trying to track an accurate ETA I found I needed higher accuracy on location then the default. So what I do is whenever the person is not at a destination I turn on high accuracy mode. Yes this drains battery more but I didn’t find it to be too bad, especially if you turn down the interval in the app’s settings a bit

Iphones don’t have a high accuracy mode so instead I send request_location_update command every few minutes when they are not at a destination.

To reduce the drain on long drives or far away vacations, set a distance limit. Like if you’re >= 100 miles away from your house then go back to normal location tracking. There’s no reason to get an accurate ETA at that distance, worry about it once you get closer again.

I just opened up our coffee machine and added a sonoff mini inside it.
That way I could both use the button and HA/Google.
Most coffee machines habe plenty of space inside for such things.

I even had space to add a LED strip to make the coffee machine “glow”

So are you using the sonoff mini as a dry contact in parallel with the brew start button, or simply turning on AC to the machine? I’d still love to find a connected coffee maker that would integrate with HA without me having to get out the soldering iron and voiding a warranty. :slight_smile:

Warranty was not an issue on a 20 year old machine.
Unsoldered the button on the machine and routed the cables to the Sonoff then routed new cables from the switch connectors (what is it S0 and S1) of the Sonoff to where the live connection was.

So now the switch has no on or off state with the button, it can be both on or off in the same switch position.
And to make sure the bulb (not LED on such an old machine) was going to be lit when it was on, I removed the bulb created a new “front” with a hot glue gun and placed a single LED behind.

The rest of the LED strip is routed in circles above the pot but below the coffe grind thing, whatever it’s called.
Then another route of LED strip below the machine to give it light below the coffee machine (just like the kids do with their cars).
Connected this LED strip controller to the mains of the coffee machine/Sonoff, that way when the coffee machine is on the LEDs is on.

Keep in mind that if you do find a coffee machine that you can control it’s probably cloud based.
I would suggest looking at Bosch or if your very adventurous, Tuya :face_vomiting: .

How does ha know that the coffee machine has water and beans in the reservoirs? Do you just make sure it is topped up regularly?

I actually tried to use a force sensitive resistor, or three…
Since the reservoar is in the back and the pot is center/front then I hoped I could get a difference in the measurement but I guess the FSRs is not accurate enough.

Perhaps if I went all in and opted for something better then it would work.
I also had grand plans on making sure the the coffe machine would turn off if there was too little in the pot, and monitor the temperature of the pot and keep it lower but still hot enough to taste good.
But I couldn’t get the thermal camera/sensor to work (either).
Perhaps when all other DIY things are built then I will get back to this and use contact temperature sensors instead and better weight sensors.

1 Like