try adding
requestContentType: "application/json"
as well
Still getting with the requestContentType: "application/json"
2018-08-02 08:08:13.251:debugerror occured calling httpPost groovyx.net.http.HttpResponseException: Bad Request
One more option to try, use these 2 parameters:
contentType: "application/json",
requestContentType: "application/x-www-form-urlencoded"
It seems this recent change is also causing some issue for the Rachio Integration. I am getting this when trying to add the Rachio Integration app.
app:12312018-08-02 09:11:53.196:infoNo Rachio AuthToken Found... Please Login...
app:12312018-08-02 09:11:49.281:errorcallback exception: No encoder found for request content type /
app:12312018-08-02 09:11:42.361:infoNo Rachio AuthToken Found... Please Login...
I am seeing this error for the Amazon Echo Skill.
groovyx.net.http.HttpResponseException: Bad Request (deviceHandler)
Also seeing this for EcoBee:
HttpResponseException groovyx.net.http.HttpResponseException: Internal Server Error, 500 polling ecobee pollAttempt:1, isThermostatPolled:false, isSwitchesPolled:true, [status:[code:14, message:Authentication token has expired. Refresh your tokens. ]]
Neither of the fixes are working for me:
groovy.lang.MissingMethodException: No signature of method: com.hubitat.hub.executor.AppExecutor.error() is applicable for argument types: (java.lang.String, java.lang.IllegalArgumentException) values: [Error logging in to AT&T, java.lang.IllegalArgumentException: No encoder found for request content type /] Possible solutions: render(), getLog(), now(), iterator(), grep(), every() on line 486 (prefATTConfirm)
Here is my code:
response.getHeaders('Set-Cookie').each {
def cookie = it.value.split(';')[0]
if (!cookie.startsWith('PD_')) cookies.push(cookie)
c = c + cookie + '; '
}
//using the cookies, retrieve the auth tokens
return httpPost([
uri: "https://my-digitallife.att.com/penguin/api/authtokens",
headers: [
"Referer": "https://my-digitallife.att.com/dl",
"contentType": "application/json",
"requestContentType": "application/x-www-form-urlencoded",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
"DNT": "1",
"Cookie": c
],
body: "domain=DL&appKey=TI_3198CF46D58D3AFD_001"
]) { response2 ->
Any advice?
Remove these from the headers map, add them to the main map.
Just did the upgrade as well and getting flooded with this same issue.
Same here - seeing the same HttpResponseException issue in my logs and sluggish Alexa responses.
See below. The Hubitat team is aware the issue and is working on a hotfix.
Just applied the hotfix 1.1.2.121. It seems the Ecobee errors are gone but I still see the following Amazon Echo Skill error in the log below.
Error making Call to Alexa message gateway. groovyx.net.http.HttpResponseException: Bad Request
Edit: I stand corrected it looks like the Ecobee issue is still present.
Just applied hot fix 1.1.2.121 and can confirm Alexa responsiveness is back, albeit not as fast as before. Also no errors showing up in the Amazon Echo Skill logs. Much appreciated for a quick fix!
Seems like Alexa is working faster and actually responding now. Not sure why I am still seeing those errors though.
Like so:
return httpPost([
uri: "https://my-digitallife.att.com/penguin/api/authtokens",
contentType: "application/json",
requestContentType: "application/x-www-form-urlencoded",
headers: [
"Referer": "https://my-digitallife.att.com/dl",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
"DNT": "1",
"Cookie": c
],
body: "domain=DL&appKey=TI_3198CF46D58D3AFD_001"
]) { response2 ->
Still getting an error:
groovy.lang.MissingMethodException: No signature of method: com.hubitat.hub.executor.AppExecutor.error() is applicable for argument types: (java.lang.String, groovyx.net.http.ResponseParseException) values: [Error logging in to AT&T, groovyx.net.http.ResponseParseException: Moved Temporarily] Possible solutions: render(), getLog(), now(), iterator(), grep(), every() on line 484 (prefATTConfirm)
private doATTLogin(installing, force) {
try {
def module_name = 'digitallife';
//if cookies haven't expired and unless we need to force a login, we report all is pink
if (!installing && !force && state.hch.security[module_name] && state.hch.security[module_name].connected && (state.hch.security[module_name].expires > now())) {
log.info "Reusing previously login for AT&T Digital Life"
return true;
}
//setup our security descriptor
def hch = (installing ? state.ihch : state.hch)
hch.useATT = false;
hch.security[module_name] = [
'enabled': !!(settings.attUsername || settings.attPassword),
'controllable': settings.attControllable,
'syncLocationMode': settings.attSyncLocationMode,
'syncSmartHomeMonitor': settings.attSyncSmartHomeMonitor,
'connected': false
]
//check if the AT&T Digital Life module is enabled
if (hch.security[module_name].enabled) {
log.info "Logging in to AT&T Digital Life..."
//perform the initial login, retrieve cookies
return httpPost([
uri: "https://my-digitallife.att.com/tg_wam/login.do",
contentType: "application/json",
requestContentType: "application/x-www-form-urlencoded",
headers: [
'Referer': 'https://my-digitallife.att.com/dl/',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36'
],
body: "source=DLNA&targetURL=https://my-digitallife.att.com/dl/#/authenticate&loginURL=https://my-digitallife.att.com/dl/#/login&userid=${settings.attUsername}&password=${settings.attPassword}"
]) { response ->
//check response, sometimes they redirect, that's fine, we don't need to follow the redirect, we just need the cookies
if ((response.status == 200) || (response.status == 302)) {
def cookies = []
def c = "";
//the hard part, get the cookies
response.getHeaders('Set-Cookie').each {
def cookie = it.value.split(';')[0]
if (!cookie.startsWith('PD_')) cookies.push(cookie)
c = c + cookie + '; '
}
//using the cookies, retrieve the auth tokens
return httpPost([
uri: "https://my-digitallife.att.com/penguin/api/authtokens",
contentType: "application/json",
requestContentType: "application/x-www-form-urlencoded",
headers: [
"Referer": "https://my-digitallife.att.com/dl",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
"DNT": "1",
"Cookie": c
],
body: "domain=DL&appKey=TI_3198CF46D58D3AFD_001"
]) { response2 ->
//check response, continue if 200 OK
//log.trace response2.status
if (response2.status == 200) {
if (response2.data && response2.data.content && response2.data.content.gateways && response2.data.content.gateways.length) {
//save the cookies and tokens into the security descriptor
//cookies expire in 13 minutes, we'll use 12 minutes as an expiry to ensure we don't refuse reconnection
hch.security[module_name].key = response2.data.content.gateways[0].id
hch.security[module_name].authToken = response2.data.content.authToken
hch.security[module_name].requestToken = response2.data.content.requestToken
hch.security[module_name].cookies = cookies
hch.security[module_name].connected = now()
hch.security[module_name].expires = now() + 720000 //expires in 12 minutes
log.info "Successfully connected to AT&T Digital Life"
attConnectionStatus = true
hch.useATT = true;
return true;
}
}
return false;
}
} else {
return false
}
}
} else {
return true;
}
} catch(e) { log.error "Error logging in to AT&T", e }
}
This fixed my issue:
return httpPost([
uri: "https://my-digitallife.att.com/penguin/api/authtokens",
requestContentType: "application/x-www-form-urlencoded; charset=utf-8",
headers: [
"Referer": "https://my-digitallife.att.com/dl",
"contentType": "application/json",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
"DNT": "1",
"Cookie": c
],
I'm still getting these errors periodically.
[app:457](http://REDACTEDlogs#app457)2018-08-12 08:32:09.449:errorError making Call to Alexa message gateway. groovyx.net.http.HttpResponseException: Bad Request
[app:457](http://REDACTED/logs#app457)2018-08-12 08:32:08.882:errorError making Call to Alexa message gateway. groovyx.net.http.HttpResponseException: Bad Request
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.