bstuff / haier-ac-remote

70 stars 15 forks source link

Question about uint16 / data structure #14

Open KoalaBear84 opened 3 years ago

KoalaBear84 commented 3 years ago

Thanks for providing your source code! It already helped me a lot in all the guesswork. I also guess you don't have any documentation about this, Already mailed them 2 weeks ago, but I didn't expect any reply, which is what you get :)

I'm trying to create an integration with Home Assistant.

Sorry for the long 'issue', I would really love to get some feedback / answers from your experience. I'm watching and logging all the bytes/bits for days, but still even with all the code it is hard to dissect / understand it.

In the parser.ts I see that you read all as uint16, if I'm correct? https://github.com/bstuff/haier-ac-remote/blob/master/packages/haier-ac-remote/src/lib/parsers.ts

I'm currently trying to dissect the datastructure in C#, which also has Uint16 (ushort): `The UInt16 value type represents unsigned integers with values ranging from 0 to 65535.

I ask/doubt this because it looks like the room temperature is in byte 102 in my model, and I also have to 'bitshift' 1 bit to the right.

Are you sure that all 'fields' should be uint16 (2 bytes per field)? I also can't find where the .uint16() method is coming from, can't find it from lodash or TypeScript.

For my model Haier Tundra 2.0 Single-split 5,0 kW I see that the state responses are always 127 bytes, and the 'connection' message is always 103 bytes, not sure what's in there. But I see other implementations having 75 bytes.

The connection is always lost after 15 seconds, I'm not sure if that is a problem with my current connection implementation, or that I need to send a keepalive message.

Sadly the only source I find is this repository. And I am quite experience in JavaScript, but it's a lot of code, and well 'minified' / compact / cryptic.

  1. Is there some sort of keepalive message
  2. Do you send the full 'state' if you want to change something?
  3. How did you get all the info?

** And could you add a readme.md file to this repository on which unit (and extra hardware, if used) that you have. So it will be more clear. Also some basic knowledge would be nice.