{"id":26285382,"url":"https://github.com/donkaos501/esp32-switch-controller","last_synced_at":"2026-05-11T06:53:24.796Z","repository":{"id":282444283,"uuid":"948613521","full_name":"Donkaos501/ESP32-Switch-Controller","owner":"Donkaos501","description":"It allows an ESP32 microcontroller to send button press events to the Switch Controller, which then triggers actions such as turning on a light via Home Assistant.","archived":false,"fork":false,"pushed_at":"2025-03-14T16:50:24.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T17:37:51.694Z","etag":null,"topics":["arduino","esp32","esp32-arduino"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Donkaos501.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-14T16:36:55.000Z","updated_at":"2025-03-14T17:05:45.000Z","dependencies_parsed_at":"2025-03-14T17:49:55.805Z","dependency_job_id":null,"html_url":"https://github.com/Donkaos501/ESP32-Switch-Controller","commit_stats":null,"previous_names":["donkaos501/esp32-switch-controller"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donkaos501%2FESP32-Switch-Controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donkaos501%2FESP32-Switch-Controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donkaos501%2FESP32-Switch-Controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Donkaos501%2FESP32-Switch-Controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Donkaos501","download_url":"https://codeload.github.com/Donkaos501/ESP32-Switch-Controller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243633587,"owners_count":20322636,"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":["arduino","esp32","esp32-arduino"],"created_at":"2025-03-14T19:24:06.032Z","updated_at":"2026-05-11T06:53:24.755Z","avatar_url":"https://github.com/Donkaos501.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 Switches\r\n\r\nThis project is designed to work with the [Switch Controller App](https://github.com/Donkaos501/SwitchController).  \r\nIt allows an **ESP32 microcontroller** to send button press events to the Switch Controller, which then triggers actions such as turning on a light via **Home Assistant**.\r\n\r\n## Wiring Diagram\r\n![Wiring Diagram](ESP32_diagram.png)\r\n\r\n## Sending Requests from ESP32 to the Switch Controller App\r\n\r\nThe ESP32 can send HTTP POST requests to the **Switch Controller App** to trigger different switch actions.\r\n\r\n```http\r\n# Trigger switch 1 (short press)\r\nPOST http://localhost:8080/esp\r\nContent-Type: application/json\r\n\r\n{\r\n  \"uuid\": \"bd4a6037-0864-4b0e-80e1-8d1c87bf9aa0\",\r\n  \"friendly_name\": \"Küche hinten\",\r\n  \"ip\": \"192.168.101.181\",\r\n  \"action\": \"switch_1_short\"\r\n}\r\n\r\n# Trigger switch 1 (long press)\r\nPOST http://localhost:8080/esp\r\nContent-Type: application/json\r\n\r\n{\r\n  \"uuid\": \"bd4a6037-0864-4b0e-80e1-8d1c87bf9aa0\",\r\n  \"friendly_name\": \"Küche hinten\",\r\n  \"ip\": \"192.168.101.181\",\r\n  \"action\": \"switch_1_long\"\r\n}\r\n\r\n# Trigger switch 2 (short press)\r\nPOST http://localhost:8080/esp\r\nContent-Type: application/json\r\n\r\n{\r\n  \"uuid\": \"bd4a6037-0864-4b0e-80e1-8d1c87bf9aa0\",\r\n  \"friendly_name\": \"Küche hinten\",\r\n  \"ip\": \"192.168.101.181\",\r\n  \"action\": \"switch_2_short\"\r\n}\r\n\r\n# Trigger switch 2 (long press)\r\nPOST http://localhost:8080/esp\r\nContent-Type: application/json\r\n\r\n{\r\n  \"uuid\": \"bd4a6037-0864-4b0e-80e1-8d1c87bf9aa0\",\r\n  \"friendly_name\": \"Küche hinten\",\r\n  \"ip\": \"192.168.101.181\",\r\n  \"action\": \"switch_2_long\"\r\n}\r\n```\r\n\r\n## How It Works\r\n1. **Button Press on ESP32** → The ESP32 detects the button press event.\r\n2. **Sends an HTTP Request** → The ESP32 sends a request to the **Switch Controller App**.\r\n3. **Action Execution** → The Switch Controller App triggers the appropriate action (e.g., turning on a light in **Home Assistant**).\r\n\r\n\r\n---\r\n\r\nThis setup allows for easy integration with **smart home automation**, making it a great way to trigger **Home Assistant scenes, automations, or direct device control** using physical buttons.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonkaos501%2Fesp32-switch-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonkaos501%2Fesp32-switch-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonkaos501%2Fesp32-switch-controller/lists"}