{"id":21915816,"url":"https://github.com/wpernath/light-control","last_synced_at":"2026-04-02T18:53:08.876Z","repository":{"id":44784188,"uuid":"441629487","full_name":"wpernath/light-control","owner":"wpernath","description":"Quarkus demo project to control hue lights with several hue bridges","archived":false,"fork":false,"pushed_at":"2022-04-22T19:01:46.000Z","size":606,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T09:26:33.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/wpernath.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":"2021-12-25T07:40:58.000Z","updated_at":"2022-02-06T13:26:48.000Z","dependencies_parsed_at":"2022-09-03T06:11:16.317Z","dependency_job_id":null,"html_url":"https://github.com/wpernath/light-control","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Flight-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Flight-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Flight-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Flight-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpernath","download_url":"https://codeload.github.com/wpernath/light-control/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244936493,"owners_count":20535021,"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":"2024-11-28T19:14:23.962Z","updated_at":"2025-12-30T22:37:03.564Z","avatar_url":"https://github.com/wpernath.png","language":"Java","readme":"# light-control \n\nThis is a simple Quarkus project which was originally planned and designed as a more advanced demo for the features of Quarkus: REST client, REST easy service, Qute, Panache, OpenShift and Image creation.\n\n## Description\nIf you have more than one Hue Bridge in your Home Automation, you might now that you need to switch between bridges if you want to turn on/off lights in for example 1st floor and 2nd floor. \n\nThis project can use several bridges and provides one big database with all rooms and lights in it. If you want to turn on/off a light or a room you don't have to worry about the bridge it belongs to. \n\nlight-control also comes with a simple UI\n\n## API\nAll API calls are relative to `/api/` and are generated by `org.wanja.hue.PublicApiResource.java`\n\n## UI\nAll UI calls are relative to `/ui/` and are generated via Qute by `org.wanja.hue.render.PublicRenderResource.java`.\n\nThe main qute template is `src/main/resources/templates/index.html`. It includes other content templates based on state (`favorites.html`, `room.html`). It also makes use of `javascript.txt` template.\n\n## Build \u0026 Run\n### Configure your `src/main/resources/application.properties`\nConfigure any number of Hue Bridges like:\n\n```\nhue.bridges[n].name = \u003cbridge name\u003e\nhue.bridges[n].base-url=http://192.168.2.126/api/\nhue.bridges[n].auth-token=\u003cyour auth token\u003e\n```\n\nwhere `n` is between `0 and maxint`. \n\n### Build \u0026 debug\nIn order to build this project, you need to have\n- Maven \n- Java 11\n- Docker Desktop\n\n\n```bash\n$\u003e mvn clean quarkus:dev\n```\n\nThis builds the project and starts light-control in Quarkus Dev Mode.\n\n### Build Container Image to run it on Kubernetes / OpenShift\nThis builds and pushes the container image into your registry. \n\n```bash\n$\u003e mvn package -Dquarkus.container-image.push=true \\\n               -Dquarkus.container-image.image=quay.io/\u003cyourid\u003e/light-control:v1.0.3\n```\n**NOTE:** You could define any container-image.image here. And any docker-compliant registry. I am using Quay.io here. \n\nQuarkus is also generating Kubernetes / OpenShift files, which you can find in `target/kubernetes`. To run this on one of those Container platforms, simply execute the following:\n\n```bash\n$\u003e kubectl apply -f target/kubernetes/[openshift|kubernetes].yml\n```\n\nPlease keep in mind that you first need to install a PostgreSQL database instance in the same namespace. Do this on for example OpenShift via:\n\n```bash\n$\u003e oc new-app postgresql-persistent \\\n\t-p POSTGRESQL_USER=\u003cyour user\u003e \\\n\t-p POSTGRESQL_PASSWORD=\u003cyour password\u003e \\\n\t-p POSTGRESQL_DATABASE=lightsdb \\\n\t-p DATABASE_SERVICE_NAME=lightsserver\n```\n\nBut you could also install Crunchy's PostgreSQL Operator and install an instance from them.\n\nAnd finally, you either need to change `application.properties` again and change the connection settings or you need to specify the following ENV variables to the Kubernetes Deployment:\n\n- `DB_USER`\n- `DB_PASSWORD`\n- `DB_DATABASE`\n- `DB_HOST`\n\n### Filling the database\nRight now, light-control does not provide an UI interface to scan the database, so you have to do it manually by sending a POST request to `http://\u003curl\u003e/api/bridge/init`. For example via `httpie`:\n\n```bash\n$\u003e http POST :8080/api/bridge/init\n```\n\nThis will fill the local database when you're running quarkus:dev.\n\n## Running the UI\nThe UI is available under `http://localhost:8080/ui/index` and should be self explaining, although still a technical preview, as I am by far no front end designer. \n\n## Playing with the API\nEverything is available via API. Starting URL is `/api`. \n\n- GET /api/bridge\n  - Consumes: application/json\n  - Produces: application/json\n- DELETE /api/bridge/init\n  - Consumes: application/json\n  - Produces: application/json\n- POST /api/bridge/init\n  - Consumes: application/json\n  - Produces: application/json\n- GET /api/lights/q\n  - Consumes: application/json\n  - Produces: application/json\n- PUT /api/lights/q\n  - Consumes: application/json\n  - Produces: application/json\n- GET /api/lights/toggle\n  - Consumes: text/plain\n  - Produces: application/json\n- GET /api/rooms\n  - Consumes: application/json\n  - Produces: application/json\n- GET /api/rooms/q\n  - Consumes: application/json\n  - Produces: application/json\n- PUT /api/rooms/q\n  - Consumes: application/json\n  - Produces: application/json\n- GET /api/rooms/toggle\n  - Consumes: text/plain\n  - Produces: application/json\n- GET /api/sensors\n  - Consumes: application/json\n  - Produces: application/json\n- GET /api/sensors/{id}\n  - Consumes: application/json\n  - Produces: application/json\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpernath%2Flight-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpernath%2Flight-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpernath%2Flight-control/lists"}