{"id":20806776,"url":"https://github.com/fed/lightswitch","last_synced_at":"2026-04-22T11:06:45.061Z","repository":{"id":22797283,"uuid":"26143669","full_name":"fed/LightSwitch","owner":"fed","description":"Domotics project using an Android device and a Raspberry Pi","archived":false,"fork":false,"pushed_at":"2014-11-15T18:07:23.000Z","size":5333,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T22:48:54.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/fed.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}},"created_at":"2014-11-03T23:23:52.000Z","updated_at":"2015-01-02T19:21:49.000Z","dependencies_parsed_at":"2022-08-21T02:40:43.072Z","dependency_job_id":null,"html_url":"https://github.com/fed/LightSwitch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fed/LightSwitch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fed%2FLightSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fed%2FLightSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fed%2FLightSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fed%2FLightSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fed","download_url":"https://codeload.github.com/fed/LightSwitch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fed%2FLightSwitch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32132978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-17T19:26:18.404Z","updated_at":"2026-04-22T11:06:40.052Z","avatar_url":"https://github.com/fed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Light Switch\n===============\n\n#### Switching lights remotely with a Raspberry Pi and an Android device\n\n\u003e This is a simple home automation tool that relies on HTTP requests being sent back and forth from an Android app to a Python script running on a Raspberry Pi to remotely turn lights or other devices on and off.\n\n\nArchitecture\n==\n\nThe system architecture is somewhat simple, it consists of an Android application running on any Android device and a Raspberry Pi connected to the Internet. Here's an overview of the project architecture:\n\n\u003cimg src=\"Images/architecture.png\" style=\"width: 100%;\" /\u003e\n\nThe Android app is located under the [LightSwitch](https://github.com/fknussel/home-automation/tree/master/LightSwitch) folder of this repo, whereas the RESTful API developed in Python can be found on the [Raspi](https://github.com/fknussel/home-automation/tree/master/Raspi) folder.\n\n\nNetwork Configuration\n====\n\nIn order for the system to work, you need to configure the IP address that the Raspberry Pi got assigned when connecting to the private network within the Android application. In order to do so, pop open the `networking/RaspiClient.java` file and change the value of the `API_URL` var accordingly.\n\nWiring the Pi\n====\n\nIn order to turn on and off the lightbulb, a relay is controlled through a BC548 NPN transistor from the Raspberry Pi:\n\n\u003cimg src=\"Images/schematic.jpg\" style=\"width: 100%;\" /\u003e\n\n\nScreenshots\n==\n\n\u003ctable style=\"text-align: center;\"\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003cimg src=\"Images/about.png\" style=\"width: 250px;\" /\u003e\u003c/td\u003e\n\t\t\u003ctd\u003e\u003cimg src=\"Images/getting_status.png\" style=\"width: 250px;\" /\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003cimg src=\"Images/lights_off.png\" style=\"width: 250px;\" /\u003e\u003c/td\u003e\n\t\t\u003ctd\u003e\u003cimg src=\"Images/lights_on.png\" style=\"width: 250px;\" /\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n\nUseful Links\n==\n\nHome automation with Raspberry Pi:\n* http://www.makeuseof.com/tag/how-to-build-home-automation-system-raspberry-pi-and-arduino/\n* http://www.instructables.com/id/Raspberry-Pi-GPIO-home-automation/\n* http://www.penguintutor.com/electronics/simple-homeautomation-raspberrypi\n\nSimple RESTful API using Python:\n* http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask\n\nHome automation with Raspberry PI and Arduino using Node.js, MongoDB, HTML5 and Websockets:\n* http://ni-c.github.io/heimcontrol.js/\n\nGPIO libraries:\n* http://pythonhosted.org/RPIO/rpio_py.html#ref-rpio-py-additions\n* http://makezine.com/projects/tutorial-raspberry-pi-gpio-pins-and-python/\n* https://pypi.python.org/pypi/RPi.GPIO","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffed%2Flightswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffed%2Flightswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffed%2Flightswitch/lists"}