{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "title": "Govee",
    "description": "Integrate Govee smart light devices into your applications with the Govee Developer API. Control lights, change colors, adjust brightness, and set timers. Access real-time device status for advanced application development.",
    "contact": {
      "name": "Richard Wilson",
      "email": "richard.a.wilson@microsoft.com",
      "url": "https://www.richardawilson.com/"
    }
  },
  "host": "developer-api.govee.com",
  "basePath": "/v1",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/devices/control": {
      "put": {
        "summary": "Run Command on Device",
        "description": "Execute a specific command on a Govee device. This endpoint allows you to control various aspects of the device such as power state, brightness, color, and color temperature. Provide the device's MAC address and model along with the command details. Supported commands include 'turn' for power control, 'brightness' for adjusting brightness levels, 'color' for setting RGB color values, and 'colorTem' for adjusting color temperature.",
        "operationId": "RunCommandOnDevice",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "device": {
                  "type": "string",
                  "title": "Device MAC Address",
                  "x-ms-summary": "Device MAC Address",
                  "description": "The unique MAC address of the Govee device. This identifier is used to specify which device you want to control.",
                  "x-ms-visibility": "important"
                },
                "model": {
                  "type": "string",
                  "title": "Device Model",
                  "x-ms-summary": "Device Model",
                  "description": "The model number of your Govee device. This information helps in identifying the specific features and capabilities available for the device.",
                  "x-ms-visibility": "important"
                },
                "cmd": {
                  "type": "object",
                  "description": "Command details",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "The command to be executed on the device. This object includes the command name (e.g., 'turn', 'brightness', 'color', 'colorTem') and its associated value. The command name dictates the type of action to be performed on the device.",
                      "title": "Command Name",
                      "x-ms-summary": "Command Name",
                      "enum": [
                        "turn",
                        "brightness",
                        "color",
                        "colorTem"
                      ]
                    }
                  },
                  "required": [
                    "name"
                  ]
                },
                "turn": {
                  "title": "Turn",
                  "x-ms-summary": "Turn",
                  "description": "This parameter is used to turn the device on or off. Use this only when the 'turn' command is selected. Valid values are 'on' or 'off'.",
                  "type": "string",
                  "enum": [
                    "on",
                    "off"
                  ],
                  "x-ms-visibility": "important"
                },
                "brightness": {
                  "title": "Brightness",
                  "x-ms-summary": "Brightness",
                  "description": "The brightness level to set for the device. Use this parameter only when the 'brightness' command is selected. Enter a value between 0 (minimum brightness) and 100 (maximum brightness).",
                  "type": "integer",
                  "x-ms-visibility": "important"
                },
                "color": {
                  "type": "object",
                  "description": "The RGB color value to set for the device. Use this parameter only when the 'color' command is selected. Specify the red, green, and blue components of the color.",
                  "properties": {
                    "r": {
                      "title": "Color - Red",
                      "x-ms-summary": "Color - Red",
                      "description": "This parameter represents the red component of the RGB color value for the device. It is a part of the 'color' command. Specify an integer value ranging from 0 to 255, where 0 means no red and 255 represents the maximum intensity of red.",
                      "type": "integer",
                      "x-ms-visibility": "important"
                    },
                    "g": {
                      "title": "Color - Green",
                      "x-ms-summary": "Color - Green",
                      "description": "This parameter defines the green component of the RGB color value for the device. It is used in conjunction with the 'color' command. Provide an integer value between 0 and 255, with 0 indicating no green and 255 signifying the highest intensity of green.",
                      "type": "integer",
                      "x-ms-visibility": "important"
                    },
                    "b": {
                      "title": "Color - Blue",
                      "x-ms-summary": "Color - Blue",
                      "description": "The blue component of the RGB color value to set on the device. This parameter is part of the 'color' command. The value should be an integer ranging from 0 to 255, where 0 is the absence of blue and 255 denotes the brightest blue.",
                      "type": "integer",
                      "x-ms-visibility": "important"
                    }
                  }
                },
                "colorTem": {
                  "title": "Color Temperature",
                  "x-ms-summary": "Color Temperature",
                  "description": "The color temperature value to set for the device. Use this parameter only when the 'colorTem' command is selected. Enter the color temperature value as required by your device.",
                  "type": "integer",
                  "x-ms-visibility": "important"
                }
              },
              "required": [
                "model",
                "device",
                "cmd"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "description": "The HTTP status code of the response",
                  "x-ms-summary": "Status Code"
                },
                "message": {
                  "type": "string",
                  "description": "A message describing the result of the operation",
                  "x-ms-summary": "Message"
                },
                "data": {
                  "type": "object",
                  "description": "The data returned with the response."
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/devices": {
      "get": {
        "summary": "Get Device Information",
        "description": "Access detailed information about your Govee devices. This endpoint retrieves data for a specific device when provided with its MAC address and model. If no specific device is specified, the endpoint returns information for all devices associated with your account. The response includes device details such as the device name, controllability, retrievability, supported commands, and additional properties. This is useful for understanding the capabilities and current configuration of your Govee devices.\n",
        "operationId": "GetDeviceInformation",
        "parameters": [
          {
            "name": "device",
            "in": "query",
            "required": false,
            "type": "string",
            "description": "An optional parameter representing the MAC address of the Govee device for which information is being requested. If provided, the API will return details specifically for this device. Leave this parameter empty to retrieve information for all devices associated with the account.",
            "x-ms-summary": "Device MAC Address"
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "type": "string",
            "description": "An optional parameter indicating the model of the Govee device. If specified, the API will return information for devices matching this model. This parameter can be used in conjunction with the Device MAC Address.",
            "x-ms-summary": "Device Model"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "type": "object",
              "description": "The response body contains information about the requested device(s).",
              "properties": {
                "data": {
                  "type": "object",
                  "description": "The data returned with the response. This includes information about the requested device(s).",
                  "properties": {
                    "devices": {
                      "type": "array",
                      "x-ms-summary": "Devices",
                      "description": "A list of devices associated with the account. If a specific device is requested, the list will only contain one device.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "device": {
                            "type": "string",
                            "description": "The unique MAC address of the device",
                            "x-ms-summary": "Device MAC Address"
                          },
                          "model": {
                            "type": "string",
                            "description": "The model number of the device",
                            "x-ms-summary": "Device Model"
                          },
                          "deviceName": {
                            "type": "string",
                            "description": "The name of the device",
                            "x-ms-summary": "Device Name"
                          },
                          "controllable": {
                            "type": "boolean",
                            "description": "Indicates if the device is controllable",
                            "x-ms-summary": "Controllable"
                          },
                          "properties": {
                            "type": "object",
                            "properties": {
                              "colorTem": {
                                "type": "object",
                                "properties": {
                                  "range": {
                                    "type": "object",
                                    "x-ms-summary": "Range",
                                    "description": "The range of color temperature values supported by the device",
                                    "properties": {
                                      "min": {
                                        "type": "integer",
                                        "x-ms-summary": "Minimum",
                                        "description": "Minimum color temperature value"
                                      },
                                      "max": {
                                        "type": "integer",
                                        "x-ms-summary": "Maximum",
                                        "description": "Maximum color temperature value"
                                      }
                                    }
                                  }
                                },
                                "description": "Color temperature properties of the device",
                                "x-ms-summary": "Color Temperature"
                              }
                            },
                            "description": "Additional properties of the device",
                            "x-ms-summary": "Properties"
                          },
                          "retrievable": {
                            "type": "boolean",
                            "description": "Indicates if the device is retrievable",
                            "x-ms-summary": "Retrievable"
                          },
                          "supportCmds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Supported commands for the device",
                            "x-ms-summary": "Supported Commands"
                          }
                        }
                      }
                    }
                  }
                },
                "message": {
                  "type": "string",
                  "description": "A message describing the result of the operation",
                  "x-ms-summary": "Message"
                },
                "code": {
                  "type": "integer",
                  "description": "The HTTP status code of the response",
                  "x-ms-summary": "Status Code"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    }
  },
  "definitions": {},
  "parameters": {},
  "responses": {},
  "securityDefinitions": {
    "API Key": {
      "type": "apiKey",
      "in": "header",
      "name": "Govee-API-Key"
    }
  },
  "security": [
    {
      "API Key": []
    }
  ],
  "tags": [],
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://us.govee.com/"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://us.govee.com/policies/privacy-policy"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "Internet of Things"
    }
  ]
}