{"id":26714835,"url":"https://github.com/timothydodd/hubitat-espresense","last_synced_at":"2025-03-27T13:51:12.496Z","repository":{"id":282260063,"uuid":"947990241","full_name":"timothydodd/hubitat-espresense","owner":"timothydodd","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-13T15:38:07.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T16:36:42.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timothydodd.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}},"created_at":"2025-03-13T15:11:22.000Z","updated_at":"2025-03-13T15:38:11.000Z","dependencies_parsed_at":"2025-03-13T16:36:47.438Z","dependency_job_id":null,"html_url":"https://github.com/timothydodd/hubitat-espresense","commit_stats":null,"previous_names":["timothydodd/hubitat-espresense"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Fhubitat-espresense","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Fhubitat-espresense/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Fhubitat-espresense/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Fhubitat-espresense/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timothydodd","download_url":"https://codeload.github.com/timothydodd/hubitat-espresense/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245858872,"owners_count":20684057,"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":[],"created_at":"2025-03-27T13:51:11.843Z","updated_at":"2025-03-27T13:51:12.491Z","avatar_url":"https://github.com/timothydodd.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESPresense Device Tracker MQTT Driver for Hubitat\n\nThis Hubitat driver integrates with [ESPresense](https://github.com/ESPresense/ESPresense) to track device locations within your home based on Bluetooth Low Energy (BLE) signal strength reported by ESPresense nodes.\n\n## Overview\n\nThe ESPresense Device Tracker MQTT Driver connects to your MQTT broker to monitor device proximity data published by ESPresense nodes. It determines which room your device is closest to based on signal strength/distance measurements and provides this information as attributes for use in Hubitat automations.\n\n## Features\n\n- Tracks the closest room for a specified device\n- Maintains history of previous room\n- Records timestamp of room changes\n- Implements 15-second timeout for room data to ensure accuracy\n- Configurable settings for MQTT broker and tracking parameters\n\n## Requirements\n\n- [Hubitat Elevation Hub](https://hubitat.com/)\n- ESPresense nodes configured and installed in your home\n- MQTT broker (like Mosquitto, HiveMQ, etc.)\n- Devices with Bluetooth for tracking (phones, watches, tags, etc.)\n\n## Installation\n\n### Option 1: Hubitat Package Manager (HPM)\n\n1. Install the [Hubitat Package Manager](https://github.com/dcmeglio/hubitat-packagemanager) if you haven't already\n2. Click on \"Package Manager\" in your Hubitat Apps\n3. Click \"Install\" and select \"From a URL\"\n4. Enter the following URL:\n   ```\n   https://raw.githubusercontent.com/timothydodd/hubitat-espresense-mqtt/main/packageManifest.json\n   ```\n5. Click \"Next\" and follow the installation instructions\n\n### Option 2: Manual Installation\n\n1. Go to your Hubitat hub's admin page\n2. Go to \"Developer Tools\" → \"Drivers Code\"\n3. Click \"New Driver\"\n4. Paste the contents of the `espresense-mqtt-driver.groovy` file\n5. Click \"Save\"\n\n## Setup and Configuration\n\n1. Create a new virtual device:\n   - Go to \"Devices\" on your Hubitat\n   - Click \"Add Virtual Device\"\n   - Give it a name (e.g., \"Tim's Phone Location\")\n   - Select \"ESPresense Device Tracker MQTT Driver\" as the Type\n   - Click \"Save Device\"\n\n2. Configure the device:\n   - Click on the newly created device\n   - Enter your MQTT Broker details (e.g., `192.168.1.10:1883`)\n   - Set the MQTT Topic Base (typically `espresense/devices`)\n   - Enter the Device ID to track (e.g., `phone:timsiphone`)\n   - Optionally adjust the data timeout (default: 15 seconds)\n   - Click \"Save Preferences\"\n\n## Device Attributes\n\nThe driver provides the following attributes:\n\n- **closestRoom**: The room the device is currently closest to\n- **previousRoom**: The last room the device was in before the current one\n- **roomChangedDate**: Timestamp when the room last changed\n\n## How It Works\n\n1. The driver subscribes to MQTT topics matching the pattern `espresense/devices/[device-id]/#`\n2. ESPresense nodes publish distance measurements to these topics\n3. The driver tracks the distance from each room's ESPresense node\n4. The room with the smallest distance value is considered the \"closest room\"\n5. Room data older than 15 seconds is considered stale and removed from calculations\n6. When all data is stale, the closest room is set to \"none\"\n\n## Using in Automations\n\nYou can use the device's attributes in Hubitat Rules, Rule Machine, or other apps:\n\n- Turn on lights when entering a room\n- Set thermostat based on room occupancy\n- Play music in the room you're in\n- Trigger notifications when entering or leaving specific areas\n\nExample Rule: \"When closestRoom changes to Kitchen, turn on kitchen lights\"\n\n## Troubleshooting\n\n- **No room data appears**: Verify your MQTT broker connection and topic settings\n- **Inaccurate room detection**: Adjust placement of ESPresense nodes for better coverage\n- **Frequent room changes**: Increase the timeout value to reduce sensitivity to temporary fluctuations\n\n## Version History\n\n- **1.1** (2025-03-13): Added 15-second timeout for room data to improve tracking reliability\n- **1.0** (2025-01-18): Initial release\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Credits\n\n- Developed by Tim Dodd\n- Inspired by and designed to work with [ESPresense](https://github.com/ESPresense/ESPresense)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothydodd%2Fhubitat-espresense","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothydodd%2Fhubitat-espresense","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothydodd%2Fhubitat-espresense/lists"}