Is there a way to know if an android phone with the companion app installed is connected to the internet? Similarly, is there a way of knowing if it has cellphone signal to receive a phone call?
the app needs a way to communicate back to HA from whereever you are if teh app has no data connection it cannot send taht info back to HA…same with signal to get a phone call.
Yes, but of the app sends pings regularly for location and other stuff it should be possible to say that if a ping want not received the phone is offline. For example, i should be able to send a ping asking if the phone is online and if i get no answer then i can assume it is not.
the app does not send pings, it sends updates and thats it, there is no logic for if an update is not received. You can always check the last_changed
attribute for that.
HA core does not request data, it waits for data to be sent by the app and that is it.
which entitys last_changed
would provide reliable info on (android) companion apps latest connection to update sensor data?
states.device_tracker.juusos_phone.last_changed seems to be changing even phone disconnected from internet.
the device tracker gets the most frequent updats from any entity
but as I wrote, seems it got some change couple of times during the day despite phone blocked from contacting HA… this would make it impossible to detect phone not connecting.
are you sure you are looking at the correct device tracker provided by the mobile app? if its getting attributes updated then its still able to contact HA, assuming you are looking at the correct entity. Device tracker entity provided by the mobile app integration only updates when the device sends in the updates.
Edit: on your phone go to Settings > Companion App > troubleshooting > location history and look to see if you see the expected failures