Controlling Switch Level in Postman

Greetings,
I am relatively new to the SmartThings API. I have been writing my http requests in POSTMAN. And I have created a simulated dimmer switch on my smartThings account.
I am able to turn it on and off by using the http body below:


{
"commands": [
    {
        "component": "main",
        "capability": "switch",
        "command": "off"
    }
]
}

But I cannot control dimmer on this switch with the code below:


{
"commands": [
    {
        "component": "main",
        "capability": "switchLevel",
        "command": "50"
    }
]
}

I get NotValidValue Error and HTTP Status Code of 422.

Try replacing "command": "50" with

"command": "setLevel"
"arguments": [ 50 ]
2 Likes

You’re a life saver!
Worked like a charm.
Thanks. :relaxed: