So, I am running into an issue where my os.execute command from Vera sent to a particle photon:
os.execute("curl https://api.spark.io/v1/devices/"..sparkKitchenID.."/setDimLevel -d access_token="..sparkAccessToken.." -d params="..ledState )
equivalent terminal command:
curl https://api.spark.io/v1/devices/2f00ffffffff343233323032/setDimLevel -d access_token=b123456852fbab73ad16a3f27beaa61a6ca7d5f -d params=100
which returns a json object like this for example:
{
"id": "2f00ffffffff343233323032",
"last_app": "",
"connected": true,
"return_value": 100
}
is executing the remote function, but locking up communication… perhaps timing out?
Can anyone tell me what I can do (a handler for the return?) so that I don’t have a timeout issue?
my us looks like this:
[code]-- Dimmer Controller for Particle Photon
function sparkLed(lul_device,lul_service,lul_variable,lul_value_old, ledState)
os.execute(“curl https://api.spark.io/v1/devices/“..sparkKitchenID..”/setDimLevel -d access_token=”…sparkAccessToken…" -d params="…ledState )
end
luup.variable_watch(“sparkLed”, “urn:upnp-org:serviceId:Dimming1”, “LoadLevelStatus”, 28)[/code]
Which monitors my virtual dimmer in Vera and sends the curl request to the Photon and subsequently the PWM pin alters the 'brightness" of the led strip.
Any assistance is appreciated!!