arthurkrupa / gree-hvac-mqtt-bridge

MQTT Bridge for controlling Gree smart air conditioners, e.g. with Home Assistant or OpenHAB
GNU General Public License v3.0
134 stars 63 forks source link

bad decrypt #15

Closed majorcs closed 6 years ago

majorcs commented 6 years ago

Hi,

Thanks for this handy utility :) I managed to used it successfully with one of my AC, but then I enabled the WiFi on the second one, and the script can not start up any more. I get this traceback:

$ node index.js --mqtt-broker-url="mqtt://localhost" --mqtt-topic-prefix="home/greehvac" --hvac-host="192.168.88.255"
[MQTT] Connected to broker on mqtt://localhost
[UDP] Connected to device at 192.168.88.255
[UDP] New device registered: Nappali
[UDP] New device registered: Emelet
[UDP] Device Emelet is bound!
crypto.js:183
  var ret = this._handle.final();
                         ^

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
    at Decipheriv.final (crypto.js:183:26)
    at Object.decrypt (/home/major/Downloads/gree-hvac-mqtt-bridge/app/encryptionService.js:21:56)
    at Device._handleResponse (/home/major/Downloads/gree-hvac-mqtt-bridge/app/deviceFactory.js:150:40)
    at Socket.Device.socket.on (/home/major/Downloads/gree-hvac-mqtt-bridge/app/deviceFactory.js:47:51)
    at emitTwo (events.js:126:13)
    at Socket.emit (events.js:214:7)
    at UDP.onMessage [as onmessage] (dgram.js:659:8)

Does the script support more than one devices at the same time?

arthurkrupa commented 6 years ago

Unfortunately, multiple devices are not support at the moment. As a workaround, you can try to run multiple instances of the addon, as described here.