zyonse / homebridge-dreo

Apple HomeKit integration for Dreo Smart Devices
https://www.npmjs.com/package/homebridge-dreo
Apache License 2.0
29 stars 17 forks source link

Support Dreo Pedestal Fan #9

Closed den1k closed 1 year ago

den1k commented 1 year ago

Is your feature request related to a problem? Please describe: this fan is not yet supported https://www.dreo.com/products/portable-pedestal-fan

zyonse commented 1 year ago

Do you have the device?

den1k commented 1 year ago

Yes

On Tue, Jun 13, 2023 at 1:21 PM Gavin Zyonse @.***> wrote:

Do you have the device?

— Reply to this email directly, view it on GitHub https://github.com/zyonse/homebridge-dreo/issues/9#issuecomment-1589725923, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDPWITILBC2FY6A3Y5BFW3XLCOQBANCNFSM6AAAAAAZFFS4IA . You are receiving this because you authored the thread.Message ID: @.***>

zyonse commented 1 year ago

What happens when you run the plugin? Does it give you an error?

den1k commented 1 year ago

It works. I Just don’t see the fan as an accessory.

On Wed, Jun 14, 2023 at 12:52 PM Gavin Zyonse @.***> wrote:

What happens when you run the plugin? Does it give you an error?

— Reply to this email directly, view it on GitHub https://github.com/zyonse/homebridge-dreo/issues/9#issuecomment-1591648636, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDPWIRCCSRZMAJOM3BNY4LXLHT3VANCNFSM6AAAAAAZFFS4IA . You are receiving this because you authored the thread.Message ID: @.***>

zyonse commented 1 year ago

Can you post the homebridge console output?

den1k commented 1 year ago

Sure,

initially

[6/13/2023, 2:15:31 PM] [midea-air] SendCommand ([updateValues] attempt 1/2) request failed: Error: getaddrinfo EAI_AGAIN mapp.appsmb.com
[6/13/2023, 2:15:31 PM] [midea-air] [updateValues] Error sending the command: undefined. Trying to re-login before re-issuing command...
[6/13/2023, 2:15:41 PM] [midea-air] [updateValues] re-login attempt failed
[6/13/2023, 2:16:01 PM] [midea-air] SendCommand ([updateValues] attempt 1/2) request failed: Error: getaddrinfo EAI_AGAIN mapp.appsmb.com
[6/13/2023, 2:16:01 PM] [midea-air] [updateValues] Error sending the command: undefined. Trying to re-login before re-issuing command...

and then

