hi all,
converting from a vera to HS3 finally, and wanted to get peoples advice on the best way to send commands to my particle photon. Basically I need to send SSL commands to send and get data.
Lets start with the easy one, the code below would send a message to my photon. in vera i would do this via Luup:
very simple, it would basically POST via SSL to my photon.
What would be the best way to do something like this via scripting in HS3?
converting from a vera to HS3 finally, and wanted to get peoples advice on the best way to send commands to my particle photon. Basically I need to send SSL commands to send and get data.
Lets start with the easy one, the code below would send a message to my photon. in vera i would do this via Luup:
local socket = require('socket')
local https = require('ssl.https')
local ltn12 = require('ltn12')
https.TIMEOUT = 5
local body, code, headers, status = https.request("https://api.particle.io/v1/devices/{device}/led","arg=9,255,255,0&access_token={token})
return true
local https = require('ssl.https')
local ltn12 = require('ltn12')
https.TIMEOUT = 5
local body, code, headers, status = https.request("https://api.particle.io/v1/devices/{device}/led","arg=9,255,255,0&access_token={token})
return true
very simple, it would basically POST via SSL to my photon.
What would be the best way to do something like this via scripting in HS3?
Comment