GithubHelp home page GithubHelp logo

inwaar / gree-hvac-client Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 12.0 681 KB

Client for controlling Gree (and other compatible) smart air conditioners

License: GNU General Public License v3.0

JavaScript 100.00%
gree cooper hunter daitsu tosot ventilation heating air-conditioning

gree-hvac-client's Issues

Constants for properties

Now we have constants like Gree.VALUE.power.on which is equal to 1, but during polling process we are getting parameters in string representations.

For example

client.on('update', (updatedProperties, properties) => {
     ...
     const value = updatedProperties[Gree.PROPERTY.power] === 'on';
     ...
});

For now we need to use on string value.

Do we need to add constants for such values, what do you think?

'update' event not always triggered

Hi!

First, thank you a lot for your work!

So about the issue, the 'update' event is only triggered when I connect but after when I use setProperty or setProperties the event is never triggered (the property is set correctly on my Gree hvac).

But if I use the official app, the event is triggered.

Am I missing something ?

Emit noPollingResponse event when HVAC doesn't respond on polling

Hi

What do you think about adding noPollingResponse event (or something similar?) which can be emitted in case when HVAC doesn't respond to the polling request?

For example we have polling: true and pollingInterval: 3000.
Using setTimeout with pollingInterval*2 we emit noPollingResponse.

It allows library users to handle case when polling was not successful and mark device as offline (for example).

Any thoughts about this?

Error:1C800068:Provider routines: :Wrong final block

Error: error:1C80006B:Provider routines::wrong final block length
at Decipheriv.final (node:internal/crypto/cipher:193:29)
at EncryptionService.decrypt (C:\Users\xxxxxxxx.node-red\node_modules\gree-hvac-client\lib\encryption-service.js:43:42)
at Client._handleResponse (C:\Users\xxxxxxxx.node-red\node_modules\gree-hvac-client\lib\client.js:291:46)
at Socket. (C:\Users\xxxxxxxx.node-red\node_modules\gree-hvac-client\lib\client.js:113:52)
at Socket.emit (node:events:513:28)
at UDP.onMessage [as onmessage] (node:dgram:930:8)

I get this error when trying to connect to a gree Hi wall AC.

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt

Hey Igor ๐Ÿ‘‹

I've found that some users are getting Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt error in

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
  File "crypto.js", line 183, col 26, in Decipheriv.final
  File "/node_modules/gree-hvac-client/lib/encryption-service.js", line 43, col 42, in EncryptionService.decrypt
    return JSON.parse(str + decipher.final('utf8'))
  File "/node_modules/gree-hvac-client/lib/client.js", line 291, col 46, in Client._handleResponse
    const pack = this._encryptionService.decrypt(message);
  File "/node_modules/gree-hvac-client/lib/client.js", line 113, col 52, in Socket._socket.on.message
    this._socket.on('message', message => this._handleResponse(message));
  File "events.js", line 126, col 13, in emitTwo
  File "events.js", line 214, col 7, in Socket.emit
  File "dgram.js", line 659, col 8, in UDP.onMessage [as onmessage]

I'm not sure why it happens as I don't have any additional data (wrong encryption key? broken data?), but can we somehow handle this? I mean allow developers who uses this library handle such cases somehow. Because it's happening inside the library now.

connection device to local wifi issue

Hi! I'm trying to connect AC device to local wifi using the command from read me ( echo -n "{"psw": "pass","ssid": "ssid","t": "wlan"}" | nc -cu 192.168.1.1 7000 tee console.log
)
I reset AC's wifi config, connected to his wifi, and used the command
I get response {"t":"ret","r":200} (which indicates success), but cant find AC's mac address in devices connected to my wifi

  1. I've done it with official app and device connected with this wifi so I know it's possible, no problems with wifi, its 2.4, pass and ssid is correct
  2. i double checked that i connected to the right wifi when I was searching for my AC mac address
  3. i know his mac address because I've sent him get request via Python, when was connected to his wifi and got this response:
    {'t': 'dev', 'cid': '502cc6689819', 'bc': '', 'brand': 'gree', 'catalog': 'gree', 'mac': '502cc6689819', 'mid': '13000', 'model': 'gree', 'name': 'c6689819', 'series': 'gree', 'vender': '1', 'ver': 'V1.2.1', 'lock': 0}

maybe I'm doing smth wrong or you faced the same issue before and know the answer? i would be really thankful for any help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.