{"id":26714833,"url":"https://github.com/timothydodd/eufy-mqtt-service","last_synced_at":"2025-03-27T13:51:11.728Z","repository":{"id":283468313,"uuid":"951625594","full_name":"timothydodd/eufy-mqtt-service","owner":"timothydodd","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-20T11:26:55.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T12:33:28.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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-20T01:30:24.000Z","updated_at":"2025-03-20T11:26:59.000Z","dependencies_parsed_at":"2025-03-21T14:05:25.590Z","dependency_job_id":null,"html_url":"https://github.com/timothydodd/eufy-mqtt-service","commit_stats":null,"previous_names":["timothydodd/eufy-mqtt-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Feufy-mqtt-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Feufy-mqtt-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Feufy-mqtt-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothydodd%2Feufy-mqtt-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timothydodd","download_url":"https://codeload.github.com/timothydodd/eufy-mqtt-service/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.277Z","updated_at":"2025-03-27T13:51:11.718Z","avatar_url":"https://github.com/timothydodd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eufy To MQTT Service\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\" alt=\"TypeScript\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Node.js-339933?style=for-the-badge\u0026logo=nodedotjs\u0026logoColor=white\" alt=\"Node.js\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/MQTT-3C5280?style=for-the-badge\u0026logo=eclipse-mosquitto\u0026logoColor=white\" alt=\"MQTT\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge\u0026logo=docker\u0026logoColor=white\" alt=\"Docker\"/\u003e\n\u003c/div\u003e\n\nA service that connects your Eufy Security cameras to MQTT, enabling easy integration with home automation systems like Home Assistant, Node-RED, or any other MQTT-compatible platform.\n\nThis project is NOT affiliated with, endorsed by, or connected to Anker or Eufy Security in any way. This is an independent, community-driven project that uses the Eufy security API.\n\n\n## 📋 Prerequisites\n\n- Node.js 16 or later\n- Eufy Security account with cameras set up\n- MQTT broker (like Mosquitto, HiveMQ, EMQ X, etc.)\n\n## 📦 Installation\n\n### Option 1: Running locally\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/yourusername/eufy-mqtt-service.git\n   cd eufy-mqtt-service\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file with your configuration:\n   ```bash\n   cp .env.example .env\n   ```\n   Then edit the `.env` file with your Eufy and MQTT credentials.\n\n4. Compile TypeScript:\n   ```bash\n   npm run build\n   ```\n\n5. Start the service:\n   ```bash\n   npm start\n   ```\n\n6. Access the web interface:\n   Open your browser and navigate to http://localhost:3000 (or your configured port)\n\n### Option 2: Using Docker\n\n1. Create a `.env` file with your configuration as described above.\n\n2. Build the Docker image:\n   ```bash\n   docker build -t eufy-mqtt-service .\n   ```\n\n3. Run the container:\n   ```bash\n   docker run -d --name eufy-mqtt -p 3000:3000 -v $(pwd)/persistent:/app/persistent --env-file .env eufy-mqtt-service\n   ```\n\n4. Access the web interface:\n   Open your browser and navigate to http://localhost:3000\n\n## 🌐 Web Interface\n\nThe service includes a web interface that provides:\n\n1. **Authentication Handling**:\n   - Displays captcha images when required by Eufy\n   - Provides a form to submit two-factor authentication codes\n   - No need to restart the service when authentication challenges occur\n\n2. **Device Status**:\n   - Shows all connected devices\n   - Displays device properties and their current values\n   - Shows connection status\n\n3. **Event History**:\n   - Lists recent events from all devices\n   - Shows timestamps for when events occurred\n\nTo access the web interface, open your browser and navigate to `http://localhost:3000` (or your configured port).\n\n## 🔑 Authentication Flow\n\nThe authentication process is now much easier:\n\n1. Start the service with your Eufy credentials in the `.env` file\n2. If Eufy requires a captcha or two-factor authentication:\n   - The web interface will automatically show the appropriate form\n   - For captcha, you'll see the image directly in your browser\n   - For 2FA, you'll get a form to enter the code sent to your email\n3. Submit the required information through the web interface\n4. The service will continue the authentication process automatically\n\n## 📡 MQTT Topics\n\nThe service publishes events to the following topic structure:\n\n- `eufy/events/status` - Connection status\n- `eufy/events/{device-name}/{property}` - Device property values\n- `eufy/events/{device-name}/event/motion` - Motion detection events\n- `eufy/events/{device-name}/event/person` - Person detection events\n- `eufy/events/{device-name}/event/pet` - Pet detection events\n- `eufy/events/{device-name}/event/dog` - Dog detection events\n- `eufy/events/{device-name}/event/vehicle` - Vehicle detection events\n- `eufy/events/{device-name}/event/sound` - Sound detection events\n- `eufy/events/{device-name}/event/crying` - Crying detection events\n- `eufy/events/{device-name}/event/doorbell` - Doorbell ring events\n- `eufy/events/{device-name}/event/package` - Package delivery events\n\n## 📝 Message Format\n\nEvent messages are published in JSON format:\n\n```json\n{\n  \"timestamp\": \"2023-04-25T15:30:45.123Z\"\n}\n```\n\nProperty values are published as JSON with the actual property value:\n\n```json\n\"75\"\n```\n\nor\n\n```json\ntrue\n```\n\nThe status message has this format:\n\n```json\n{\n  \"status\": \"connected\",\n  \"timestamp\": \"2023-04-25T15:30:45.123Z\"\n}\n```\n\n## ⚙️ Configuration Options\n\nSet these values in your `.env` file:\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| EUFY_USERNAME | Your Eufy Security email address | - |\n| EUFY_PASSWORD | Your Eufy Security password | - |\n| EUFY_COUNTRY | Your country code | US |\n| EUFY_LANGUAGE | Your language code | en |\n| PERSISTENT_DIR | Directory to store persistent data | ./persistent |\n| TRUSTED_DEVICE_NAME | Name of your device in Eufy | eufy-mqtt-service |\n| P2P_CONNECTION_SETUP | P2P connection type (2=quickest, 1=prefer P2P)| 1 |\n| POLLING_INTERVAL_MINUTES | How often to poll Eufy cloud | 10 |\n| EVENT_DURATION_SECONDS | Duration to consider events active | 10 |\n| ACCEPT_INVITATIONS | Whether to accept device sharing invitations | false |\n| WEB_PORT | Port for the web interface | 3000 |\n| MQTT_BROKER_URL | URL of your MQTT broker | mqtt://localhost:1883 |\n| MQTT_USERNAME | MQTT username (if required) | - |\n| MQTT_PASSWORD | MQTT password (if required) | - |\n| MQTT_TOPIC | Base topic for all events | eufy/events |\n| MQTT_CLIENT_ID | Client ID for MQTT connection | eufy-mqtt-service |\n\n## 🛠️ Troubleshooting\n\n- **Service not connecting to Eufy**: Check your Eufy credentials and ensure you can log in to the Eufy Security app\n- **MQTT messages not being received**: Verify your MQTT broker configuration and test with an MQTT client\n- **Web interface not loading**: Make sure port 3000 (or your configured port) is accessible\n- **Captcha or 2FA not working**: Try refreshing the web interface and submitting again\n\n## 📄 License\n\nMIT\n\n## 🙏 Acknowledgements\n\nThis project uses the excellent [eufy-security-client](https://github.com/bropat/eufy-security-client) library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothydodd%2Feufy-mqtt-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothydodd%2Feufy-mqtt-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothydodd%2Feufy-mqtt-service/lists"}