{"id":16796008,"url":"https://github.com/oxan/hapt","last_synced_at":"2025-06-10T23:05:20.955Z","repository":{"id":139266875,"uuid":"248313407","full_name":"oxan/hapt","owner":"oxan","description":"Home Assistant Presence Tracker for OpenWRT","archived":false,"fork":false,"pushed_at":"2025-04-03T20:35:25.000Z","size":65,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T00:11:44.180Z","etag":null,"topics":["home-assistant","home-automation","hostapd","openwrt","openwrt-package","presence-detection"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oxan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-18T18:36:21.000Z","updated_at":"2025-04-03T20:35:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"33fc9362-ec08-4b77-b72a-555d652ec044","html_url":"https://github.com/oxan/hapt","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxan%2Fhapt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxan%2Fhapt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxan%2Fhapt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxan%2Fhapt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxan","download_url":"https://codeload.github.com/oxan/hapt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxan%2Fhapt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259166901,"owners_count":22815587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-assistant","home-automation","hostapd","openwrt","openwrt-package","presence-detection"],"created_at":"2024-10-13T09:18:01.092Z","updated_at":"2025-06-10T23:05:20.924Z","avatar_url":"https://github.com/oxan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HAPT\n\nHome Assistant Presence Tracker (HAPT) is an event-driven device presence tracker for [Home Assistant][homeassistant] on\nan OpenWRT router or access point.\n\n## Description\n\nHAPT listens on association and disassociation events to wireless networks, using the hostapd control interface. It\nkeeps track of which device is connected to which networks. When a device connects to its first network, or disconnects\nfrom its last network, a service call to Home Assistant is performed to mark the device as home or away. By tracking\nactive device connections, HAPT ensures that a device switching between different networks (e.g. the 2.4 GHz and 5 GHz\nbands) is not marked as away.\n\n## Usage\n\n### Installation\nDownload a package from the [releases][releases] page, and install it either by uploading it in LuCi (System \u003e Software)\nor running `opkg install \u003cfile\u003e` from a shell.\n\n### Configuration\nOnce the package is installed, you must update the configuration in `/etc/config/hapt`. At minimum the `host` option\nshould be set to the URL of your Home Assistant installation (including the scheme, e.g. `http://homeassistant:8123`),\nand the `token` option to a Home Assistant [long-lived access token][token] (these can be generated in the Home\nAssistant web interface, on the Security page of your user profile).\n\nThe `consider_home_connect` and `consider_home_disconnect` settings can be used to configure for how long (in seconds)\nafter the first association and last disassociation event the device should be considered home. Since Home Assistant\ndoes not support marking a device as away (on disconnects), this is implemented by marking the device as home for a\nnegligible amount of time, after which Home Assistant will mark the device as away. The default values should be fine\nhere.\n\nWith the `wifi_interfaces` option, it is possible to specify the wireless interfaces that must be monitored. This can be\nused (for example) to ignore devices on a guest network.\n\nBy listing MAC addresses in the `track_mac_address` option, it is possible to whitelist MAC addresses which are tracked.\nThis prevents uninteresting devices from being synchronized with Home Assistant and cluttering the entity registry.\n\n### Running\nAfter modifying the configuration, you must restart the service by `service hapt restart`. This can also be done from\nthe LuCi interface (System \u003e Startup). HAPT prints log messages to the system log, so that you can verify it is working\nas expected.\n\nIt is possible to synchronize just the currently connected devices with Home Assistant by running `hapt` from the\ncommand line. This can be especially useful to debug the connection with Home Assistant, as this will also print any\nerrors that occur.\n\n## Development\nYou can build a custom package by running the `makepkg.sh` script, which will run the package build in a Docker\ncontainer and place the compiled package in the `build/bin` directory.\n\n## Acknowledgments\n\nThis project has been inspired by the [openwrt_hass_devicetracker][hasstracker] package.\n\n[homeassistant]: https://www.home-assistant.io/\n[hasstracker]: https://github.com/mueslo/openwrt_hass_devicetracker\n[releases]: https://github.com/oxan/hapt/releases\n[token]: https://developers.home-assistant.io/docs/auth_api/#long-lived-access-token\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxan%2Fhapt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxan%2Fhapt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxan%2Fhapt/lists"}