Help with scene creation! I am trying to integrate my Hozelock cloud controller to my Vera Plus I am trying to create a scene for turning on and off the unit from my Vera I have found the api for Hozelock but I cannot integrate it into a scene can someone help me with this code. GitHub - martynjsimpson/HozelockAPI: Documentation of Hozelock Cloud Controller API
Hi thank you for your reply appreciate your help but I don’t know how to incorporate the code to the Lua! I was hoping that someone can set it up for me so I can just put my credential and copy and paste into a scene I will much appreciate if someone can help me!
add at bottom luup.log("JSON HTTP - " .. c .. " - " .. tostring(r) .. "\n")
Then run code in apps- develop - run test Lua.
Then check what is in the vera log.
To see log enter this
http://vera_ip/cgi-bin/cmh/log.sh?Device=LuaUPnP
into browser, add your vera’s IP in link.
edit also make sure the url is correct as i just copied your example.
also this version may be better as it will turn the json response into a string for easy printing in log luup.log("JSON HTTP - " .. c .. " - " .. tostring(r) .. "\n")
Hi I have managed to get some logs I don’t know if that helps you or not!
01 04/28/20 11:06:15.852 LuaInterface::LoadCode: [string “local https = require “ssl.https”…”]:6: malformed number near ‘8TE44F’ <0x74118520>
01 04/28/20 11:06:15.853 JobHandler_LuaUPnP::RunLua failed: local https = require “ssl.https”
local http = require “socket.http”
local ltn12 = require “ltn12”
local json = require “dkjson”
– edit deviceid here this can be an array of ids {854RT}
local payload = {{854RT}
– edit for duration
local DurationLength = “300000”
local request_body = {controllerIDs = payload, duration = DurationLength}
local response_body = {}
request_body = json.encode(request_body)
local http = require “socket.http”
local ltn12 = require “ltn12”
local json = require “dkjson”
– edit deviceid here this can be an array of ids {“854RT”}
local payload = {“854RT”}
– edit for duration
local DurationLength = “300000”
local request_body = {controllerIDs = payload, duration = DurationLength}
local response_body = {}
request_body = json.encode(request_body)