# API command not working for StartDecreasingBrightns

**URL:** <https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646>\
**Category:** Fans\
**Created:** [August 5, 2021, 7:12pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646 "2021-08-05T19:12:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jpfamily](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jpfamily](https://forum.bondhome.io/u/Jpfamily)\
**Post date:** [August 5, 2021, 7:12pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/1 "2021-08-05T19:12:23Z")

</div>

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”}}

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [August 9, 2021, 7:20pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/2 "2021-08-09T19:20:58Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![Jpfamily](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jpfamily](https://forum.bondhome.io/u/Jpfamily)\
**Post date:** [August 9, 2021, 7:33pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/3 "2021-08-09T19:33:20Z")

</div>

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”}

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [August 10, 2021, 12:32pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/4 "2021-08-10T12:32:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jpfamily](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jpfamily](https://forum.bondhome.io/u/Jpfamily)\
**Post date:** [August 10, 2021, 3:00pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/5 "2021-08-10T15:00:31Z")

</div>

I was following the syntax of the documentation found at: [Bond Local API (appbond.com)](http://docs-local.appbond.com/#section/Getting-Started/Get-Device-Information)

My command was:  
curl -H “BOND-Token: 5d8eXXXXXXXXc570” -i [http://192.168.1.47/v2/devices/3cf71c81/actions/StartDecreasingBrightness](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](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.

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [August 10, 2021, 4:59pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/6 "2021-08-10T16:59:26Z")

</div>

Try removing the argument.

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

---

<div class="post-metadata">

**Author:** ![Jpfamily](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jpfamily](https://forum.bondhome.io/u/Jpfamily)\
**Post date:** [August 10, 2021, 5:45pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/7 "2021-08-10T17:45:51Z")

</div>

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

Thank you for your patience.

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [August 10, 2021, 7:22pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/8 "2021-08-10T19:22:35Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![Evengers](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@Evengers](https://forum.bondhome.io/u/Evengers)\
**Post date:** [August 1, 2022, 1:45pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/9 "2022-08-01T13:45:53Z")

</div>

This syntax worked for me to control my somfy awning. The api documentation is good but a little unclear

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [August 8, 2022, 9:28pm UTC](https://forum.bondhome.io/t/api-command-not-working-for-startdecreasingbrightns/2646/10 "2022-08-08T21:28:46Z")

</div>

> [@Evengers](#):
>
> The api documentation is good but a little unclear

Glad it was helpful. If there’s something specific you’d like to re-word I invite you to open a PR 😉 [GitHub - bondhome/api-v2: Bond V2 API Documentation](https://github.com/bondhome/api-v2)
