Page 1 of 1

os.execute and http link

Posted: Monday 20 November 2017 21:42
by poudenes
Hi Al,

Is it possible to have this in a dzvents script:

os.execute('http://127.0.0.1:8081/json.htm?type=com ... hite=false')

I want send some values to my milights to give them colours

Re: os.execute and http link

Posted: Monday 20 November 2017 21:54
by Freemann
openURL()

Code: Select all

openURL("http://127.0.0.1:8081/json.htm?type=command&param=setcolbrightnessvalue&idx=3&hue=18&brightness=50&iswhite=false")
?

Re: os.execute and http link

Posted: Tuesday 21 November 2017 10:37
by poudenes
find out that it has to be this

Code: Select all

os.execute('curl "http://127.0.0.1:8081/json.htm?type=command&param=setcolbrightnessvalue&idx=3&hue=18&brightness=50&iswhite=false"')

Re: os.execute and http link

Posted: Tuesday 21 November 2017 15:48
by Freemann
If I'm right os.execute() will wait on the HTTP response and in the meantime will "hang" domoticz and prevent other processes to run.
The preferred way to do this is with:
openURL(url)

or' in dzVents;
domoticz.openURL(url)

Just my2 cents :)