https://github.com/swrm-io/go-vee
Golang Govee API Library
https://github.com/swrm-io/go-vee
api govee home-automation lights
Last synced: 5 months ago
JSON representation
Golang Govee API Library
- Host: GitHub
- URL: https://github.com/swrm-io/go-vee
- Owner: swrm-io
- License: apache-2.0
- Created: 2025-09-08T17:02:29.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-12-16T17:01:57.000Z (6 months ago)
- Last Synced: 2025-12-19T06:31:29.334Z (6 months ago)
- Topics: api, govee, home-automation, lights
- Language: Go
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go-Vee
Go-Vee is a Go library for controlling Govee smart devices over the local network. It provides a simple API to discover devices, send commands, and receive status updates using UDP multicast and unicast communication.
## Features
- Device discovery via multicast
- Turn devices on/off
- Toggle device state
- Set brightness
- Set color (RGB)
- Set color temperature (Kelvin)
- Device status and response handling
## Installation
Add Go-Vee to your project:
```sh
go get github.com/swrm-io/go-vee
```
## Usage
### 1. Create a Controller
```go
import (
"log/slog"
"github.com/swrm-io/go-vee"
)
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))
controller := govee.NewController(logger)
go func() {
err := controller.Start()
if err != nil {
logger.Error("Failed to start controller", "error", err)
}
}
time.Sleep(1 * time.Minute)
controller.Shutdown()
```
### 2. Discover Devices
Devices are discovered automatically. You can access them via:
```go
devices := controller.Devices()
```
or by IP
```go
mydevice := controller.DeviceByIP("192.168.0.130")
```
### 3. Send Commands
```go
device := controller.DeviceByIP("192.168.0.130")
device.TurnOn()
device.SetBrightness(80)
device.SetColor(govee.Color{R: 255, G: 0, B: 0}) // Red
```
## Contributing
Pull requests and issues are welcome!
## License
Apache License 2.0
See the LICENSE file for details.