{"id":25601214,"url":"https://github.com/xeferis/mqtt_usb_switcher","last_synced_at":"2026-04-16T14:04:16.308Z","repository":{"id":191565432,"uuid":"684590503","full_name":"Xeferis/MQTT_USB_Switcher","owner":"Xeferis","description":"Smarthome USB Switch","archived":false,"fork":false,"pushed_at":"2024-06-26T10:32:39.000Z","size":418,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-26T11:59:48.170Z","etag":null,"topics":["esp32","esp32-arduino","mqtt","smarthome","usb","usb-switch","usb-switcher"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Xeferis.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":"2023-08-29T12:59:49.000Z","updated_at":"2024-06-26T10:32:42.000Z","dependencies_parsed_at":"2024-06-26T11:57:46.021Z","dependency_job_id":"ddb79f7e-d4f7-4e68-858d-a16849a1982a","html_url":"https://github.com/Xeferis/MQTT_USB_Switcher","commit_stats":null,"previous_names":["xeferis/mqtt_usb_switcher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xeferis%2FMQTT_USB_Switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xeferis%2FMQTT_USB_Switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xeferis%2FMQTT_USB_Switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xeferis%2FMQTT_USB_Switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xeferis","download_url":"https://codeload.github.com/Xeferis/MQTT_USB_Switcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240044992,"owners_count":19739183,"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":["esp32","esp32-arduino","mqtt","smarthome","usb","usb-switch","usb-switcher"],"created_at":"2025-02-21T15:53:04.765Z","updated_at":"2026-04-16T14:04:16.256Z","avatar_url":"https://github.com/Xeferis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MQTT_USB_Switcher \n\nCurrent Progress: Check [Milestones](https://github.com/Xeferis/MQTT_USB_Switcher/milestones)\n\n## Introduction\n\nRetrofitting an old ugreen usb switcher to be controlled via MQTT and Home Assistant and then Home Kit.  \nTo achieve that, I used and ESP32 Board and one relais. \n\nInstallation on Chip with PlatformiO\n\n### Parts\n- ESP32 Microcontoller ([Link](https://amzn.eu/d/09rRW8V)\n- Arduino Relais ([Link](https://www.amazon.de/dp/B07BVXT1ZK?ref=ppx_pop_mob_ap_share))\n- UGREEN USB 3.0 Switcher ([Link](https://www.amazon.de/dp/B01N6GD9JO?ref=ppx_pop_mob_ap_share))\n- 0,91\" OLED Display ([Link](https://amzn.eu/d/3ufx9ke))\n- Wires\n- 2x 10k Ohm Resistor\n\n### Software needed\n- HomeAssistant  ([Link](https://www.home-assistant.io/))\n- MQTT Brooker Add-On ([Link](https://mosquitto.org/))\n\n---\n\n## Setup\n\n### Communication\n\nMQTT\n\n### Display\n\nFor information purposes I installed an 128x32px OLED display. It shows following informations:\n- WLAN SSID\n- WLAN Strenght in %\n- IP Address\n- Current selected USB Out\n\n### PINs\n\n#### Output\n➡ **PIN 2:** Status LED wich ouput is selected.  \n➡ **PIN 4:** Controlls the relais.  \n\n#### Input\n⬅ **PIN 26:** Output 1 is selected  \n⬅ **PIN 27:** Output 2 is selected  \n\n#### Reserved\n❌ **PIN 21:** Used for OLED connection (I2C SDA)  \n❌ **PIN 22:** Used for OLED connection (I2C SCL)\n\n---\n\n## How does it work ? \n\nThe ESP32 controlls the Relais everytime it gets a command from HomeAssistant.  \nFor every command it pulses for one second, so the Input on the UGREEN USB Switch changes. \n\nOn the setup I Always set the state. So in HomeKit \"On\" is Always Output 1 and \"Off\" is always Output 2\n\n---\n\n## Wiring diagram\n\n![alt Text](docs/Wiringdiagram.jpg)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeferis%2Fmqtt_usb_switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxeferis%2Fmqtt_usb_switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeferis%2Fmqtt_usb_switcher/lists"}