Trying to use Node Red to control Bond Bridge?

I have the version query working via the REST API, I can get the list of devices, and the actions per device. But when I try to use/invoke any of the toggle actions, I get 200 no content or 400 bad request?

So trying to use curl to test the toggle actions as well, but getting the same error code…

curl -H "BOND-Token: X" -i http://192.168.1.10/v2/devices/67ea44a0/actions/ToggleLight
HTTP/1.1 204 No Content
Connection: close
BOND-Flags: 4
Content-Length: 0

I know the token is correct, since I can get the actions list for example, but don’t understand why the toggle actions are not working…

curl -H "BOND-Token: X" -i http://192.168.1.10/v2/devices/67ea44a0/actions/SetSpeed -X PUT -d "{\"argument\": 3}"

I can get the SetSpeed action working, per the example in the API documentation, so what is it about the toggle actions that I am missing?

Have you tried empty data payload for the toggles?

“{}”

Yes, I was… but also I was not… given NodeRed (i.e. NR core is JavaScript) I happen to be passing the payload as the wrong ‘type’ it turned out I was passing an invalid JSON string, that looked right but actually was not correct. I happened to catch the error as I was testing other REST API PUT commands for setting the fan speed, i.e. SetSpeed, and that worked… was passing a correctly formatted and type JSON string.

1 Like

So all good now? Confirming for posterity :grinning_face_with_smiling_eyes: