yenoiwesa / homebridge-connexoon

A homebridge plugin to integrate Somfy blinds with the Connexoon RTS hub
Apache License 2.0
27 stars 2 forks source link

Failed to get device list - RESOURCE_ACCESS_DENIED #12

Closed HomekitDave closed 4 years ago

HomekitDave commented 4 years ago

Hi there, first of all, thanks so much for setting this up, my whole house in on HomeKit and the Somfy devices are the only things that aren’t native!

That being said: I’m getting suck on a “Failed to get device list” error. Could it be that my account is for somfy.co.uk?

Can you help?

Here is a copy of the log:

20/06/2020, 21:25:18] [My Connexoon Hub] Failed to get device list { errorCode: 'RESOURCE_ACCESS_DENIED',
  error: 'Unknown user : \'*****@*****.com\'' }
[20/06/2020, 21:25:18] [My Connexoon Hub] { StatusCodeError: 401 - {"errorCode":"RESOURCE_ACCESS_DENIED","error":"Unknown user : '*****@*****.com'"}
    at new StatusCodeError (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:198:13)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:286:20)
    at IncomingMessage.emit (events.js:203:15)
  name: 'StatusCodeError',
  statusCode: 401,
  message:
   '401 - {"errorCode":"RESOURCE_ACCESS_DENIED","error":"Unknown user : \'*****@*****.com\'"}',
  error:
   { errorCode: 'RESOURCE_ACCESS_DENIED',
     error: 'Unknown user : \'*****@*****.com\'' },
  options:
   { auth:
      { bearer:
         '*********' },
     url:
      'https://ha201-1.overkiz.com/enduser-mobile-web/enduserAPI/setup/devices',
     json: true,
     method: 'GET',
     callback: [Function: RP$callback],
     transform: undefined,
     simple: true,
     resolveWithFullResponse: false,
     transform2xxOnly: false },
  response:
   IncomingMessage {
     _readableState:
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: BufferList { head: null, tail: null, length: 0 },
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: true,
        ended: true,
        endEmitted: true,
        reading: false,
        sync: false,
        needReadable: false,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        paused: false,
        emitClose: true,
        autoDestroy: false,
        destroyed: false,
        defaultEncoding: 'utf8',
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: false,
     _events:
      [Object: null prototype] {
        end: [Array],
        close: [Array],
        data: [Function],
        error: [Function] },
     _eventsCount: 4,
     _maxListeners: undefined,
     socket:
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: 'ha201-1.overkiz.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 8,
        connecting: false,
        _hadError: false,
        _handle: [TLSWrap],
        _parent: null,
        _host: 'ha201-1.overkiz.com',
        _readableState: [ReadableState],
        readable: true,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: [TLSWrap],
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [ClientRequest],
        [Symbol(res)]: [TLSWrap],
        [Symbol(asyncId)]: 91,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: [Object] },
     connection:
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: 'ha201-1.overkiz.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 8,
        connecting: false,
        _hadError: false,
        _handle: [TLSWrap],
        _parent: null,
        _host: 'ha201-1.overkiz.com',
        _readableState: [ReadableState],
        readable: true,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: [TLSWrap],
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [ClientRequest],
        [Symbol(res)]: [TLSWrap],
        [Symbol(asyncId)]: 91,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: [Object] },
     httpVersionMajor: 1,
     httpVersionMinor: 1,
     httpVersion: '1.1',
     complete: true,
     headers:
      { date: 'Sat, 20 Jun 2020 20:25:18 GMT',
        server: 'overkiz',
        'strict-transport-security': 'max-age=31536000; includeSubDomains',
        'content-type': 'application/json;charset=ISO-8859-1',
        'content-length': '99',
        connection: 'close' },
     rawHeaders:
      [ 'Date',
        'Sat, 20 Jun 2020 20:25:18 GMT',
        'Server',
        'overkiz',
        'Strict-Transport-Security',
        'max-age=31536000; includeSubDomains',
        'Content-Type',
        'application/json;charset=ISO-8859-1',
        'Content-Length',
        '99',
        'Connection',
        'close' ],
     trailers: {},
     rawTrailers: [],
     aborted: false,
     upgrade: false,
     url: '',
     method: null,
     statusCode: 401,
     statusMessage: '',
     client:
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: 'ha201-1.overkiz.com',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 8,
        connecting: false,
        _hadError: false,
        _handle: [TLSWrap],
        _parent: null,
        _host: 'ha201-1.overkiz.com',
        _readableState: [ReadableState],
        readable: true,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: [TLSWrap],
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [ClientRequest],
        [Symbol(res)]: [TLSWrap],
        [Symbol(asyncId)]: 91,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: [Object] },
     _consuming: true,
     _dumped: false,
     req:
      ClientRequest {
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: false,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: 0,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [TLSSocket],
        connection: [TLSSocket],
        _header:
         'GET /enduser-mobile-web/enduserAPI/setup/devices HTTP/1.1\r\nhost: ha201-1.overkiz.com\r\nauthorization: Bearer *******\r\naccept: application/json\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        timeout: undefined,
        method: 'GET',
        insecureHTTPParser: undefined,
        path: '/enduser-mobile-web/enduserAPI/setup/devices',
        _ended: true,
        res: [Circular],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        [Symbol(isCorked)]: false,
        [Symbol(outHeadersKey)]: [Object] },
     request:
      Request {
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        method: 'GET',
        readable: true,
        writable: true,
        explicitMethod: true,
        _qs: [Querystring],
        _auth: [Auth],
        _oauth: [OAuth],
        _multipart: [Multipart],
        _redirect: [Redirect],
        _tunnel: [Tunnel],
        _rp_resolve: [Function],
        _rp_reject: [Function],
        _rp_promise: [Promise],
        _rp_callbackOrig: undefined,
        callback: [Function],
        _rp_options: [Object],
        headers: [Object],
        setHeader: [Function],
        hasHeader: [Function],
        getHeader: [Function],
        removeHeader: [Function],
        localAddress: undefined,
        pool: {},
        dests: [],
        __isRequestRequest: true,
        _callback: [Function: RP$callback],
        uri: [Url],
        proxy: null,
        tunnel: true,
        setHost: true,
        originalCookieHeader: undefined,
        _disableCookies: true,
        _jar: undefined,
        port: 443,
        host: 'ha201-1.overkiz.com',
        path: '/enduser-mobile-web/enduserAPI/setup/devices',
        _json: true,
        httpModule: [Object],
        agentClass: [Function],
        agent: [Agent],
        _started: true,
        href:
         'https://ha201-1.overkiz.com/enduser-mobile-web/enduserAPI/setup/devices',
        req: [ClientRequest],
        ntick: true,
        response: [Circular],
        originalHost: 'ha201-1.overkiz.com',
        originalHostHeaderName: 'host',
        responseContent: [Circular],
        _destdata: true,
        _ended: true,
        _callbackCalled: true },
     toJSON: [Function: responseToJSON],
     caseless: Caseless { dict: [Object] },
     body:
      { errorCode: 'RESOURCE_ACCESS_DENIED',
        error: 'Unknown user : \'*****@*****.com\'' } } } 
yenoiwesa commented 4 years ago

Hi @HomekitDave , have you tried using the different service values in the config file and see if one works for your region?

See README.md for more details, check service.

HomekitDave commented 4 years ago

Hey @yenoiwesa , Thank you so much.

Foolishly I had only tried the using service with the value ConnexoonRTS Thinking that Connexoon was default.

It appears one needs to use Connexoon as the service value in the UK.

As a side note, I wasn’t sure of the right way to add the Somfy Irismo 35 and Somfy Movelite 35 track motors; but I’ve added them as roller shades on the Connexoon box, and they where picked up automatically by Homebridge.io and seem to work great with HomeKit, if you ignore the slider within the app is useless. - It’s a shame that we cannot send a stop command when the button is re pressed in the Home App. Anyway...

Thanks so much again!!!