Send JSON PUT request to lifx http api with curl

Since there is no lifx binding for openHAB 1.x I am using “executeCommandLine”-action with curl to set my predefined light scenes.

executeCommandLine(lifxcurl + "@@-k@@-H@@Authorization: Bearer " + lifxtoken + “@@-XPUT@@” + lifxurl + “/scenes/scene_id:” + lifx_scene_hell + “/activate”)

translates to

2015-11-22 15:51:09.317 [INFO ] [] - executed commandLine ‘[/usr/bin/curl, -k, -H, Authorization: Bearer XxXxXxXx, -XPUT,]’

This works fine so far.

Now I want to send some JASON data with the request.
This curl command works in the shell:

/usr/bin/curl -k -H “Content-Type: application/json” -H “Authorization: Bearer c7a38a4e32ed7c8c46fe7e19c795bfedb0fb4abc2fbe50d34d0731a80662a98c” -XPUT -d ‘{“power”:“on”,“color”:“ue:50 saturation:0 kelvin:3000”,“brightness”:0.5,“duration”:10}’,label:Subwoofer/state`

But I cannot get it to work in openHAB.
This (simplified command) is in the log and does not work:

executed commandLine ‘[/usr/bin/curl, -k, -H, Content-Type: application/json, -H, Authorization: Bearer c7a38a4e32ed7c8c46fe7e19c795bfedb0fb4abc2fbe50d34d0731a80662a98c, -XPUT, -d, ‘{“power”:“on”}’,]’

I think there might be a problem with the quotation marks after “-d” in the JSON-part.
But I have no idea what I should change.
I already tried several syntaxes.

Does anybody have a working JSON-PUT-request in openhab?

My workaround would be to call a bash script with the working curl command. :frowning:

I utilize the “Requests” library within Python. Makes interacting with JSON api’s a breeze. Calling Python code from openhab is simple too.