HTTP GET REST no response

Post your questions and help other users.

Moderator: Martin

Post Reply
MechEng70
Posts: 5
Joined: 23 Dec 2017 17:03

HTTP GET REST no response

Post by MechEng70 » 24 Dec 2017 13:12

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?
Last edited by MechEng70 on 24 Dec 2017 13:17, edited 1 time in total.

MechEng70
Posts: 5
Joined: 23 Dec 2017 17:03

Re: HTTP GET REST no response

Post by MechEng70 » 24 Dec 2017 13:16

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.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP GET REST no response

Post by Desmanto » 24 Dec 2017 14:08

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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

MechEng70
Posts: 5
Joined: 23 Dec 2017 17:03

Re: HTTP GET REST no response

Post by MechEng70 » 24 Dec 2017 14:44

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

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP GET REST no response

Post by Desmanto » 24 Dec 2017 17:26

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?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

MechEng70
Posts: 5
Joined: 23 Dec 2017 17:03

Re: HTTP GET REST no response

Post by MechEng70 » 24 Dec 2017 17:54

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.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP GET REST no response

Post by Desmanto » 24 Dec 2017 18:20

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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

MechEng70
Posts: 5
Joined: 23 Dec 2017 17:03

Re: HTTP GET REST no response

Post by MechEng70 » 24 Dec 2017 18:26

Thanks. Appreciate the information.

Post Reply