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.
- 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
Add Go-Vee to your project:
go get github.com/swrm-io/go-veeimport (
"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()Devices are discovered automatically. You can access them via:
devices := controller.Devices()or by IP
mydevice := controller.DeviceByIP("192.168.0.130")device := controller.DeviceByIP("192.168.0.130")
device.TurnOn()
device.SetBrightness(80)
device.SetColor(govee.Color{R: 255, G: 0, B: 0}) // RedPull requests and issues are welcome!
Apache License 2.0 See the LICENSE file for details.