[6/13/2023, 4:52:09 PM] [Dreo Platform] error retrieving token: AxiosError: getaddrinfo EAI_AGAIN app-api-us.dreo-cloud.com
    at Function.AxiosError.from (/volume1/homebridge/node_modules/homebridge-dreo/node_modules/axios/lib/core/AxiosError.js:89:14)
    at RedirectableRequest.handleRequestError (/volume1/homebridge/node_modules/homebridge-dreo/node_modules/axios/lib/adapters/http.js:591:25)
    at RedirectableRequest.emit (node:events:527:28)
    at ClientRequest.eventHandlers.<computed> (/volume1/homebridge/node_modules/homebridge-dreo/node_modules/follow-redirects/index.js:14:24)
    at ClientRequest.emit (node:events:527:28)
    at TLSSocket.socketErrorListener (node:_http_client:454:9)
    at TLSSocket.emit (node:events:527:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  hostname: 'app-api-us.dreo-cloud.com',
  syscall: 'getaddrinfo',
  code: 'EAI_AGAIN',
  errno: -3001,
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function], Blob: null },
    validateStatus: [Function: validateStatus],
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json; charset=UTF-8',
      ua: 'dreo/2.0.7 (sdk_gphone64_x86_64;android 13;Scale/2.625)',
      lang: 'en',
      'accept-encoding': 'gzip',
      'user-agent': 'okhttp/4.9.1',
      'Content-Length': '283'
    },
    params: { timestamp: 1686693119734 },
    method: 'post',
    url: 'https://app-api-us.dreo-cloud.com/api/oauth/login',
    data: '{"client_id":"<hidden>","client_secret":"<hidden>","email":"<hidden>","encrypt":"ciphertext","grant_type":"email-password","himei":"<hidden>","password":"<hidden>","scope":"all"}'
  },
  request: <ref *1> Writable {
    _writableState: WritableState {
      objectMode: false,
      highWaterMark: 16384,
      finalCalled: false,
      needDrain: false,
      ending: false,
      ended: false,
      finished: false,
      destroyed: false,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      length: 0,
      writing: false,
      corked: 0,
      sync: true,
      bufferProcessing: false,
      onwrite: [Function: bound onwrite],
      writecb: null,
      writelen: 0,
      afterWriteTickInfo: null,
      buffered: [],
      bufferedIndex: 0,
      allBuffers: true,
      allNoop: true,
      pendingcb: 0,
      constructed: true,
      prefinished: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      errored: null,
      closed: false,
      closeEmitted: false,
      [Symbol(kOnFinished)]: []
    },
    _events: [Object: null prototype] {
      response: [Function: handleResponse],
      error: [Function: handleRequestError],
      socket: [Function: handleRequestSocket]
    },
    _eventsCount: 3,
    _maxListeners: undefined,
    _options: {
      maxRedirects: 21,
      maxBodyLength: Infinity,
      protocol: 'https:',
      path: '/api/oauth/login?timestamp=1686693119734',
      method: 'POST',
      headers: [Object: null prototype],
      agents: [Object],
      auth: undefined,
      family: undefined,
      lookup: undefined,
      beforeRedirect: [Function: dispatchBeforeRedirect],
      beforeRedirects: [Object],
      hostname: 'app-api-us.dreo-cloud.com',
      port: '',
      agent: undefined,
      nativeProtocols: [Object],
      pathname: '/api/oauth/login',
      search: '?timestamp=1686693119734'
    },
    _ended: false,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 283,
    _requestBodyBuffers: [ [Object] ],
    _onNativeResponse: [Function (anonymous)],
    _currentRequest: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: false,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'POST /api/oauth/login?timestamp=1686693119734 HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json; charset=UTF-8\r\n' +
        'ua: dreo/2.0.7 (sdk_gphone64_x86_64;android 13;Scale/2.625)\r\n' +
        'lang: en\r\n' +
        'accept-encoding: gzip\r\n' +
        'user-agent: okhttp/4.9.1\r\n' +
        'Content-Length: 283\r\n' +
        'Host: app-api-us.dreo-cloud.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/api/oauth/login?timestamp=1686693119734',
      _ended: false,
      res: null,
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'app-api-us.dreo-cloud.com',
      protocol: 'https:',
      _redirectable: [Circular *1],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    _currentUrl: 'https://app-api-us.dreo-cloud.com/api/oauth/login?timestamp=1686693119734',
    [Symbol(kCapture)]: false
  },
  cause: Error: getaddrinfo EAI_AGAIN app-api-us.dreo-cloud.com
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26) {
    errno: -3001,
    code: 'EAI_AGAIN',
    syscall: 'getaddrinfo',
    hostname: 'app-api-us.dreo-cloud.com'
  }
}
[6/13/2023, 4:52:09 PM] [Dreo Platform] Authentication error: Server returned invalid access_token
[6/13/2023, 4:52:09 PM] [Dreo Platform] Make sure your email/password are correct

Email and password are correct. I confirmed by logging out on mobile and back in. I use one password so no typo incorrectness. also double checked.

zyonse commented 1 year ago

The first set of logs is from the midea-air plugin and it's throwing the same error. Make sure you don't have any internet issues.

den1k commented 1 year ago

You're right, I did have an internet outage a few days back. Ignore those logs, homebridge has been working most of the time

zyonse commented 1 year ago

Is the device working now?

den1k commented 1 year ago

No, basically nothing is showing up in accessories in homebridge

den1k commented 1 year ago

oh interesting. I'm seeing that it does show up in homekit. Not home right now but I will investigate

den1k commented 1 year ago

Okay just tested. Controls are only fan speed. No tilt or sleep. And It’s not working

On Fri, Jun 16, 2023 at 2:14 PM Gavin Zyonse @.***> wrote:

Is the device working now?

— Reply to this email directly, view it on GitHub https://github.com/zyonse/homebridge-dreo/issues/9#issuecomment-1595089906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDPWIUTS656FJHLONUVCGLXLSO67ANCNFSM6AAAAAAZFFS4IA . You are receiving this because you authored the thread.Message ID: @.***>

zyonse commented 1 year ago

@den1k Does it respond to the controls in HomeKit? Or is there an error that it gives in homebridge?

den1k commented 1 year ago

I’m currently out of country so I can’t check. As far as I remember it simply did not work and also did not log an error.

On Sun, Jul 2, 2023 at 4:35 PM Gavin Zyonse @.***> wrote:

@den1k https://github.com/den1k Does it respond to the controls in HomeKit? Or is there an error that it gives in homebridge?

— Reply to this email directly, view it on GitHub https://github.com/zyonse/homebridge-dreo/issues/9#issuecomment-1616683460, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDPWIRHUY7W6NUT7F2H6UTXOGBL7ANCNFSM6AAAAAAZFFS4IA . You are receiving this because you were mentioned.Message ID: @.***>

den1k commented 1 year ago

I'm not sure if anything changed but when I got back home I had to restart homebridge because my midea AC had stopped responding and that resolved the issue with the dreo fan. it works great now. thanks @zyonse!!