home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.07k stars 587 forks source link

Using cell towers as an alternative to geolocation. #4368

Open MeGilles opened 2 weeks ago

MeGilles commented 2 weeks ago

Is your feature request related to a problem? Please describe.

I use the "minimal" F-droid version of the app and geolocation is not (yet) an option. #1511 As a workaround, when there is wifi it is possible to use the wifi_connection sensor which exposes the name of the current connected network. However this method can't be used in places where there is no wifi. (e. g., workplace)

Describe the solution you'd like

The ha app could offer a similar mechanism with cell towers, by reporting the id of the cell tower the phone is connected to. The automate app in the play store already offers this feature with the Cell tower near decision block : https://llamalab.com/automate/doc/block/cell_site_near.html

Describe alternatives you've considered, if any

Additional context

I am wondering if this feature interests people, if it is feasible reliably (the automate documentation warns that some devices only report cells when the screen is lit) I have no development experience on android but I am willing to try and implement it if this feature shows some interest.

dshokouhi commented 2 weeks ago

This might be a cool neat feature but I am not really sure what API is being used here. Is it possibly CellIdentity?

https://developer.android.com/reference/android/telephony/CellIdentity

🤔