Problem with opening URL using dzvents
Posted: Saturday 06 April 2019 16:54
I'm trying to move a script from old LUA to dzvents.
The script basically calls on the Tado API to get temperature from my heating control.
On the old LUA script it calls curl to do this, like this:
Using dzVents I'm trying this:
With the old approach, it works fine, but with the dzvents approach I'm getting an unauthorised response back from the tado web site.
Any ideas why? They look equivalent to me.
Thanks
The script basically calls on the Tado API to get temperature from my heating control.
On the old LUA script it calls curl to do this, like this:
Code: Select all
os.execute('curl -s "https://auth.tado.com/oauth/token" -d client_id=public-api-preview -d client_secret=4HJGRffVR8xb3XdEUQpjgZ1VplJi6Xgw -d grant_type=password -d password=' .. tado_pwd .. ' -d scope=home.user -d username=' .. tado_user)
Code: Select all
domoticz.openURL({
url = 'https://auth.tado.com/oauth/token',
method = 'POST',
callback = 'tadoauthcallback',
postData = {
client_id = "public-api-preview",
client_secret = "4HJGRffVR8xb3XdEUQpjgZ1VplJi6Xgw",
grant_type = "password",
password = tado_pwd,
scope = "home.user",
username = tado_user
}
})Any ideas why? They look equivalent to me.
Thanks