Simple Hub LUA HTTP command


I want to include the Simple Control activities in Fibaro Home Center 2. I have created a Virtual Device in HC2 and added a few buttons for all activities. What LUA code do I have to enter to the VD button?


In this pdf, … erface.pdf, I have found the code below to run a activity:

$ curl -X POST ‘http://[color=#FF0000]IPADDRESS[/color]:47147/api/v1/runactivity’ -d
“activity_uuid” : “[color=#FF0000]53B7B23B-F70F-498D-A128-477FCBD05A58[/color]” }’
“status” : “success”,
“data” : {
“code” : 200

The IPADDRESS is the Hub IP (iPad)
I have found the activity_uuid in IPADDRESS:47147/api/v1/activities

Thank you in advance

The LUA code is:

http = Net.FHttp("111.222.333.444", 47147);
response, status, errorCode = http:POST("/api/v1/runactivity", [[ {"activity_uuid":"12345678-1234-1234-1234-1234567890"} ]] );
if errorCode == 0 then
  fibaro:debug("Error code is "..errorCode..", response is ["..response.."]");