100% success rate using Alexa for geofencing

I’m pleased to report that after a week of using Alexa for geofencing, I’ve had a 100% success rate in determining location and managing location modes. If anyone is interested (and uses the Amazon ecosystem) here’s what I did:

Created a virtual switch in Hubitat called Virtual Presence via Alexa

Created 2 routines in the Alexa iOS app:

  1. New Routine -> When this device leaves -> Turn off Virtual Presence via Alexa
  2. New Routine -> When this device arrives -> Turn on Virtual Presence via Alexa

Created a piston in Webcore to manage location mode:

It's nice to finally have working presence and not have to deal with changing it manually or setting off the alarm. I also use presence to manage lighting, HVAC, and our security cameras so unreliable presence was a huge PITA.

6 Likes

I am doing something similar (not using webcore) but didn't want to totally trust Alexa or HE mobile app. So I have a virtual presence switch with 2 routines like you. I also use the HE mobile app for presence for my phone as well as the Combined Presence App in HE. It looks at both the phone and Alexa virtual presence switch and changes the combiner virtual presence switch. I did this mostly because of all the previous issues with presence and the HE mobile app. Also, there have been times that the Alexa app will need to be reopened to make presence work if it stops. I have notification setup for all 3 (Alexa, Phone and Combiner).
I will say since all of the HE mobile app updates, the majority of the time all 3 are working correctly. I have had to restart the Alexa app a couple of times in the past few months. HE app has been very reliable now and the combiner ALWAYs worked even if one or the other of the 2 apps didn't.

I think I'm missing something :upside_down_face:

What ties Alexa to Hubitat? Home Hub?

The Alexa skill for Hubitat:

2 Likes

I would have a backup, I have been using the Alexa skill as a presence sensor for a number of years now and it for the most part is reliable. I would rate it at around 95%. I have had times, however, when it will stop working for whatever reason. It will usually start working again pretty quickly. There was a instance that it stopped for a few weeks, however. I think it was an update and didn't get fixed until the next update. That is when I stated looking for alternates and added Geofency to my presence combiner.

I haven't had a missed presence update in quite sometime, using a mix of Wifi, Alexa, hubitat and Geofency.

1 Like

So I am curious! for those of you that are using multiple presence sensor applications, how do you decide the overall 'presence' state of the 'rock, paper, scissors situation below where 1 of the 3 or 2 of the 3 of the presence sensor disagree in their derived states?

Also, those using their home WiFi SSID for a 'presence' sensor, isn't the geofence quite close to the home before one's mobile phone connects to the home network SSID? Seems to me, that the other presence applications (eg. geofency, Alexa, OwnTracks, Hubitat, HomeKit, etc) would send an event at a difference geo location that when a WiFi SSID connection state event would fire off.

Situation App1 App2 App3 Presence State
A Home Home Home Present :white_check_mark:
B Home Away Home :question:
C Away Home Away :question:
D Away Away Away Not Present :white_check_mark:
How do decide the overall 'Presence' state in the situations 'B' and 'C' above?
  • B & C = Both rows = 'Present'
  • B & C = Both rows = 'Not Present'
  • Majority Wins
  • Something Else (Explain in your reply?)
0 voters

I haven't missed presence either. I use a combination of:

  • Apple Home
  • Geofency
  • A zigbee presence sensor in my car
  • Lock key code
2 Likes

Thanks...I use this already for all kinds of stuff. It seems obvious now, but used it to respond and never really thought about that it could initiate as well.

Presence is one of the few things where my entire logic is done in a Node-RED sequence. This is the sequence that I use to establish my "combined" presence:

  • I have 3 presence sensor that indicate "present" / "not present".
  • If they indicate "present" when the Mode is "Away", then a counter increments by 1. When the count is >= 2, my combined presence changes to "present".
  • Using my code on the front or back door lock is also counted as a "present" event. These events increment the counter by 2. So using a lock code is sufficient to change my combined presence to "present".
  • Similarly, when my presence sensors indicate "not present", and the Mode is "Home", the counter decrements by 1. When the counter is <= -2, my combined presence switches to "not present".
  • Finally, whenever there's a change in mode, the counter resets to 0.

This has worked flawlessly for years.

If I had any discernable Groovy skills, I would make this into a Hubitat app.

1 Like

Alexa sees the virtual switch as a device and turns it on or off via an Alexa routine that runs when I enter or leave the geofence.

Webcore then manages location modes based on the switch's state changing to on or off.

Thanks!
@aaiyar : That would be the 'majority' state wins method, and I am guessing that is the most frequent logic when multiple sensors are being used. I wonder what you would do if you had an even number of sensors, with a 50% decision?

@markles: If you are only using one sensor (Alexa), this question is for those using multiple location based geo-sensors and their logic for handling different states of those sensors.

Logic would stay exactly the same. Since it is driven by the number of sensors that CHANGE status. Not the number whose status remains unchanged. Recall that in my setup, presence changes Mode. And a mode change resets the counter to zero.

Thanks!

I've just had a policy that I want one system controlling everything. Historically, I've used Alexa for only voice triggers because I had to, but avoided any "rules" on the app to keep things centralized in Hubitat.

Geofencing, due to it's inherent flakiness is pretty much my one exception.

Last question @aaiyar. So what do is your logic if you and another family member(s) have different results of their collective presence states. For example, my wife's presence collective state is 'present' and my collective presence state is 'not present' and we are both far away from home in the car? This always makes my 'hair on fire' crazy since my Hubitat mode won't change to 'Away' unless all family members presence are 'not present' since that sets the Home Alarm and HSM to 'Alarm Away'.

Can't address this because I've never had this happen. There are zigbee presence sensors in each car. And the combination of Geofency and Homekit has never failed. In fact, they haven't failed individually either. The only reason I use both is because I use Geofency to send presence events for other locations outside the house.

1 Like

@aaiyar, what type of presence sensors do you use in your cars?

Zigbee Arrival sensors made by @iharyadi. AFAIK, he is no longer producing them.

1 Like

Thanks anyway!

1 Like