### Manage service lifecycle Source: https://github.com/wez/govee2mqtt/blob/main/docs/DOCKER.md Commands to start the container and monitor application logs. ```console $ docker compose up -d ``` ```console $ docker logs govee2mqtt --follow ``` -------------------------------- ### Deploy Govee to MQTT with Docker Source: https://context7.com/wez/govee2mqtt/llms.txt Setup instructions for deploying govee2mqtt as a Docker container. Create a .env file for credentials and configuration, then use docker-compose to launch the service. Host networking is required for LAN discovery. ```bash # Create .env file with credentials cat > .env << 'EOF' # Govee credentials (strongly recommended) GOVEE_EMAIL=user@example.com GOVEE_PASSWORD=secret GOVEE_API_KEY=your-uuid-api-key # MQTT broker configuration GOVEE_MQTT_HOST=mqtt.local GOVEE_MQTT_PORT=1883 GOVEE_MQTT_USER=mqtt_user GOVEE_MQTT_PASSWORD=mqtt_password # Temperature scale: C (Celsius) or F (Fahrenheit) GOVEE_TEMPERATURE_SCALE=C # LAN API options GOVEE_LAN_NO_MULTICAST=false GOVEE_LAN_BROADCAST_ALL=true GOVEE_LAN_SCAN=192.168.1.100,192.168.1.101 # Logging configuration RUST_LOG_STYLE=always RUST_LOG=govee=info TZ=America/New_York EOF # docker-compose.yml cat > docker-compose.yml << 'EOF' name: govee2mqtt services: govee2mqtt: image: ghcr.io/wez/govee2mqtt:latest container_name: govee2mqtt restart: unless-stopped env_file: - .env network_mode: host volumes: - govee2mqtt_data:/data volumes: govee2mqtt_data: EOF # Launch and view logs docker compose up -d docker logs govee2mqtt --follow ``` -------------------------------- ### Extract Platform API State for Troubleshooting Source: https://github.com/wez/govee2mqtt/blob/main/addon/CHANGELOG.md This example shows how to extract platform metadata and state for a specific entity using Jinja templating in Home Assistant. It's useful for troubleshooting and sharing diagnostic information. ```jinja {{{ "meta": state_attr('sensor.smart_humidifier_status', 'platform_metadata'), "state": state_attr('sensor.smart_humidifier_status', 'platform_state'), }}} ``` -------------------------------- ### GET /api/device/{id}/brightness/{level} Source: https://context7.com/wez/govee2mqtt/llms.txt Sets the brightness level for a light device. ```APIDOC ## GET /api/device/{id}/brightness/{level} ### Description Set the brightness level of a light device as a percentage from 0-100. ### Method GET ### Endpoint /api/device/{id}/brightness/{level} ### Parameters #### Path Parameters - **id** (string) - Required - The unique device ID. - **level** (integer) - Required - Brightness percentage (0-100). ### Response #### Success Response (200) - **code** (integer) - Status code 200. - **msg** (string) - Confirmation message 'ok'. #### Response Example { "code": 200, "msg": "ok" } ``` -------------------------------- ### GET /api/devices Source: https://context7.com/wez/govee2mqtt/llms.txt Retrieves a list of all discovered Govee devices along with their current state, IP addresses, and room assignments. ```APIDOC ## GET /api/devices ### Description Returns a JSON array of all discovered Govee devices with their current state, IP addresses, and room assignments. ### Method GET ### Endpoint /api/devices ### Response #### Success Response (200) - **Array** (object) - A list of device objects containing sku, id, name, room, ip, and state. #### Response Example [ { "sku": "H6159", "id": "AA:BB:CC:DD:EE:FF:GG:HH", "name": "Living Room Light Strip", "room": "Living Room", "ip": "192.168.1.100", "state": { "on": true, "brightness": 80, "color": {"r": 255, "g": 200, "b": 100}, "color_temperature_kelvin": 4000 } } ] ``` -------------------------------- ### LAN Discovery Configuration Source: https://context7.com/wez/govee2mqtt/llms.txt Configuration options for LAN discovery to improve reliability across different network setups. ```APIDOC ## LAN Discovery Configuration ### Description Configure LAN discovery options to handle various network topologies, especially when multicast UDP doesn't work reliably across WiFi routers and VLANs. ### Environment Variables - **GOVEE_LAN_NO_MULTICAST** (boolean): Set to `true` to disable default multicast (239.255.255.250). - **GOVEE_LAN_BROADCAST_ALL** (boolean): Set to `true` to broadcast to all network interfaces. - **GOVEE_LAN_BROADCAST_GLOBAL** (boolean): Set to `true` to broadcast to 255.255.255.255. - **GOVEE_LAN_SCAN** (string): Specify a comma-separated list of specific IPs or broadcast addresses to scan (e.g., "192.168.1.100,192.168.1.101,10.0.0.255"). - **GOVEE_LAN_DISCO_TIMEOUT** (integer): Set the discovery timeout in seconds. ### Network Requirements - **govee2mqtt UDP Port**: Must bind to UDP port 4002. - **Govee Device UDP Ports**: Devices listen on UDP ports 4001 (discovery) and 4003 (commands). - **Multicast Group**: Devices join the multicast group 239.255.255.250. - **Response Port**: Responses come from the device IP to port 4002 (not the original source port). ### Example Usage (Environment Variables) ```bash export GOVEE_LAN_NO_MULTICAST=false export GOVEE_LAN_BROADCAST_ALL=true export GOVEE_LAN_BROADCAST_GLOBAL=true export GOVEE_LAN_SCAN="192.168.1.100,192.168.1.101,10.0.0.255" export GOVEE_LAN_DISCO_TIMEOUT=5 ``` ``` -------------------------------- ### GET /api/device/{id}/power/{state} Source: https://context7.com/wez/govee2mqtt/llms.txt Controls the power state of a specific Govee device by ID. ```APIDOC ## GET /api/device/{id}/power/{state} ### Description Turn a specific device on or off. ### Method GET ### Endpoint /api/device/{id}/power/{state} ### Parameters #### Path Parameters - **id** (string) - Required - The unique device ID. - **state** (string) - Required - The desired power state: 'on' or 'off'. ### Response #### Success Response (200) - **code** (integer) - Status code 200. - **msg** (string) - Confirmation message 'ok'. #### Response Example { "code": 200, "msg": "ok" } ``` -------------------------------- ### Control Govee Device Power via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Turn Govee devices on or off using simple GET requests to the power control endpoints. Replace the device ID with the actual ID of the target device. ```bash # Turn on a device curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/power/on" # Response: {"code": 200, "msg": "ok"} # Turn off a device curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/power/off" # Response: {"code": 200, "msg": "ok"} # Error response when device not found: # {"code": 404, "msg": "device AA:BB:CC:DD:EE:FF:GG:HH not found"} ``` -------------------------------- ### Configure environment variables Source: https://github.com/wez/govee2mqtt/blob/main/docs/DOCKER.md Create a .env file to define Govee credentials, MQTT broker settings, and logging preferences. ```bash # Optional, but strongly recommended GOVEE_EMAIL=user@example.com GOVEE_PASSWORD=secret # Optional, but recommended GOVEE_API_KEY=UUID GOVEE_MQTT_HOST=mqtt GOVEE_MQTT_PORT=1883 # Uncomment if your mqtt broker requires authentication #GOVEE_MQTT_USER=user #GOVEE_MQTT_PASSWORD=password # Specify the temperature scale to use, either C for Celsius # or F for Fahrenheit GOVEE_TEMPERATURE_SCALE=C # Always use colorized output RUST_LOG_STYLE=always # If you are asked to set the debug level, uncomment the next line #RUST_LOG=govee=trace # Set the timezone for timestamps in the log TZ=America/Phoenix ``` -------------------------------- ### Configure Govee to MQTT Add-On Source: https://context7.com/wez/govee2mqtt/llms.txt Configuration options for the Home Assistant Add-On. Set temperature scale, Govee account credentials, API key, and MQTT broker details. Leave MQTT host empty for auto-discovery with the Mosquitto add-on. ```yaml options: temperature_scale: "C" # Temperature display: "C" or "F" govee_email: "user@example.com" # Govee account email (recommended) govee_password: "secret" # Govee account password (recommended) govee_api_key: "your-api-key" # Platform API key (optional but recommended) mqtt_host: "" # Leave empty for auto-discovery with Mosquitto add-on mqtt_port: 1883 # MQTT broker port mqtt_username: "" # MQTT auth username (if required) mqtt_password: "" # MQTT auth password (if required) no_multicast: false # Disable multicast discovery broadcast_all: false # Broadcast to all network interfaces global_broadcast: false # Use 255.255.255.255 broadcast scan: "192.168.1.100,192.168.1.101" # Comma-separated device IPs to scan ``` -------------------------------- ### List Scenes via LAN CLI Source: https://context7.com/wez/govee2mqtt/llms.txt List all available scenes for a Govee device by querying it directly over the LAN using the CLI. This helps in identifying scene names for activation. ```bash ./govee lan-control --ip 192.168.1.100 scene --list ``` -------------------------------- ### List One-Click Scenes via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Fetch a list of all configured 'One-Click' or 'Tap-to-Run' scenes. These can control multiple devices simultaneously and are defined in the Govee app. ```bash curl -s "http://localhost:8056/api/oneclicks" | jq ``` -------------------------------- ### Turn On Device via LAN CLI Source: https://context7.com/wez/govee2mqtt/llms.txt Control a Govee device directly over the local network using its IP address. This is useful for debugging and direct control. ```bash ./govee lan-control --ip 192.168.1.100 on ``` -------------------------------- ### Apply scenes via LAN API Source: https://github.com/wez/govee2mqtt/blob/main/addon/CHANGELOG.md Use the CLI to apply a scene to a Govee device over the local network. ```console ./target/debug/govee lan-control --ip 192.168.1.201 scene Breathe Loading environment overrides from "/home/wez/wez-personal/govee-rs/.env" Computed ["o/8BAQIAAAAAAAAAAAAAAAAAAF4=", "MwUECgAAAAAAAAAAAAAAAAAAADg="] ``` -------------------------------- ### Activate Scene via LAN CLI Source: https://context7.com/wez/govee2mqtt/llms.txt Activate a specific scene on a Govee device using its name via the LAN CLI. Scene names should be enclosed in quotes if they contain spaces. ```bash ./govee lan-control --ip 192.168.1.100 scene "Breathe" ``` -------------------------------- ### Configure Govee Account Credentials Source: https://context7.com/wez/govee2mqtt/llms.txt Provide Govee account credentials and API key to enable IoT features, room name discovery, and full scene control. The temperature scale can also be set. ```bash # Required for IoT (real-time updates) and room names export GOVEE_EMAIL=user@example.com export GOVEE_PASSWORD=your-password # Required for Platform API (scene control, device metadata) export GOVEE_API_KEY=your-api-key-uuid # Temperature scale for sensor readings export GOVEE_TEMPERATURE_SCALE=C # or F for Fahrenheit ``` -------------------------------- ### View Docker Logs Source: https://context7.com/wez/govee2mqtt/llms.txt Follow the logs of the govee2mqtt container to monitor its activity and troubleshoot issues. ```bash docker logs govee2mqtt --follow ``` -------------------------------- ### Configure MQTT Broker Connection Source: https://context7.com/wez/govee2mqtt/llms.txt Set environment variables to connect the bridge to your MQTT broker. This enables automatic device discovery and state synchronization with Home Assistant. ```bash # MQTT environment variables export GOVEE_MQTT_HOST=mqtt.local # Broker hostname or IP export GOVEE_MQTT_PORT=1883 # Broker port (default: 1883) export GOVEE_MQTT_USER=mqtt_user # Username (if auth required) export GOVEE_MQTT_PASSWORD=mqtt_password # Password (if auth required) ``` -------------------------------- ### List Scenes via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Retrieve a list of all available scenes for a specific Govee device. This includes static effects, music modes, and custom DIY scenes. ```bash curl -s "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/scenes" | jq ``` -------------------------------- ### Configure LAN Discovery - Broadcast to All Interfaces Source: https://context7.com/wez/govee2mqtt/llms.txt Environment variable to enable broadcasting discovery packets to all available network interfaces on the host machine. ```bash export GOVEE_LAN_BROADCAST_ALL=true ``` -------------------------------- ### Set Color Temperature via LAN CLI Source: https://context7.com/wez/govee2mqtt/llms.txt Set the color temperature of a Govee device using the LAN CLI. Provide the IP address and the temperature in Kelvin. ```bash ./govee lan-control --ip 192.168.1.100 temperature 4000 ``` -------------------------------- ### Set Brightness via LAN CLI Source: https://context7.com/wez/govee2mqtt/llms.txt Adjust the brightness of a Govee device using the LAN CLI. Specify the IP address and the desired brightness percentage. ```bash ./govee lan-control --ip 192.168.1.100 brightness 75 ``` -------------------------------- ### Define docker-compose.yml Source: https://github.com/wez/govee2mqtt/blob/main/docs/DOCKER.md Configure the service using host networking and the previously defined environment file. ```yaml name: govee2mqtt services: govee2mqtt: image: ghcr.io/wez/govee2mqtt:latest container_name: govee2mqtt restart: unless-stopped env_file: - .env # Host networking is required network_mode: host # By default, a Docker volume will be used to persist data. If you prefer to mount this on your host, you can do so as follows: # volumes: # - '/path/to/data:/data' ``` -------------------------------- ### Activate Scene via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Activate a predefined scene on a Govee device by its name. Scene names are case-sensitive and may require URL encoding for special characters. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/scene/Rainbow" ``` -------------------------------- ### Activate Music Scene via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Activate a music mode scene. Note that the scene name, including spaces and colons, must be URL encoded. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/scene/Music%3A%20Energic" ``` -------------------------------- ### List Govee Devices via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Retrieve a JSON array of all discovered Govee devices, including their current state, IP addresses, and room assignments. Requires the govee2mqtt service to be running. ```bash # List all devices with their current state curl -s http://localhost:8056/api/devices | jq # Response example: # [ # { # "sku": "H6159", # "id": "AA:BB:CC:DD:EE:FF:GG:HH", # "name": "Living Room Light Strip", # "room": "Living Room", # "ip": "192.168.1.100", # "state": { # "on": true, # "brightness": 80, # "color": {"r": 255, "g": 200, "b": 100}, # "color_temperature_kelvin": 4000 # } # }, # { # "sku": "H7160", # "id": "11:22:33:44:55:66:77:88", # "name": "Bedroom Humidifier", # "room": "Bedroom", # "ip": null, # "state": { # "on": true, # "humidity": 45 # } # } # ] ``` -------------------------------- ### Set Color via HTTP API (RGB Format) Source: https://context7.com/wez/govee2mqtt/llms.txt Set the light's color using the rgb() notation. The entire color parameter must be URL encoded. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/color/rgb(255,100,50)" ``` -------------------------------- ### Set Color Temperature via HTTP API (Daylight) Source: https://context7.com/wez/govee2mqtt/llms.txt Set the color temperature to mimic daylight conditions. This is useful for task lighting or simulating natural light. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/colortemp/5000" ``` -------------------------------- ### Configure LAN Discovery - Timeout Source: https://context7.com/wez/govee2mqtt/llms.txt Environment variable to set the timeout in seconds for the LAN discovery process. Adjust this value based on network conditions. ```bash export GOVEE_LAN_DISCO_TIMEOUT=5 ``` -------------------------------- ### One-Click (Tap-to-Run) Scenes API Source: https://context7.com/wez/govee2mqtt/llms.txt Manages and activates Tap-to-Run scenes configured in the Govee app. ```APIDOC ## One-Click (Tap-to-Run) Scenes API ### Description This API allows you to list and activate Tap-to-Run scenes. These are automation shortcuts configured in the Govee app that can control multiple devices simultaneously. ### List All One-Click Scenes #### Method GET #### Endpoint /api/oneclicks #### Response Example (List Scenes) ```json [ {"name": "Good Morning", "devices": ["Light Strip", "Bedroom Light"]}, {"name": "Movie Time", "devices": ["Living Room Light", "TV Backlight"]}, {"name": "Good Night", "devices": ["All Lights"]} ] ``` ### Activate One-Click Scene #### Method POST #### Endpoint /api/oneclick/activate/{scene_name} #### Parameters ##### Path Parameters - **scene_name** (string) - Required - The name of the one-click scene to activate. Scene names with spaces or special characters may require URL encoding (e.g., "Movie%20Time"). #### Request Example ```bash curl "http://localhost:8056/api/oneclick/activate/Movie%20Time" ``` #### Response ##### Success Response (200) - **code** (integer) - Indicates success (200). - **msg** (string) - Confirmation message (e.g., "ok"). ##### Error Response (500) - **code** (integer) - Indicates an error (500). - **msg** (string) - Error message (e.g., "AWS IoT client is not available"). ##### Response Example ```json { "code": 200, "msg": "ok" } ``` ``` -------------------------------- ### Configure LAN Discovery - Specific Scan Addresses Source: https://context7.com/wez/govee2mqtt/llms.txt Environment variable to specify a comma-separated list of IP addresses or broadcast addresses for LAN discovery. This overrides default multicast behavior. ```bash export GOVEE_LAN_SCAN="192.168.1.100,192.168.1.101,10.0.0.255" ``` -------------------------------- ### Control Govee Light Brightness via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Set the brightness level for compatible Govee light devices. Accepts a percentage value between 0 and 100. Ensure the device ID is correct. ```bash # Set brightness to 50% curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/brightness/50" # Response: {"code": 200, "msg": "ok"} # Set brightness to maximum curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/brightness/100" # Response: {"code": 200, "msg": "ok"} ``` -------------------------------- ### Set Color via LAN CLI (Named Color) Source: https://context7.com/wez/govee2mqtt/llms.txt Set the color of a Govee device using a named color string via the LAN CLI. The CLI will resolve the color name. ```bash ./govee lan-control --ip 192.168.1.100 color red ``` -------------------------------- ### Scene Control API Source: https://context7.com/wez/govee2mqtt/llms.txt Allows listing and activating scenes for a device. ```APIDOC ## Scene Control API ### Description This API allows you to list available scenes for a device and activate them by name. Scenes can include various effects like "Rainbow", "Breathe", music modes, and custom DIY scenes. ### List Available Scenes #### Method GET #### Endpoint /api/device/{device}/scenes #### Parameters ##### Path Parameters - **device** (string) - Required - The unique identifier for the Govee device (e.g., AA:BB:CC:DD:EE:FF:GG:HH). #### Response Example (List Scenes) ```json [ "Rainbow", "Breathe", "Aurora", "Candle", "Music: Energic", "Music: Rhythm", "DIY: My Custom Scene" ] ``` ### Activate Scene #### Method POST #### Endpoint /api/device/{device}/scene/{scene_name} #### Parameters ##### Path Parameters - **device** (string) - Required - The unique identifier for the Govee device (e.g., AA:BB:CC:DD:EE:FF:GG:HH). - **scene_name** (string) - Required - The name of the scene to activate. Scene names with special characters (like ':') may require URL encoding (e.g., "Music%3A%20Energic"). #### Request Example ```bash # Activate a scene by name curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/scene/Rainbow" # Activate a music mode (URL encoded) curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/scene/Music%3A%20Energic" ``` #### Response ##### Success Response (200) - **code** (integer) - Indicates success (200). - **msg** (string) - Confirmation message (e.g., "ok"). ##### Response Example ```json { "code": 200, "msg": "ok" } ``` ``` -------------------------------- ### Configure LAN Scan for VLANs Source: https://context7.com/wez/govee2mqtt/llms.txt For networks using VLANs, specify device IPs or subnet broadcasts in the GOVEE_LAN_SCAN environment variable to ensure proper device discovery. ```bash export GOVEE_LAN_SCAN="192.168.10.255,192.168.20.255" ``` -------------------------------- ### Define Import Map for Govee Controller Source: https://github.com/wez/govee2mqtt/blob/main/assets/index.html Configures the import map for Lit and its associated packages via unpkg. ```json { "imports": { "lit": "https://unpkg.com/lit@3.1.0", "lit/": "https://unpkg.com/lit@3.1.0/", "lit-element": "https://unpkg.com/lit-element@4.0.2", "lit-element/": "https://unpkg.com/lit-element@4.0.2/", "lit-html": "https://unpkg.com/lit-html@3.1.0", "lit-html/": "https://unpkg.com/lit-html@3.1.0/", "@lit/task": "https://unpkg.com/@lit/task@1.0.0", "@lit/reactive-element": "https://unpkg.com/@lit/reactive-element@2.0.2" } } ``` -------------------------------- ### Set Color via HTTP API (Named Color) Source: https://context7.com/wez/govee2mqtt/llms.txt Set the light's color using standard CSS named colors. The API will resolve the color name to its corresponding RGB value. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/color/coral" ``` -------------------------------- ### Set Color via LAN CLI (Hex Value) Source: https://context7.com/wez/govee2mqtt/llms.txt Set the color of a Govee device using a hex color code via the LAN CLI. Ensure the hex value is properly quoted. ```bash ./govee lan-control --ip 192.168.1.100 color "#ff5500" ``` -------------------------------- ### Configure LAN Discovery - Disable Multicast Source: https://context7.com/wez/govee2mqtt/llms.txt Environment variable to disable the default UDP multicast for LAN discovery. Set to 'false' to use alternative discovery methods. ```bash export GOVEE_LAN_NO_MULTICAST=false ``` -------------------------------- ### Configure Logging Levels Source: https://context7.com/wez/govee2mqtt/llms.txt Set the RUST_LOG environment variable to control the verbosity of logs for troubleshooting. RUST_LOG_STYLE=always enables colored output. ```bash # Set logging level via environment variable export RUST_LOG=govee=trace # Maximum verbosity export RUST_LOG=govee=debug # Debug information export RUST_LOG=govee=info # Normal operation (default) export RUST_LOG=govee=warn # Warnings only export RUST_LOG_STYLE=always # Enable colored output ``` -------------------------------- ### Configure LAN Discovery - Global Broadcast Source: https://context7.com/wez/govee2mqtt/llms.txt Environment variable to enable broadcasting discovery packets to the global broadcast address (255.255.255.255). ```bash export GOVEE_LAN_BROADCAST_GLOBAL=true ``` -------------------------------- ### Activate One-Click Scene via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Trigger a 'One-Click' scene by its name. The scene name needs to be URL encoded if it contains spaces or special characters. ```bash curl "http://localhost:8056/api/oneclick/activate/Movie%20Time" ``` -------------------------------- ### Set Brightness via HTTP API Source: https://context7.com/wez/govee2mqtt/llms.txt Use this endpoint to set the brightness of a Govee device. The brightness value ranges from 1 (dimmest) to 100 (brightest). ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/brightness/1" ``` -------------------------------- ### Set Color Temperature via HTTP API (Cool White) Source: https://context7.com/wez/govee2mqtt/llms.txt Set the color temperature to a cooler white, often used for focus or productivity. Values can go up to 9000K. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/colortemp/6500" ``` -------------------------------- ### Set Color Temperature via HTTP API (Warm White) Source: https://context7.com/wez/govee2mqtt/llms.txt Adjust the color temperature to a warmer white, suitable for relaxing environments. Values typically range from 2000K to 9000K. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/colortemp/2700" ``` -------------------------------- ### LAN API CLI - Device Control Source: https://context7.com/wez/govee2mqtt/llms.txt Provides direct LAN API control for debugging and testing device communication. ```APIDOC ## LAN API CLI - Device Control ### Description The command-line interface (CLI) offers direct LAN API control for debugging and testing device communication without relying on the full service. ### Usage ```bash ./govee lan-control --ip [command] [arguments] ``` ### Commands #### Power Control - **on**: Turns the device on. - **off**: Turns the device off. #### Brightness - **brightness [level]**: Sets the brightness level (0-100). #### Color Temperature - **temperature [kelvin]**: Sets the color temperature in Kelvin. #### Color - **color [color_name|hex_value]**: Sets the color using a named color (e.g., 'red') or a hex value (e.g., '#ff5500'). #### Scene Control - **scene --list**: Lists available scenes for the device. - **scene [scene_name]**: Activates a scene by its name. #### Raw Command - **command [byte1] [byte2] ...**: Sends a raw BLE-encoded command. ### Examples ```bash # Turn on a device via direct IP ./govee lan-control --ip 192.168.1.100 on # Turn off a device ./govee lan-control --ip 192.168.1.100 off # Set brightness to 75% ./govee lan-control --ip 192.168.1.100 brightness 75 # Set color temperature to 4000K ./govee lan-control --ip 192.168.1.100 temperature 4000 # Set color to red ./govee lan-control --ip 192.168.1.100 color red # Set color using hex ./govee lan-control --ip 192.168.1.100 color "#ff5500" # List available scenes for the device ./govee lan-control --ip 192.168.1.100 scene --list # Activate a scene ./govee lan-control --ip 192.168.1.100 scene "Breathe" # Send raw BLE-encoded command (power off: 0x33 1 0) ./govee lan-control --ip 192.168.1.100 command 0x33 1 0 ``` ### Output Example (List Scenes) ``` Aurora Breathe Candle Rainbow ... ``` ### Output Example (Activate Scene) ``` Computed ["o/8BAQIAAAAAAAAAAAAAAAAAAF4=", "MwUECgAAAAAAAAAAAAAAAAAAADg="] ``` ``` -------------------------------- ### Send Raw Command via LAN CLI Source: https://context7.com/wez/govee2mqtt/llms.txt Send a raw BLE-encoded command to a Govee device using the LAN CLI. This is for advanced users and requires knowledge of the command structure. ```bash ./govee lan-control --ip 192.168.1.100 command 0x33 1 0 ``` -------------------------------- ### Set Color via HTTP API (Hex) Source: https://context7.com/wez/govee2mqtt/llms.txt Control the RGB color of a light using a hex value. Ensure the hex value is URL encoded if necessary. ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/color/%23ff5500" ``` -------------------------------- ### Color Temperature Control API Source: https://context7.com/wez/govee2mqtt/llms.txt Sets the color temperature of a light in Kelvin. ```APIDOC ## POST /api/device/{device}/colortemp/{kelvin} ### Description Sets the color temperature of a light in Kelvin. Typical ranges are from 2000K (warm) to 9000K (cool). ### Method POST ### Endpoint /api/device/{device}/colortemp/{kelvin} ### Parameters #### Path Parameters - **device** (string) - Required - The unique identifier for the Govee device (e.g., AA:BB:CC:DD:EE:FF:GG:HH). - **kelvin** (integer) - Required - The desired color temperature in Kelvin (e.g., 2700, 5000, 6500). ### Request Example ```bash # Set warm white (2700K) curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/colortemp/2700" # Set daylight white (5000K) curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/colortemp/5000" # Set cool white (6500K) curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/colortemp/6500" ``` ### Response #### Success Response (200) - **code** (integer) - Indicates success (200). - **msg** (string) - Confirmation message (e.g., "ok"). #### Response Example ```json { "code": 200, "msg": "ok" } ``` ``` -------------------------------- ### Color Control API Source: https://context7.com/wez/govee2mqtt/llms.txt Allows setting the RGB color of a light using various CSS color syntaxes. ```APIDOC ## POST /api/device/{device}/color/{color} ### Description Sets the RGB color of a light using CSS color syntax, including named colors, hex values, and rgb() notation. ### Method POST ### Endpoint /api/device/{device}/color/{color} ### Parameters #### Path Parameters - **device** (string) - Required - The unique identifier for the Govee device (e.g., AA:BB:CC:DD:EE:FF:GG:HH). - **color** (string) - Required - The desired color. Can be a hex value (e.g., %23ff5500), a named color (e.g., coral), or an rgb() format (e.g., rgb(255,100,50)). Note that rgb() and special characters may need URL encoding. ### Request Example ```bash # Set color using hex value curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/color/%23ff5500" # Set color using named color curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/color/coral" # Set color using rgb() format (URL encoded) curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/color/rgb(255,100,50)" ``` ### Response #### Success Response (200) - **code** (integer) - Indicates success (200). - **msg** (string) - Confirmation message (e.g., "ok"). #### Error Response (400) - **code** (integer) - Indicates an error (400). - **msg** (string) - Error message detailing the parsing issue (e.g., "error parsing color 'invalid': ..."). #### Response Example ```json { "code": 200, "msg": "ok" } ``` ``` -------------------------------- ### Turn Off Device via LAN CLI Source: https://context7.com/wez/govee2mqtt/llms.txt Send a command to turn off a Govee device using its IP address via the LAN control CLI. ```bash ./govee lan-control --ip 192.168.1.100 off ``` -------------------------------- ### Set Brightness Source: https://context7.com/wez/govee2mqtt/llms.txt Adjusts the brightness of a Govee device. The brightness value ranges from 1 (minimum) to 100 (maximum). ```APIDOC ## POST /api/device/{device}/brightness/{brightness} ### Description Sets the brightness level for a specific Govee device. ### Method POST ### Endpoint /api/device/{device}/brightness/{brightness} ### Parameters #### Path Parameters - **device** (string) - Required - The unique identifier for the Govee device (e.g., AA:BB:CC:DD:EE:FF:GG:HH). - **brightness** (integer) - Required - The desired brightness level, from 1 (dimmest) to 100 (brightest). ### Request Example ```bash curl "http://localhost:8056/api/device/AA:BB:CC:DD:EE:FF:GG:HH/brightness/1" ``` ### Response #### Success Response (200) - **code** (integer) - Indicates success (200). - **msg** (string) - Confirmation message (e.g., "ok"). #### Response Example ```json { "code": 200, "msg": "ok" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.