Simple Hub LUA HTTP command

2017 · 1 reply · Features

This discussion is 9 years old. It predates today's Roomie Remote X, and the app names, menus, features, pricing, and device details below have changed substantially since 2017. Treat it as historical reference — see Support and current compatibility for how things work today.

In short

Hi, I want to include the Simple Control activities in Fibaro Home Center 2. — A member replied: “The LUA code is: [code] 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 fi”

Questionnluiten4308 2017-02 · older version

Hi,

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?

[attachment=0]<!-- ia0 -->vd.jpg<!-- ia0 -->[/attachment]

In this pdf, simplecontrol.com/wp-conten ... 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

nluiten4308 2017-06 · older version

The LUA code is:

[code]

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("status:"..status);

else

fibaro:debug("Error code is "..errorCode..", response is ["..response.."]");

end

[/code]

Related threads

Today's Roomie controls 400,000+ devices.

Roomie Remote X brings TVs, receivers, streamers, lights, and whole-home audio into one app on iPhone, iPad, Mac, and Apple TV.

Download Roomie Remote X