Query Device's State

Query the current status of the device through device and sku.

  • request example
POST /router/api/v1/device/state HTTP/1.1
Host: https://openapi.api.govee.com
Content-Type: application/json
Govee-API-Key: xxxx

{
    "requestId": "uuid",
    "payload": {
        "sku": "H7143",
        "device": "52:8B:D4:AD:FC:45:5D:FE"
    }
}
  • response success example
{
    "requestId": "uuid",
    "msg": "success",
    "code": 200,
    "payload": {
        "sku": "H7143",
        "device": "52:8B:D4:AD:FC:45:5D:FE",
        "capabilities": [
            {
                "type": "devices.capabilities.online",
                "instance": "online",
                "state": {
                    "value": false
                }
            },
            {
                "type": "devices.capabilities.on_off",
                "instance": "powerSwitch",
                "state": {
                    "value": 0
                }
            },
            {
                "type": "devices.capabilities.toggle",
                "instance": "warmMistToggle",
                "state": {
                    "value": 0
                }
            },
            {
                "type": "devices.capabilities.work_mode",
                "instance": "workMode",
                "state": {
                    "value": {
                        "workMode": 3,
                        "modeValue": 9
                    }
                }
            },
            {
                "type": "devices.capabilities.range",
                "instance": "humidity",
                "state": {
                    "value": ""
                }
            },
            {
                "type": "devices.capabilities.toggle",
                "instance": "nightlightToggle",
                "state": {
                    "value": 1
                }
            },
            {
                "type": "devices.capabilities.range",
                "instance": "brightness",
                "state": {
                    "value": 5
                }
            },
            {
                "type": "devices.capabilities.color_setting",
                "instance": "colorRgb",
                "state": {
                    "value": 16777215
                }
            },
            {
                "type": "devices.capabilities.mode",
                "instance": "nightlightScene",
                "state": {
                    "value": 5
                }
            }
        ]
    }
}
  • response field
fielddata type
skuStringProduct model
deviceStringdevice id
deviceNameStringThe device name in Govee Home App.
capabilitiesArraydevice capabilities array

Capabilities Array

fielddata type
typeStringcapbility type
instanceStringcapability instance
stateObjectthe struct definition of current state in this instance

State Define Object

  1. enum control value
fielddata typedesc
valueObjectThe type of value depends on the dataType returned by Get You Device.

In capabilities, if type is 'devices.capabilities.online', it indicates whether the device is wifi online. If it is false, the status data queried is historical data and has no reference significance. If state is true, it means the device is online, and the returned value is the value of the current device status. These values ​​correspond to the list returned by Get You Device. If the value value is empty, it means that the instance does not support query.

In capabilities, if the type is 'devices.capabilities.event', this is a property of real-time monitoring. It will only be reported when the event occurs on the device and cannot be obtained through query. If you want to obtain the status in real time, please refer to 'Subscribe Device Event' interface

  • Friendly Reminder
    if the request response 429, means request limits happens, 10000/Account/Day