Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate color functionality for H6059 #15

Open
nerdknob opened this issue Sep 19, 2022 · 0 comments
Open

Investigate color functionality for H6059 #15

nerdknob opened this issue Sep 19, 2022 · 0 comments

Comments

@nerdknob
Copy link

nerdknob commented Sep 19, 2022

I am attempting to use this device handler for the Govee H6059 Night Light device which is not listed in the supported devices list.
Based on my investigation, the api calls are the same for H6059 as what is defined in the device handler api calls. But Smartthings briefly shows the color controls when opening the device in the app but then shows a crossed out cloud icon for the color picker options.

I am brand new to device handlers so I'm fumbling my way through the code to understand the SmartThings app side but the API calls that are defined in the handler appear to be correct for H6059 as well. (minus the "colorTem" Cmd but the base color Cmd should work just fine)

Here are the details/capabilities of the device:
Method: GET
URI: https://developer-api.govee.com/v1/devices
Headers: Govee-API-Key: (API Key), Content-Type: application/json
Response:

{
    "data": {
        "devices": [
            {
                "device": "XX:XX:XX:XX:XX:XX:XX:XX",
                "model": "H6059",
                "deviceName": "Night light",
                "controllable": true,
                "retrievable": true,
                "supportCmds": [
                    "turn",
                    "brightness",
                    "color",
                    "colorTem"
                ],
                "properties": {
                    "colorTem": {
                        "range": {
                            "min": 2200,
                            "max": 6500
                        }
                    }
                }
            }
        ]
    },
    "message": "Success",
    "code": 200
}

Here's a device status poll result:
Method: GET
URI: https://developer-api.govee.com/v1/devices/state
Headers: Govee-API-Key: (API Key), Content-Type: application/json
Params: device: XX:XX:XX:XX:XX:XX:XX:XX, model H6059
Response:

{
    "data": {
        "device": "XX:XX:XX:XX:XX:XX:XX:XX",
        "model": "H6059",
        "properties": [
            {
                "online": true
            },
            {
                "powerState": "on"
            },
            {
                "brightness": 50
            },
            {
                "color": {
                    "r": 163,
                    "b": 255,
                    "g": 51
                }
            }
        ]
    },
    "message": "Success",
    "code": 200
}

And here is setting a color:
Method: PUT
URI: https://developer-api.govee.com/v1/devices/control
Headers: Govee-API-Key: (API Key), Content-Type: application/json
Body:

{
    "device": "XX:XX:XX:XX:XX:XX:XX:XX", 
    "model": "H6059",
    "cmd": {
        "name": "color",
        "value": { 
            "r": 0, 
            "g": 255, 
            "b": 255
        } 
    }
}

Response:

{
    "code": 200,
    "message": "Success",
    "data": {}
}

The power and brightness controls work just fine. I'm continuing to investigate the color picker issue but wanted to share my findings so far since I'm learning smartthings' groovy code as I go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant