{"id":18060195,"url":"https://github.com/dra1ex/esp_ir_motion","last_synced_at":"2026-05-05T04:32:38.903Z","repository":{"id":256784374,"uuid":"856294391","full_name":"DrA1ex/esp_ir_motion","owner":"DrA1ex","description":"Smart IR Motion Sensor based on ESP32/ESP8266","archived":false,"fork":false,"pushed_at":"2024-10-28T11:43:42.000Z","size":207,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T20:49:38.371Z","etag":null,"topics":["esp32","esp8266","motion-sensor","mqtt"],"latest_commit_sha":null,"homepage":"https://dra1ex.github.io/esp_ir_motion/","language":"C++","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/DrA1ex.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":"2024-09-12T10:32:27.000Z","updated_at":"2024-10-28T11:43:45.000Z","dependencies_parsed_at":"2025-02-10T23:02:51.025Z","dependency_job_id":null,"html_url":"https://github.com/DrA1ex/esp_ir_motion","commit_stats":null,"previous_names":["dra1ex/esp_ir_motion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DrA1ex/esp_ir_motion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_ir_motion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_ir_motion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_ir_motion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_ir_motion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrA1ex","download_url":"https://codeload.github.com/DrA1ex/esp_ir_motion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrA1ex%2Fesp_ir_motion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012807,"owners_count":26085191,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["esp32","esp8266","motion-sensor","mqtt"],"created_at":"2024-10-31T04:06:26.944Z","updated_at":"2025-10-12T20:49:38.877Z","avatar_url":"https://github.com/DrA1ex.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-ir-motion\n\nSmart IR Motion Sensor based on ESP32/ESP8266\n\n## UI\n\n\u003cimg width=\"400\" alt=\"image\" src=\"https://github.com/user-attachments/assets/74e611aa-806a-4f24-8b23-0de276ac219f\"\u003e\n\n\n## Features\n- Web/Mobile Application (PWA)\n- Optional sound and visual (LED) alerting\n- Integration with any Smart Home Assistant (such as Alise) via MQTT broker\n- MQTT Protocol\n\n## Connection\n\n\u003cimg width=\"500\" alt=\"image\" src=\"https://github.com/user-attachments/assets/268893e3-76d1-4b24-b517-b7de0e2e3fee\"\u003e\n\n\n## Installation\n\n### Manual Build / OTA\n\n\n1. Install [Platform.IO](https://platformio.org/install):\n2. (Optional) Modify the `credentials.h` file and, if necessary, customize `constants.h`. You can change these parameters later through the Web UI.\n3. Upload filesystem and firmware\n\n**Note:** This repository contains a submodule. Please use the `--recursive` option when cloning.\n\n```bash\ngit clone --recursive https://github.com/DrA1ex/esp_ir_motion.git\ncd esp_ir_motion\n\n# Make script executable\nchmod +x ./upload_fs.sh\n\n# Specify the platform: esp32-c3 or esp8266\nPLATFORM=esp32-c3\n\n# Set the environment: debug, release, or ota\nENV=release\n\n# For OTA: set your ESP's address\nADDRESS=esp_motion.local\n\n# Additional envs if OTA enabled\nif [ \"$ENV\" = \"ota\" ]; then OTA=1 else OTA=0 ADDRESS= fi\n\npio run -t upload -e $PLATFORM-$ENV --upload-port \"$ADDRESS\"\n./upload_fs.sh --upload-port \"$ADDRESS\"\n```\n\n\n## MQTT Protocol\n\n| Topic In *       \t\t\t| Topic Out *          \t\t\t| Type        | Values\t\t         | Comments                              |\n|---------------------------|-------------------------------|-------------|----------------------|---------------------------------------|\n| `MQTT_TOPIC_POWER`\t\t| `MQTT_OUT_TOPIC_POWER` \t\t| `uint8_t`   | 0..1      \t     \t | Power state: ON (1) / OFF (0)         |\n| `MQTT_TOPIC_PAUSE`\t\t| `MQTT_OUT_TOPIC_PAUSE` \t\t| `uint8_t`   | 0..1      \t     \t | Trigger Silent mode (default time)    |\n| `MQTT_TOPIC_SILENT`       |                      \t    \t| `uint32_t`  | duration in seconds  | Set Silent mode for custom time       |\n|                   \t\t| `MQTT_OUT_TOPIC_ALARM` \t   \t| `uint8_t`   | 0..1                 | Indicates alarm state                 |\n\n\\* Actual topic values decalred in `constants.h`\n\n## Misc\n\n### Configuring a Secure WebSocket Proxy with Nginx\n\nIf you're hosting a Web UI that uses SSL, you'll need to set up a Secure WebSocket (`wss://...`) server instead of the non-secure `ws://` provided by your ESP. Browsers require secure socket connections for WebSocket functionality, so this configuration is essential.\n\nTo achieve this, you can use Nginx as a proxy to create an SSL-enabled WebSocket connection.\n\n#### Step 0: Install Nginx\n\n```sh\napt install nginx\n```\n\n#### Step 1: Create the Nginx Configuration\n\nCreate a file at `/etc/nginx/conf.d/ws.locations` and add the following content:\n\n```nginx\nlocation /w_esp_ir_motion/ws {\n    proxy_pass http://\u003cYOUR-ESP-IP-HERE_1\u003e/ws; # Replace with your actual service address\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection keep-alive;\n    proxy_set_header Host $host;\n}\n\n# You can create proxy for multiple hosts\nlocation /w_esp_ir_motion_2/ws {\n    proxy_pass http://\u003cYOUR-ESP-IP-HERE_2\u003e/ws; # Replace with your actual service address\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection keep-alive;\n    proxy_set_header Host $host;\n}\n```\n\n#### Step 2: Reload the Nginx Configuration\n\nAfter saving the configuration file, reload Nginx to apply the changes:\n\n```sh\nnginx -s reload\n```\n\n**Note**\nMake sure to replace `\u003cYOUR-ESP-IP-HERE_1\u003e` and `\u003cYOUR-ESP-IP-HERE_2\u003e` with the actual IP addresses of your ESP devices.\n\n#### Step 3: Check result\n\nOpen WebUi in browser https://dra1ex.github.io/esp_ir_motion/?host=ADDRESS/w_esp_ir_motion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdra1ex%2Fesp_ir_motion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdra1ex%2Fesp_ir_motion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdra1ex%2Fesp_ir_motion/lists"}