The minimal companion app does not have a working device_tracker, so i made a “virtual device tracker”, that uses the GPS data from the geocoded location. A slight limitation is that the created sensor is missing unique_id, so it is hard to manage in the UI.
Blueprint can be found here:
Here is an automation that does the same thing, a new device_tracker called “sm_a155f_virtual” will be created when the automation is first run:
description: "Device tracker from sm_a155f geocoded location"
mode: single
triggers:
- trigger: state
entity_id:
- sensor.sm_a155f_geocoded_location
conditions:
- condition: template
value_template: >-
{{ state_attr('sensor.sm_a155f_geocoded_location', 'location') is not none
}}
actions:
- action: device_tracker.see
metadata: {}
data:
dev_id: sm_a155f_virtual
gps: "{{ state_attr('sensor.sm_a155f_geocoded_location', 'location') }}"
We could also read the data from the trigger, so we only need to define sensor once. But this will fail if run manually:
# Inststead of this:
{{ state_attr('sensor.sm_a155f_geocoded_location', 'location') }}
# Do this:
{{ state_attr(trigger.entity_id, 'location') }}
@sangvikh Stumbling upon this 7 months later, this sounds like the solution to my problem but I am struggling to even find the geocoded location sensor. It seems that maybe it has been removed entirely from newer versions of the Minimal Home Assistant Companion app (F-Droid)?
After granting location permissions to the app, I still can't seem to find a geocoded location sensor anywhere in the "Manage Sensors" menu in the app or searching through all entities in Home Assistant.
Are you seeing the same? I would love to be wrong about this
I think you need to enable it in Settings > Companion app > Manage sensors
EDIT: Sorry, was a bit fast on the trigger, didn't read the part where you had checked "Manage sensors".
I know they changed something with regards to http / https, where location is disabled in http / "insecure" mode.
I am using "insecure" mode, and the sensor still works. But i enabled the sensor before updating to that version of the app.
Found something in the docs:
"This sensor requires either Background Location or Fine Location"
It turns out the issue was that my phone is running GrapheneOS and I had previously disabled Settings app > Location > Location services > Geocoder.
I was able to fix it by selecting the OpenStreetMap server geocoder setting and force stopping the Home Assistant companion app. After reopening, the Geocoded location sensor appeared under the Manage Sensors menu.