iphonedetect works nicely when my iphone connects with my lan (when I’m coming home). I can detect a state change from not-home to home. However, when I leave, I do not get a state trigger when the state changes from home to not_home…so there is no way to detect that I am leaving.
One other mystery…when I look at the entity state, it shows home/not_home. When I look at history, I see Home/Away. My assumption is that I should do a state compare to the values shown in entity state, not the ones in history.
This doesn’t make sense…if it works one way, it should work the other. Any thoughts?
I’m not familiar with this particular integration but regarding the different states, there are a number of things that display differently in the front end compared to their state. For example binary sensors always have the states ‘on’ or ‘off’ (which is what should be used for automations) but can display in many different ways in the front end depending on a device class applied (e.g. on = detected, off = clear for the movement device class).
While this makes for a nicer front end experience it can be confusing. So always use the states shown in the developer tools / states menu.
I just had a look at the integration. You should definitely be able to trigger on this. What does your code for your automation look like?
data:
data:
type: tts
message: excuse me but I wanted you to know that tom just arrived home
target: media_player.tom_office
service: notify.alexa_media_tom_office`
Additional info: phone 1 is an iphone xr; phone 2 is an iphone se (original)
for testing, I have tried turning iphone 1 wifi on/off…and I have tried powering off iphone 1. Neither triggers leaving.
I may have found the problem…really an issue. Once a state changes, there is what appears to be a variable delay before checking the router again. Do I have any control over how long the delay is between trigger and new poll…or how long between polls even if there is no change of state?