Uservariable not updating via API-command

Moderator: leecollings

Post Reply
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Uservariable not updating via API-command

Post by DutchHans »

Good morning,

(Raspberry Pi3 on the latest Beta)

I am trying to update a uservariable (according to the wiki) with the API command from a LUA script:

Code: Select all

os.execute('http://xxx:[email protected]:8080/json.htm?type=command&param=updateuservariable&vname=RainPrediction&vtype=2&vvalue=25')
The Uservariable(String) is not updating. but when I give the same command in the browser, it works.
{
"status" : "OK",
"title" : "UpdateUserVariable"
}
Am I missing something?
Please help.

Regards, Hans
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Uservariable not updating via API-command

Post by Nautilus »

Try:

Code: Select all

os.execute('curl -s "http://xxx:[email protected]:8080/json.htm?type=command&param=updateuservariable&vname=RainPrediction&vtype=2&vvalue=25" &')
You need to tell "what" it is that should open the url, in this case "curl". Plenty of examples here on the forum :)
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Uservariable not updating via API-command

Post by DutchHans »

Nautilus,

Thank you so much, that did the trick.

Regards, Hans
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest