rickymarcon/homebridge-daikin

BRP072C42 Controller compatibility

Closed this issue · 5 comments

atr00 commented

Would be great to add support for the BRP072C42 controller (Daikin iSmile units).

Getting this error when adding:

(node:651) UnhandledPromiseRejectionWarning: RequestError: Error: Invalid URI "192.168.1.116/aircon/get_model_info" at new RequestError (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/lib/errors.js:14:15) at Request.plumbing.callback (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/lib/plumbing.js:87:29) at Request.RP$callback [as _callback] (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/lib/plumbing.js:46:31) at self.callback (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/request.js:185:22) at Request.emit (events.js:310:20) at Request.init (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/request.js:273:17) at Request.RP$initInterceptor [as init] (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/configure/request2.js:45:29) at new Request (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/request.js:127:8) at request (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/index.js:53:10) at DaikinApi.getModelInfo (/homebridge/node_modules/homebridge-daikin-unofficial/dist/index.js:88:32) at DaikinAccessory.getModelInfo (/homebridge/node_modules/homebridge-daikin-unofficial/dist/index.js:274:42) at new DaikinAccessory (/homebridge/node_modules/homebridge-daikin-unofficial/dist/index.js:266:14) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:308:29) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:91:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1156:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) at Module.load (internal/modules/cjs/loader.js:1000:32) at Function.Module._load (internal/modules/cjs/loader.js:899:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 (node:651) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:651) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@atrupo do you know if there is a documented API for the BRP072C42 controller?

Half the battle with adding support for different Daikin devices/models is the fact there is no official documentation... 🤦‍♂️

atr00 commented

@rickymarcon it seems that they found a solution here:
ael-code/daikin-control#27

@atrupo Thanks for sharing, though I have come across this thread before. From my understanding, they state that the APIs between the models have largely remained the same, except for the fact that the newer models must be connected over https only. In order to do that, you need to register a new X-Daikin-uuid as described in the thread and in this project's README.

If you've already tried that or if it that still doesn't work, then I'm unsure what can be causing the problem without more troubleshooting, sorry.

atr00 commented

@rickymarcon : I have registered the UUID as described and this request returns a correct answer:

`atr@Alessandros-MacBook-Pro ~ % curl --insecure -H "X-Daikin-uuid: 5ae4284c944240f9b3c5bab219b72467" -v "https://192.168.1.68/aircon/get_model_info"

  • Trying 192.168.1.68:443...
  • TCP_NODELAY set
  • Connected to 192.168.1.68 (192.168.1.68) port 443 (#0)
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /usr/local/anaconda3/ssl/cacert.pem
    CApath: none
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  • TLSv1.2 (IN), TLS handshake, Server finished (14):
  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  • TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  • TLSv1.2 (OUT), TLS handshake, Finished (20):
  • TLSv1.2 (IN), TLS handshake, Finished (20):
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  • ALPN, server did not agree to a protocol
  • Server certificate:
  • subject: C=JP; ST=Osaka; O=DAIKIN INDUSTRIES, LTD; CN=015F4441494B494E00000043001C5ECF.svr
  • start date: Mar 8 12:28:31 2019 GMT
  • expire date: Feb 12 12:28:31 2119 GMT
  • issuer: C=JP; ST=Osaka; O=DAIKIN INDUSTRIES, LTD; CN=CA.daikindev.com
  • SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.

GET /aircon/get_model_info HTTP/1.1
Host: 192.168.1.68
User-Agent: curl/7.65.3
Accept: /
X-Daikin-uuid: 5ae4284c944240f9b3c5bab219b72467

  • Mark bundle as not supporting multiuse
  • HTTP 1.0, assume close after body
    < HTTP/1.0 200 OK
    < Content-Length: 281
    < Content-Type: text/plain
    <
  • Closing connection 0
  • TLSv1.2 (OUT), TLS alert, close notify (256):
    ret=OK,model=0D89,type=C,pv=2,cpv=2,cpv_minor=00,mid=NA,humd=0,s_humd=0,acled=0,land=0,elec=0,temp=1,temp_rng=0,m_dtct=1,ac_dst=--,disp_dry=0,dmnd=0,en_scdltmr=1,en_frate=1,en_fdir=1,s_fdir=3,en_rtemp_a=0,en_spmode=0,en_ipw_sep=0,en_mompow=0,en_patrol=0,en_fdir2=0,en_filter_sign=0%`

However, the plugin still gives us an error trying to request for the common_info:

(node:762) UnhandledPromiseRejectionWarning: RequestError: Error: Invalid URI "192.168.1.68/aircon/get_model_info" at new RequestError (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/lib/errors.js:14:15) at Request.plumbing.callback (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/lib/plumbing.js:87:29) at Request.RP$callback [as _callback] (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/lib/plumbing.js:46:31) at self.callback (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/request.js:185:22) at Request.emit (events.js:310:20) at Request.init (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/request.js:273:17) at Request.RP$initInterceptor [as init] (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request-promise-core/configure/request2.js:45:29) at new Request (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/request.js:127:8) at request (/homebridge/node_modules/homebridge-daikin-unofficial/node_modules/request/index.js:53:10) at DaikinApi.getModelInfo (/homebridge/node_modules/homebridge-daikin-unofficial/dist/index.js:88:32) at DaikinAccessory.getModelInfo (/homebridge/node_modules/homebridge-daikin-unofficial/dist/index.js:274:42) at new DaikinAccessory (/homebridge/node_modules/homebridge-daikin-unofficial/dist/index.js:266:14) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:308:29) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:91:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1156:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) at Module.load (internal/modules/cjs/loader.js:1000:32) at Function.Module._load (internal/modules/cjs/loader.js:899:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 (node:762) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:762) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is the request properly done in https?

atr00 commented

Solved by adding https:// in front of the IP in the config.json file.