API command not working for StartDecreasingBrightns

Using remote with FCC ID:. CHQ7225T, and using the StartDecreasingBrightness command, I receive a HTTP of 400 Bad request.

HTTP/1.1 400 Bad Request
Content-Length: 54
Content-Type: application/json; charset=utf-8

StartDecreasingBrightness is a valid command, as noted by the response:

HTTP/1.1 200 OK
Content-Length: 528
Content-Type: application/json; charset=utf-8

{"":“d96da0d0”,“OEMRandom”:{"":“c33ce16c”},“TurnOff”:{"":“2ab10e78”},“SetSpeed”:{"":“f7dc2578”},“SetDirection”:{"":“80b91073”},“OEMTimer”:{"":“3a3f43e6”},“StartDecreasingBrightness”:{"":“860147be”},“StartIncreasingBrightness”:{"":“0dc5e82f”},“ToggleLight”:{"":“3c0b2188”},“Stop”:{"":“aac378bd”},“TogglePower”:{"":“e7bdb8c8”},“TurnOn”:{"":“1af79a43”},“IncreaseSpeed”:{"":“a66973cb”},“DecreaseSpeed”:{"":“795be9e6”},“ToggleDirection”:{"":“bbc186d7”},“TurnLightOn”:{"":“80d1778d”},“TurnLightOff”:{"_":“d7ce86c5”}}

Please check the body of the 400 reply, it should contain an error code plus a human-readable error message that expands on the “Bad Request”.

It states that an action that is retrieved using the actions query is not supported.

here is the available actions:

{"":“d96da0d0”,“OEMRandom”:{"":“c33ce16c”},“TurnOff”:{"":“2ab10e78”},“SetSpeed”:{"":“f7dc2578”},“SetDirection”:{"":“80b91073”},“OEMTimer”:{"":“3a3f43e6”},“StartDecreasingBrightness”:{"":“860147be”},“StartIncreasingBrightness”:{"":“0dc5e82f”},“ToggleLight”:{"":“3c0b2188”},“Stop”:{"":“aac378bd”},“TogglePower”:{"":“e7bdb8c8”},“TurnOn”:{"":“1af79a43”},“IncreaseSpeed”:{"":“a66973cb”},“DecreaseSpeed”:{"":“795be9e6”},“ToggleDirection”:{"":“bbc186d7”},“TurnLightOn”:{"":“80d1778d”},“TurnLightOff”:{"_":“d7ce86c5”}}

but when sending the command “StartDecreasingBrightness”, I recieve the error:

HTTP/1.1 400 Bad Request
Content-Length: 54
Content-Type: application/json; charset=utf-8

{"_error_id":61,"_error_msg":“action not supported”}

I assume you’re doing this:

PUT devices/{}/actions/StartIncreasingBrightness {}

You could instead try:

PUT devices/{}/commands/{cmd_id}/tx {}

Where cmd_id is the ID of the command that has action: StartIncreasingBrightness.

I was following the syntax of the documentation found at: Bond Local API (appbond.com)

My command was:
curl -H “BOND-Token: 5d8eXXXXXXXXc570” -i http://192.168.1.47/v2/devices/3cf71c81/actions/StartDecreasingBrightness -X PUT -d “{“argument”: 3}”

here is what I am trying after reading your suggestion:
curl -H “BOND-Token: 5d8eXXXXXX4dc570” -i http://192.168.1.47/v2/devices/3cf71c81/commands/1bb3664a/tx -X PUT -d “{“argument”: 3}”

this gives a message:
HTTP/1.1 405 Method Not Allowed
Content-Length: 52
Content-Type: application/json; charset=utf-8

{"_error_id":56,"_error_msg":“method not allowed”}

If I intentionally change the numeric value for the command to something random, the message changes to:

HTTP/1.1 404 Not Found
Content-Length: 0

this tells me that the syntax may be correct, but the actual value has no matching command, hence the 404 error.

For clarification, my understanding is that if I use the commands option, that I can get the numeric values. If the commands and the actions follow the same order relationship, I should be able to correlate the numeric value for the action value.

Try removing the argument.

curl -H "BOND-Token: 5d8eXXXXXXXXc570" -i http://192.168.1.47/v2/devices/3cf71c81/actions/StartDecreasingBrightness -X PUT -d "{}"

1 Like

SUCCESS! I tested your syntax from above, and got the expected result!

Thank you for your patience.

2 Likes

Ok. — Our error message there is wrong. It should say “action does not accept an argument” or something like that rather than “action not supported”