Changes to httpPost in release 1.1.2

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!

1 Like

Seems like Alexa is working faster and actually responding now. Not sure why I am still seeing those errors though.

Sorry if I sound dumb here. Where is the main map?

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 ->
1 Like

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
                ],
2 Likes

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.