-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathREADME.hbs
99 lines (68 loc) · 3.35 KB
/
README.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Gree HVAC client
![NPM status](https://img.shields.io/npm/v/gree-hvac-client)
![Github Actions status](https://img.shields.io/github/actions/workflow/status/inwaar/gree-hvac-client/release.yml?label=release)
A client for communicating with Gree air conditioners.
## Requirements
- NodeJS (>=16)
## Installation
`yarn add gree-hvac-client`
or
`npm install --save gree-hvac-client`
## Simple usage
Set device properties:
```javascript
const Gree = require('gree-hvac-client');
const client = new Gree.Client({host: '192.168.7.60'});
client.on('connect', () => {
client.setProperty(Gree.PROPERTY.temperature, 25);
client.setProperty(Gree.PROPERTY.lights, Gree.VALUE.lights.off);
});
```
Poll device properties:
```javascript
const Gree = require('gree-hvac-client');
const client = new Gree.Client({host: '192.168.7.60'});
client.on('connect', (client) => {
console.log('connected to', client.getDeviceId());
});
client.on('update', (updatedProperties, properties) => {
console.log(updatedProperties, properties);
});
client.on('no_response', () => {
console.log('no response');
});
```
## Properties
| Command | Values | Description |
|-|-|-|
| **temperature** | any integer |In degrees Celsius by default |
| **currentTemperature** | any integer |In degrees Celsius by default. (Read-only) |
| **mode** | _auto_, _cool_, _heat_, _dry_, _fan_only_|Operation mode |
| **fanspeed** | _auto_, _low_, _mediumLow_, _medium_, _mediumHigh_, _high_ | Fan speed |
| **swinghor** | _default_, _full_, _fixedLeft_, _fixedMidLeft_, _fixedMid_, _fixedMidRight_, _fixedRight_ | Horizontal Swing |
| **swingvert** | _default_, _full_, _fixedTop_, _fixedMidTop_, _fixedMid_, _fixedMidBottom_, _fixedBottom_, _swingBottom_, _swingMidBottom_, _swingMid_, _swingMidTop_, _swingTop_ | Vertical swing |
| **power** | _off_, _on_ | Turn device on/off |
| **health** | _off_, _on_ | Health ("Cold plasma") mode, only for devices equipped with "anion generator", which absorbs dust and kills bacteria |
| **powersave** | _off_, _on_ | Power Saving mode |
| **lights** | _off_, _on_ | Turn on/off device lights |
| **quiet** | _off_, _mode1_, _mode2_, _mode3_ | Quiet modes |
| **blow** | _off_, _on_ | Keeps the fan running for a while after shutting down (also called "X-Fan", only usable in Dry and Cool mode) |
| **air** | _off_, _inside_, _outside_, _mode3_ | Fresh air valve |
| **sleep** | _off_, _on_ | Sleep mode |
| **turbo** | _off_, _on_ | Turbo mode |
## Configuring HVAC WiFi
1. Make sure your HVAC is running in AP mode. You can reset the WiFi config by pressing MODE +WIFI (or MODE + TURBO) on the AC remote for 5s.
2. Connect with the AP wifi network (the SSID name should be a 8-character alphanumeric, e.g. "u34k5l166").
3. Run the following in your UNIX terminal:
```shell
echo -n "{\"psw\": \"YOUR_WIFI_PASSWORD\",\"ssid\": \"YOUR_WIFI_SSID\",\"t\": \"wlan\"}" | nc -cu 192.168.1.1 7000
````
Note: This command may vary depending on your OS (e.g. Linux, macOS, CygWin). If facing problems, please consult the appropriate netcat manual.
## API Reference
{{>main}}
## License
This project is licensed under the GNU GPLv3 - see the [LICENSE](LICENSE) file for details
## Acknowledgments
- [tomikaa87](https://github.com/tomikaa87) for reverse-engineering the Gree protocol
- [oroce](https://github.com/oroce) for inspiration
- [arthurkrupa](https://github.com/arthurkrupa) for inspiration