Help with format for Dimmer and API

This body is used to send a command directly to the API, right? The property integer is not needed in this case:

{"commands": [{"component":"main","capability": "switchLevel","command": "setLevel","arguments": [20]}]}

For future reference, it is only required in the commands of a Rule. For example:

{
    "command": {
        "devices": [
            "deviceID"
        ],
        "commands": [
            {
                "component": "main",
                "capability": "switchLevel",
                "command": "setLevel",
                "arguments": [{
                    "integer": 20
                }]
            }
        ]
    }
}
2 Likes