Well, you can’t use state and action yet, per the intro to the documentation.
BOND API is currently in BETA. This means that:
• the API may change without provisions for backwards compatibility
• some features of the API may not be implemented
Specifically, two major aspects of BOND API are not yet implemented:
• Actions are not implemented
• State feedback is not implemented
For now, it is only possible to control devices by explicitly calling the commands/{}/tx
endpoint for the command corresponding to the desired action.
So for now, you can only traverse the device / data tree and find the tx nodes to call.
If that answers your question, cool. If you’re having trouble finding the nodes you want … here is my paraphrasing / understanding of the nested traversing.
Any nodes which are enclosed by { } indicate to me there is another level to drop down and traverse, so I can append the root string (“commands” in this case) to the end of the path in the curl command.
Say I have a device 00000003 on my BOND. This gives me the list of commands, which I can then traverse each one further to get name, action, argument, icon, a signal array (which can then also be traversed down into to reveal freq, bps, reps, modulation, encoding, and data), and a tx array.
curl -i -H “BOND-Token: xxxxxxxxxxxxxxxx” http://BDxxxx.local/v2/devices/00000003/commands/
{““:“419cb133”,“00000006”:{””:“a35a2f41”},“00000008”:{““:“cd3ba350”},“0000000a”:{””:“309bc75c”},“0000000c”:{““:“ccf34831”},“0000000e”:{””:“a8e5e931”},“00000010”:{“_”:“4b3a0268”}}
Each node which has a { } around it, is a node you can traverse down into.
So for the example above, I can look at command 00000006 like so:
curl -i -H “BOND-Token: xxxxxxxxxxxxxxxx” http://BDxxxx.local/v2/devices/00000003/commands/00000006
{“name”:“Light”,“action”:“ToggleLight”,“argument”:“”,“icon”:“button_light”,““:“a35a2f41”,“signal”:{””:“0bc6687e”},“tx”:{“_”:“a054caa1”}}
This shows me command 00000006 is for toggling the light. I now have enough information to call the tx command for toggling the light.
curl -i -H “BOND-Token: xxxxxxxxxxxxxxxx” http://BDxxxx.local/v2/devices/00000003/commands/00000006/tx -X PUT -d {}
Just for grins, if I was randomly curious and wanted to look at the signal node’s array to see what BOND was actually sending when I PUT to the tx node, I could call one more level down:
curl -i -H “BOND-Token: xxxxxxxxxxxxxxxx” http://BDxxxx.local/v2/devices/00000003/commands/00000006/signal/
{“freq”:433930,“bps”:2494,“reps”:12,“modulation”:“OOK”,“encoding”:“cq”,“data”:“1001011001011011011011001011001001011011011001011001001011001011001011001000000000000000000000000000000000”,“_”:“64368597”}
Don’t know if this is helpful as is, or if there is something specific I (or others) could address.