govee-lan-control 2.0.1

A package to control Govee devices using their new LAN control.

npm install govee-lan-control

Govee LAN API

Someone will probably make this better than I ever could, but I wan't to abandon Govee's API that uses their servers, since I don't like it.

What is this?

An npm module to control Govee devices using their new LAN API.

What devices are supported?

Check Govee's WLAN Guide, they have a list.


Documentation


Examples

Initial setup

const Govee = require("govee-lan-control");

var govee = new Govee.default();
govee.on("ready", () => {
  console.log("Server/client is ready!");
});
govee.on("deviceAdded", (device) => {
  console.log("New Device!", device.model);
});

Fade to random color and brightness every 2 seconds.

setInterval(() => {
  govee.getDevicesArray()[0].actions.fadeColor({
    time: 2000,
    color: {
      hex: Math.floor(Math.random() * 16777215).toString(16),
    },
    brightness: Math.random() * 100,
  });
}, 2000);

Rainbow (Requires color-rainbow for this example)

const rainbow = require("color-rainbow");

var numColors = 50;
var rainbowColors = rainbow.create(numColors);
var i = 0;

setInterval(() => {
  i++;
  i %= numColors;

  govee.getDevicesArray()[0].actions.setColor({
    rgb: [
      rainbowColors[i].red(),
      rainbowColors[i].green(),
      rainbowColors[i].blue(),
    ],
  });
}, 30);

Node Info

Version: 2.0.1
Updated 2 years, 4 months ago
License: ISC
Rating: 1.0 1

Categories

Actions

Rate:

Downloads

27 in the last week

Nodes

  • Device Added
  • Set Color
  • Set Brightness
  • Set Power
  • Fade Color

Keywords

  • Govee
  • node-red

Maintainers