Currently I am using direct API call to hue using the v1 API version. I am trying to upgrade to API V2 and I am partly successfull. I use the following test program:
Code: Select all
on = {
timer = {
'every minute'
},
httpResponses = {
'trigger'
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'template',
},
execute = function(domoticz, item)
if (item.isTimer) then
domoticz.openURL({
url = 'https://192.168.1.8/clip/v2/resource/device',
headers = { ['hue-application-key'] = 'LqUg-Ho81HxhcjOqX4YnRbrQELiSXHjkh3' },
method = 'GET',
callback = 'trigger', .
domoticz.log('HTTPS call has been done')
})
end
if (item.isHTTPResponse) then
if (item.ok) then
if (item.isJSON) then
local json = item.data
domoticz.log(json)
end
else
domoticz.log('There was a problem handling the request', domoticz.LOG_ERROR)
domoticz.log(item, domoticz.LOG_ERROR)
end
end
end
}
2024-11-25 15:22:01.917 Error: dzVents: template: HTTP/1.1 response: 35 ==>> SSL connect error
I know that V2 uses https calls only and according the Hue development site you should use the given certificate, this is probably what is going wrong at the moment.
Now the question: Does anybody know how to use a certificate in the openURL call? Is that even possible or is there another way? There are CURL examples where the certificate is sent with the CURL call.