{"id":13850753,"url":"https://github.com/Collinux/GoHue","last_synced_at":"2025-07-12T23:32:00.294Z","repository":{"id":44487158,"uuid":"50216990","full_name":"Collinux/gohue","owner":"Collinux","description":":bulb: [Officially featured on the Philips Hue® Developer site] Go library \"hue\" interfaces Philips Hue devices to control and monitor lights, scenes, schedules, and groups.","archived":false,"fork":false,"pushed_at":"2020-05-27T07:32:46.000Z","size":144,"stargazers_count":66,"open_issues_count":4,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-05T21:28:05.519Z","etag":null,"topics":["bridge","color","control-lights","gateway","go","hue","interface","light","light-bulbs","light-library","lights","lights-attributes","philips","philips-hue","philips-hue-lighting","rest-api","scenes","schedule-attributes","schedules","sensor"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/collinux/gohue","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Collinux.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}},"created_at":"2016-01-23T01:00:28.000Z","updated_at":"2023-12-26T13:28:17.000Z","dependencies_parsed_at":"2022-08-28T20:20:28.250Z","dependency_job_id":null,"html_url":"https://github.com/Collinux/gohue","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collinux%2Fgohue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collinux%2Fgohue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collinux%2Fgohue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collinux%2Fgohue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Collinux","download_url":"https://codeload.github.com/Collinux/gohue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225844870,"owners_count":17533160,"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":["bridge","color","control-lights","gateway","go","hue","interface","light","light-bulbs","light-library","lights","lights-attributes","philips","philips-hue","philips-hue-lighting","rest-api","scenes","schedule-attributes","schedules","sensor"],"created_at":"2024-08-04T21:00:17.691Z","updated_at":"2024-11-22T04:30:53.522Z","avatar_url":"https://github.com/Collinux.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# GoHue\nPackage hue interfaces Philips Hue devices to control lights, scenes, schedules, and groups.\n\n[![GoDoc](https://camo.githubusercontent.com/b3b2a2b7fad4e76052830945cd839a3bba5be723/687474703a2f2f696d672e736869656c64732e696f2f62616467652f676f646f632d7265666572656e63652d3532373242342e706e67)](https://godoc.org/github.com/Collinux/GoHue)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Collinux/GoHue)](https://goreportcard.com/report/github.com/Collinux/GoHue)\n[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fatrox%2Fsync-dotenv%2Fbadge)](https://github.com/collinux/gohue)\n\n## See GoHue in action!\n##### Have a cool project you made using GoHue? Add yours here in a pull request!\n[HueBeat](https://github.com/Mobilpadde/HueBeat) by [Mobilpadde](https://github.com/mobilpadde) - Light up a room in sync with your heartbeat.\n\n[BitHue](https://github.com/realytcracker/go-bithue) by [ytcracker](https://github.com/realytcracker) - Light color according to profit gain/loss in bitcoin price\n\n## Installation\n```\ngo get github.com/collinux/gohue\n```\n\n## Usage\n```\npackage main\n\nimport (\n    \"github.com/collinux/gohue\"\n)\n\nfunc main() {\n    // It is recommended that you save the username from bridge.CreateUser\n    // so you don't have to press the link button every time and re-auth.\n    // When CreateUser is called it will print the generated user token.\n    bridgesOnNetwork, _ := hue.FindBridges()\n    bridge := bridgesOnNetwork[0]\n    username, _ := bridge.CreateUser(\"someusernamehere\")\n    bridge.Login(username)\n\n    lights, _ := bridge.GetAllLights()\n    for _, light := range lights {\n        light.SetBrightness(100)\n        light.ColorLoop(true)\n    }\n\n    nightstandLight, _ := bridge.GetLightByName(\"Nightstand\")\n    nightstandLight.Blink(5)\n    nightstandLight.SetName(\"Bedroom Lamp\")\n\n    lights[0].SetColor(hue.RED)\n    lights[1].SetColor(hue.BLUE)\n    lights[2].SetColor(hue.GREEN)\n\n    for _, light := range lights {\n        light.Off()\n    }\n}\n```\n\n## Testing \u0026 Validation\n1. Set the environment variable \"HUE_USER_TOKEN\" \n    (example: `export HUE_USER_TOKEN=\"sby7xirR87dUpnfzp1yGRVBeP0Zoxo3LH1krNxSi\"`)\n2. Run `go test *_test.go` \n3. Wait for all covered tests to be executed (Estimated 15 seconds - may vary depending on network latency).\n\n## Features\n##### Lights\n- [x] Get all lights\n- [x] Get light by name\n- [x] Get light by index on bridge\n- [x] Get lights attributes and state\n- [x] Set lights attributes (rename)\n- [x] Set light state (color, effects, brightness, etc)\n- [x] Delete light\n- [x] Turn On, Off, Toggle\n- [x] Blink\n- [x] Colorloop On/Off\n\n##### Bridge\n- [x] Create user\n- [x] Delete user\n- [x] Get configuration\n- [ ] Modify configuration\n- [ ] Get full state (datastore)\n- [x] Search for bridges\n- [x] Search for new lights\n- [ ] Get all timezones\n\n##### Schedules\n- [x] Get all schedules\n- [x] Get schedule by ID\n- [x] Get schedule attributes\n- [ ] Create schedules\n- [ ] Set schedule attributes\n- [ ] Delete schedule\n\n##### Scenes\n- [x] Get all scenes\n- [x] Get scene by ID\n- [x] Create scene\n- [ ] Modify scene\n- [ ] Recall scene\n- [ ] Delete scene\n\n##### Groups\n- [ ] Get all groups\n- [ ] Create group\n- [ ] Get group attributes\n- [ ] Set group attributes\n- [ ] Set group state\n- [ ] Delete Group\n\n##### Sensors\n- [x] Get all sensors\n- [ ] Create sensor\n- [ ] Find new sensors\n- [ ] Get new sensors\n- [ ] Get sensor\n- [x] Update sensor\n- [ ] Delete sensor\n- [ ] Change sensor configuration\n\n##### Rules\n- [ ] Get all rules\n- [ ] Get rule\n- [ ] Create rule\n- [ ] Update rule\n- [ ] Delete rule\n\n## API Documentation\nThis repository is featured on the Philips Hue® developer site and was not developed by \"Philips Lighting Holding B.V\"...\nfor official Hue® documentation check out the [Philips Hue® website](http://www.developers.meethue.com/philips-hue-api). This codebase comes with no guaranetees. Use at your own risk.\n\n## License\nGoHue - Third party golang library for Philips Hue® gateway interface.\nCopyright (C) 2016 Collinux \nGPL version 2 or higher http://www.gnu.org/licenses/gpl.html  \n\n## Contributing  \nPull requests happily accepted on GitHub\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCollinux%2FGoHue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCollinux%2FGoHue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCollinux%2FGoHue/lists"}