I have setup 3 mobile devices and it shows up on the UI. I have read to test the status of Home or Not Home, you switch the device to airplane mode or turn off WIFI. I have done both, but the UI still shows Home. Does Home Assistant needs to have remote access? It is setup as local access.
When I was first setting up location for my HA, I was (and still am) using the iOS app which seemed to rely on gps location, not network location. I actually had to leave the “Home” boundary to test it out. In order to do that tho, I did have to be able to access HA from outside my home network. If outside access is not setup, that could be one of your issues. Can you provide a bit more details? I.E.: iOS or Android? Phone or tablet?
My 3 mobile phone devices are ios.
Yes, HA is only setup for local access. I am unable to access from outside my network. How do I set it up to detect my wifi network ssid or similar?
Do you have an Apple TV? If so, there is an alternative.
An Apple TV also acts as a home hub. This means, you can set up automations across devices and it tracks whether iOS devices are home.
I’m on my phone, so not able post any configs, but if you look for my user on Github you can see what I did in more detail, because I was looking for a solution for this when I started using HA too.
You can set up an input boolean for each device. You need to expose this in your HA config to HomeKit. Using the device which uses the same account for which your Apple TV is set up, you can control these input booleans. Thus, you can open the Home app and create automations for leaving or arriving home. On the HA side you can associate the respective inputs with each person.
This worked really well for me, but as my setup grew more advanced I had to find a way to access HA outside of my network. I considered setting up SSL and getting either a dynamic DNS set up or a static IP, but the NabuCasa offering was very lucrative, so I went with that option.
Since then, the built-in tracking has worked flawlessly, but I kept my old method as a fallback.
I do have an Apple TV. I have also looked at your config files over at Github. I have to say it is a bit overwhelming as I do not know which yaml file to look. I installed HA a few days ago just to see what it can do. A lot apparently. Thank you.
No problem. I’m in front of my computer now, so can post a few snippets.
Firstly, define the input booleans:
input_boolean:
pieter_present:
name: Pieter Presence
icon: mdi:account
Then make sure it’s visible to HomeKit:
homekit:
name: Home Assistant
filter:
include_entities:
- input_boolean.pieter_present
Now set up the two automations in the Home app:
Then define a sensor:
binary_sensor:
- platform: template
sensors:
pieter_present:
friendly_name: "Pieter Present"
value_template: >-
{{ is_state("input_boolean.pieter_present", "on") or
is_state("person.pieter_rautenbach", "home") }}
You can use it like this in an automation:
- alias: "Open The Gate When Arriving Home"
trigger:
- platform: state
entity_id: binary_sensor.pieter_present
to: "on"
condition:
- condition: and
conditions:
- condition: state
entity_id: cover.main_gate
state: "closed"
- condition: time
after: "07:00:00"
before: "22:00:00"
action:
- service: cover.open_cover
entity_id: cover.main_gate
What if…
You make a IP reservation for your phone in your router (based on MAC address.)
Then add a binary sensor to ping it…if time-out, you’re not home
I have added all except an automation script. When at home connected to my network, I can toggle on and off from Homekit and see the toggle changes in HA. I also see an icon above that reads ‘Duc Present’, but it stays ‘On’ all the time even if I have set to off.
When I stimulate away from my network by turning off my wifi on the phone, I get an ! next to the icon which translates to not responding. I am unable to toggle it on or off. I can verify that my Apple TV is connected to Homekit as it say ‘Connected’
Also, how to change Input boolean to a friendly name.
I have no idea why that’s happening. Perhaps try to log out and in to all your iCloud-connected devices? When you were on WiFi, did you still have a mobile connection? Is the Apple TV also showing unavailable under the Home app when that happens?
For customization, you can define a friendly name for each entity under the customize
section in YAML or via the Lovelace UI.
It is quite weird. This new switch added is the only accessory that isn’t working via 4G. It works connected to my network. All my other lights on Homekit works on both wifi and 4G. Wondering if Homekit had a bad pair to HA?
For customization, can you provide some snippets base on your samples on creating a friendly name? I have tried, but am at lost on how the code it.
Update: I figured out the customization part.
Add this to groups.yaml
pieter_present:
name: Whose Home
entities:
- input_boolean.pieter_present
Add this to customize.yaml to remove the toggle up top.
group.pieter_present:
name: Whose Home
control: hidden
Never used ping on battery powered device.
I had an alarm scary one time (not with hass) because our both phones get empty ones.
Cat wake us both at 3am…
Did you ever solve this? I’m having the same problem. “No Response” with exclamation point when controlling anything when I’m not on the home Wi-Fi, but the states show accurately.
My solution works. I’ve been using it for quite some time. There’s been two times where Apple’s update of tvOS would not detect devices properly but I haven’t had any issues with the HA side.
It sometimes take a few seconds for states to update in the Home app. Is that where you see the no response message? I do sometimes experience timeouts or it just takes a while to update.
Is your HA instance publicly accessible?
After I got it setup and working, it has worked to this day. I can remember a few times it updated a few minutes late, but this is far more reliable then the tracker method imo.
It seemed to timeout almost immediately after a short time showing a spinning circle (about 1 second). I also noticed my “left home” automations hadn’t run for anyone. That made me think it was a central problem with the HomeKit hub, the Apple TV. I restarted it and it seems to work now.
I’ve had problems like this before that has required restarting the Apple TV, which is annoying because you have to present to do it. Maybe I’ll buy another smart plug
Never mind, it didn’t work. Same thing today. Added a camera, maybe that’s it.