Page 1 of 1
HTTP GET REST no response
Posted: 24 Dec 2017 13:12
by MechEng70
Been using Tasker for years now with my home automation system. Decided to try Automagic.
Can build the URL and show it on the screen, however when using the http get, the response comes back as blank, not null.
When the URL is put into a browser, the system will respond back with the expected results.
Does anyone have any other experience with the http get other than the one tutorial?
Does anyone use the http get with ISY?
Re: HTTP GET REST no response
Posted: 24 Dec 2017 13:16
by MechEng70
Log File of the element
24.12.2017 08:14:18.760 [Coming Home] Start executing action 'ISYStatePost'
24.12.2017 08:14:18.761 [Coming Home] Action 'ISYStatePost' url =
http://admin:xxxxxx@172.16.5.251/rest/vars/set/2/2/0
24.12.2017 08:14:18.761 [Coming Home] Action 'ISYStatePost' variable = RESTResponse
24.12.2017 08:14:18.834 [Coming Home] Action 'ISYStatePost' URL data fetched successfully.
24.12.2017 08:14:18.835 [Coming Home] End executing action 'ISYStatePost'
24.12.2017 08:14:18.844 [Coming Home] Flow continues executing with the next step.
24.12.2017 08:14:18.844 [Coming Home] Start executing action 'Notification on Screen: Response: {RESTResponse}
URL: {global_ISYUrl}/rest/vars/set/2/{par1}/{par2} (long)'
24.12.2017 08:14:18.862 [Coming Home] Object 'Coming Home' Showing toast text 'Response:
URL:
http://admin:xxxxxx@172.16.5.251/rest/vars/set/2/2/0'.
24.12.2017 08:14:18.869 [Coming Home] End executing action 'Notification on Screen: Response: {RESTResponse}
URL: {global_ISYUrl}/rest/vars/set/2/{par1}/{par2} (long)'
24.12.2017 08:14:18.898 [Coming Home] Flow ended.
Re: HTTP GET REST no response
Posted: 24 Dec 2017 14:08
by Desmanto
I don't have experience with ISY. But I use Eventghost web server and automagic HTTP request trigger to communicate back-thru.
Try to put Condition Debug Dialog to see the result of the response. Probably the response is there, but processed wrongly.
Re: HTTP GET REST no response
Posted: 24 Dec 2017 14:44
by MechEng70
Seems like there is an issue with the http request. NETWORK 401.
Although when the URL is put into a browser it works.
24.12.2017 09:41:26.480 [Coming Home] Action 'ISYStatePost' variable = RESTResponse
24.12.2017 09:41:26.510 [Coming Home] Action 'ISYStatePost' URL data fetched successfully.
24.12.2017 09:41:26.511 [Coming Home] Action 'ISYStatePost' Header Cache-Control=max-age=3600, must-revalidate
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header Connection=Keep-Alive
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header Content-Length=0
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header Content-Type=text/html; charset=UTF-8
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header EXT=UCoS, UPnP/1.0, UDI/1.0
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header Last-Modified=Sun, 24 Dec 2017 9:40:18 GMT
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header WWW-Authenticate=Basic realm="/"
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header X-Android-Received-Millis=1514126486509
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header X-Android-Response-Source=NETWORK 401
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header X-Android-Selected-Protocol=http/1.1
24.12.2017 09:41:26.512 [Coming Home] Action 'ISYStatePost' Header X-Android-Sent-Millis=1514126486502
Re: HTTP GET REST no response
Posted: 24 Dec 2017 17:26
by Desmanto
Error 401 seems like authentication error. Do you put correct username password? Try to disable the password in the server for testing.
Can you replicate what you do in tasker before?
Re: HTTP GET REST no response
Posted: 24 Dec 2017 17:54
by MechEng70
Thats the exact URL from Tasker. Also pasted it into a browser and it worked.
Really strange.
I removed the username and password from the http string and checked the basic authentication, adding the username and password. That succeeded.
Strange that the URL version doesn't work.
Re: HTTP GET REST no response
Posted: 24 Dec 2017 18:20
by Desmanto
Info from Wikipedia, stated the URL encoding username:password@ method has been deprecated.
https://en.wikipedia.org/wiki/Basic_acc ... entication
Authorization field at least encode the username password using base64. It is not secure, but at least it is not readable by human.
Automagic probably want to enforce it, and avoid using readable username password.
Re: HTTP GET REST no response
Posted: 24 Dec 2017 18:26
by MechEng70
Thanks. Appreciate the information.