Skip to content

Location support via geoclue2 & support for device_tracker entities #186

Open
@LnLcFlx

Description

@LnLcFlx

Describe the solution you'd like

I would like to track if my laptop is home or not for home assistant automations, because sometimes I leave my phone at home.

This could be done using

  1. the currently connected WiFi name.
    But lnxlink does not support exposing a device_tracker afaik.
    And there is also no way to create a helper device_tracker in Hass itself afaik.
    A device_tracker is needed to attach a location tracking entity to a person in homeassistant.
  2. the current actual geolocation. For this a WiFi geolocation service such as geoclue2 could be used.
    This service runs already under many environments (e.g. Gnome afaik) and in certain places delivers very accurate geolocation.
    Using the preinstalled GTK Python library gi this is easy to fetch
    from gi.repository import Geoclue
    clue = Geoclue.Simple.new_sync('something',Geoclue.AccuracyLevel.NEIGHBORHOOD,None)
    location = clue.get_location()
    print(location.get_property('latitude'), location.get_property('longitude'))

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions