homebridge-gree-ac 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.3] - 2024-11-05
4
+
5
+ **<ins>Reminder:</ins> New (v2) network encryption protocol supported since v2.1.0**
6
+
7
+ When upgrading from v2.0.0 - v2.1.1 to v2.1.2 or later configuration settings should be updated.
8
+
9
+ #### Updated dependencies
10
+ - added Node.js v22 to supported versions (18.15.0 or later, 20.7.0 or later and 22.0.0 or later are supported)
11
+
12
+ ### New features
13
+ - new optional IP address parameter to support devices on different subnets
14
+ - new optional device port parameter to support cases when automatic port assigment is not appropriate
15
+
16
+ ### Fixes
17
+ - consistent xFan default setting in configuration UI and in plugin behaviour
18
+
19
+ ## [2.1.2] - 2024-10-01
20
+
21
+ **<ins>Reminder:</ins> New (v2) network encryption protocol supported since v2.1.0**
22
+
23
+ When upgrading from v2.0.0 - v2.1.1 to v2.1.2 configuration settings should be updated.
24
+
25
+ #### Configuration update steps
26
+
27
+ - <ins>Recommended:</ins> Using the graphical user interface of Homebridge ([Homebridge Config UI X](https://www.npmjs.com/package/homebridge-config-ui-x))
28
+ 1) Open plugin configuration
29
+ 1) Review and update settings if needed
30
+ 1) Save changes _(pressing the Save button is required to update the configuration to new version even if no changes needed in the displayed values)_
31
+ 1) Restart Homebridge
32
+ - **OR** <ins>Alternative:</ins> Edit the configuration file directly
33
+ 1) Remove the following parameters from the platform section:
34
+ - port _(it may be kept if you want to set the UDP port manually)_
35
+ - scanAddress
36
+ - scanCount
37
+ - scanTimeout
38
+ 1) Optionally you can add the following parameter to the platform section:
39
+ - scanInterval _(default is 60 if missing, needed only if other value required)_
40
+ 1) Save changes
41
+ 1) Restart Homebridge
42
+
43
+ #### Updated dependencies
44
+ - homebridge-config-ui-x 4.59.0 or later required
45
+ - added homebridge 2.0.0-beta.0 and later to supported versions
46
+
47
+ ### New features
48
+
49
+ - Simplified configuration
50
+ - Broadcast address not needed any more
51
+ - UDP port is optional
52
+ - Scan count and scan timeout replaced with scan interval parameter
53
+ - AC units can have dynamic addresses
54
+
55
+ ### Fixes
56
+
57
+ - Fixed "Failed to save cached accessories to disk: Converting circular structure to JSON" error
58
+
3
59
  ## [2.1.1] - 2024-06-25
4
60
 
5
61
  **New (v2) network encryption protocol supported since v2.1.0**
package/README.md CHANGED
@@ -6,35 +6,39 @@
6
6
  > _*** Breaking changes ***_
7
7
  >
8
8
  > Please read the [**Upgrade section**](#upgrade) before upgrading from version earlier than **v2.0.0** !
9
+ >
10
+ > _It is also recommended to read the upgrade section before any upgrade. It contains useful information regarding the latest version._
9
11
 
10
12
  # Homebridge GREE Air Conditioner Platform Plugin
11
13
 
12
- [Homebridge GREE Air Conditioner Platform Plugin](https://github.com/eibenp/homebridge-gree-airconditioner) is a dynamic platform plugin for [Homebridge](https://github.com/homebridge/homebridge) which allows control of GREE Air Conditioner devices from [Apple's Home App](https://www.apple.com/home-app/). (Make GREE Air Conditioner HomeKit compatible.)
14
+ [Homebridge GREE Air Conditioner Platform Plugin](https://github.com/eibenp/homebridge-gree-airconditioner) is a dynamic platform plugin for [Homebridge](https://github.com/homebridge/homebridge) which allows control of GREE Air Conditioner devices from [Apple's Home App](https://www.apple.com/home-app/). (Makes GREE Air Conditioner HomeKit compatible.)
13
15
 
14
- You can add all of your GREE Air Conditioner devices to the Home App by specifying the network broadcast address, and Homebridge will find all connected devices. Each device appears in the Home App as a Heater Cooler device. It is also possible to add a separate Termperature Sensor (if temperature sensor is supported by the physical device). This allows to define automations (e.g. turn on) based on current temperature in the room. Be careful, if the device does not support internal temperature sensor but is added as a separate accessory, Home App will display the target temperature not the measured one. Child accessory does not appear in Home App if physical sensor is not available in the AC unit.
16
+ You can add all of your GREE Air Conditioner devices to the Home App by specifying the device's MAC address, and Homebridge will find all connected devices. Each device appears in the Home App as a Heater Cooler device. It is also possible to add a separate Termperature Sensor (if temperature sensor is supported by the physical device). This allows to define automations (e.g. turn on) based on current temperature in the room. Be careful, if the device does not support internal temperature sensor but is added as a separate accessory, Home App will display the target temperature not the measured one. Child accessory does not appear in Home App if physical sensor is not available in the AC unit.
15
17
 
16
18
  Quiet / Auto / Powerful mode is supported by the fan speed control. Zero means off. Minimum value turns on Quiet mode. Next value is Auto mode. Maximum value is Powerful mode. All other values between them are exact fan speeds (Low, MediumLow**, Medium, MediumHigh**, High)
17
19
 
18
20
  ** these values are supported only on 5-speed models
19
21
 
20
- You have to add all devices to the Homebridge configuration, so that you can control all their parameters. If you don't want to control all of the devices in Home App, then you need to add to the configuration and disable the ones you don't need. Devices are identified by MAC Address (Serial Number). It can be queried using the official [GREE+ mobile app](https://apps.apple.com/us/app/gree/id1167857672). (The app is required to connect the devices to the local WiFi network for the first time.)
22
+ You have to add all devices to the Homebridge configuration. Devices are identified by MAC Address (Serial Number). It can be queried using the official [GREE+ mobile app](https://apps.apple.com/us/app/gree/id1167857672). (The app is required to connect the devices to the local WiFi network for the first time.) If an AC unit's MAC address is not added to the configuration then it will be skipped by the plugin. You can also skip a device by adding it to the configuration and setting the "disabled" parameter to true. _(This is useful if you want to temporarily remove the device but you want to keep it's parameters, e.g. changing the name is not possible without removal.)_
21
23
 
22
24
  xFan function is also supported, but it works automatically if enabled in Homebridge configuration. If xFan is enabled for the device, it is automatically turned on when you select a supported operating mode in Home App. If xFan is disabled, the Home App will not modify its actual setting in any case.
23
25
 
24
26
  Temperature display units of the physical device can be controlled using the Home App. (Configuration settings are required to be specified always in Degrees Celsius, independently from the display units.)
25
27
 
26
- Vertical swing mode can be turned on/off, but special swing settings can't be controlled using the Home App. If device default vertical swing position is not acceptable in disabled swing mode it can be overridden to a pre selected position by configuration settings. (Only default position is overridden when this feature is enabled. Other positions selected by remote control are kept and not modified by Home App.)
28
+ Vertical swing mode can be turned on/off, but special swing settings can't be controlled using the Home App. If device default vertical swing position is not acceptable in disabled swing mode, it can be overridden to a pre selected position by configuration settings. (Only default position is overridden when this feature is enabled. Other positions selected by remote control are kept and not modified by Home App. The AC unit may keep the actual vertical swing position on turning off oscillation in Home App.)
27
29
 
28
30
  This plugin is designed to be as simple and clear as possible and supports primarily the functions of the Home App's Heater Cooler accessory.
29
31
 
30
32
  ## Requirements
31
33
 
32
- * Node.js (>= 18.15.0 || >= 20.8.0) with NPM
33
- * Homebridge (>= 1.8.0)
34
+ * Node.js (>= 18.15.0 || >= 20.7.0 || >= 22.0.0) with NPM
35
+ * Homebridge (>= 1.8.0 || >= 2.0.0-beta.0)
36
+
37
+ The plugin finds all supported units automatically if they are located on the same subnet but controls only those which MAC address is added to the configuration. AC units on different subnets are also supported if the unit's IP address is set in the configuration. (MAC address have to be set correctly in this case also.)
34
38
 
35
- You need to specify the local network broadcast address (192.168.1.255 in many home environments) and it is also recommended to add the device and specify its MAC address (Serial Number) in the configuration file. Homebridge and all AC units have to be on the same subnet.
39
+ IPv4 address is required. GREE Air Conditioners do not support IPv6 nor other network protocols.
36
40
 
37
- It is highly recommended to use static IP addresses for connected devices. Using a dynamic IP address may require a restart of the Homebridge service on an address change to reconnect the device. Most routers offer static DHCP leases. (Please look at your router's documentation!)
41
+ This is not plugin dependency but its good to know that Homebridge server host address must be static. If the host address changes Homebridge looses connection with Home App and only Homebridge restart restores the connection.
38
42
 
39
43
  ## Supported devices
40
44
 
@@ -44,7 +48,7 @@ It is highly recommended to use static IP addresses for connected devices. Using
44
48
 
45
49
  > If you get _"error:1C80006B:Provider routines::wrong final block length"_ error message then your device is not supported.
46
50
  >
47
- > If you get _"Device not bound:..."_ warning message then your device is not supported.
51
+ > If you don't get _"Device is bound ..."_ message within a few minutes after Homebridge startup and the correct MAC address is added to the configuration and the AC unit is accessible on the network then your device is not supported.
48
52
 
49
53
  By default this plugin tries to auto detect the network protocol encryption version. If not the right version is selected there can get errors and the AC device will not correctly work. It is possible to force a network protocol encryption version in configuration file. If auto detection does not work then it is recommended to try all possible values to check if the device is compatible or not.
50
54
 
@@ -60,7 +64,6 @@ This plugin was designed to support the Home App's Heater Cooler functionality u
60
64
  * Not all half a degree values are supported in °C mode (GREE AC units are designed to support only integer °C and °F values). Unsupported values are automatically updated to the nearest supported values.
61
65
  * There is no way to get current heating-cooling state from the AC unit in auto mode, so displayed state in the Home App is based on temperature measurement, but internal sensor is not precise enough to always display the correct state.
62
66
  * Cooling / Heating temperature threshold limits (minimum and maximum values) can only be set in active cooling / heating mode. So the gauge in Home App may show invalid minimum and maximum values for the first use of cooling and heating modes. If so please restart Home App. Next time the correct values will be displayed.
63
- * Homebridge and AC unit on different subnets is a not supported configuration.
64
67
  * Devices without a built-in temperature sensor display the target temperature as current temperature not the measured one. (Some AC firmware versions do not report the measured temperature but the unit has a built-in sensor. They are handled by the plugin as devices without a sensor.)
65
68
 
66
69
  ## Installation instructions
@@ -75,15 +78,39 @@ If successfully installed and configured, your devices will appear on the Homebr
75
78
 
76
79
  ## Upgrade
77
80
 
81
+ ### v2.0.0 - v2.1.1 to v2.1.2 or later
82
+
83
+ The upgrade is automatic by installing the latest version but configuration settings should be updated.
84
+
85
+ #### Configuration update steps
86
+
87
+ - <ins>Recommended:</ins> Using the graphical user interface of Homebridge ([Homebridge Config UI X](https://www.npmjs.com/package/homebridge-config-ui-x))
88
+ 1) Open plugin configuration
89
+ 1) Review and update settings if needed
90
+ 1) Save changes _(pressing the Save button is required to update the configuration to new version even if no changes needed in the displayed values)_
91
+ 1) Restart Homebridge
92
+ - **OR** <ins>Alternative:</ins> Edit the configuration file directly
93
+ 1) Remove the following parameters from the platform section:
94
+ - port _(it may be kept if you want to set the UDP port manually)_
95
+ - scanAddress
96
+ - scanCount
97
+ - scanTimeout
98
+ 1) Optionally you can add the following parameter to the platform section:
99
+ - scanInterval _(default is 60 if missing, needed only if other value required)_
100
+ 1) Save changes
101
+ 1) Restart Homebridge
102
+
103
+ ### v1.x.x to v2.0.0 or later
104
+
78
105
  There is no clean way to update the plugin to release v2.0.0 or later if you are using an older version (v1.x.x). You need to remove and reinstall the plugin during upgrade.
79
106
 
80
- ### Upgrade steps
107
+ #### Upgrade steps
81
108
 
82
- 1. Check out your current settings in Homebridge and also in Homekit (including scenes and automation rules)
109
+ 1. Check out your current settings in Homebridge and also in Home App (including scenes and automation rules)
83
110
  2. Uninstall the old version (this will remove all settings also)
84
111
  3. Install the new version
85
112
  4. Configure plugin in Homebridge
86
- 5. Assign accessories to rooms and recreate scenes and automations in Homekit
113
+ 5. Assign accessories to rooms and recreate scenes and automations in Home App
87
114
 
88
115
  ## Example configuration
89
116
  _Only the relevant part of the configuration file is displayed:_
@@ -93,22 +120,22 @@ _Only the relevant part of the configuration file is displayed:_
93
120
  "name": "Gree Air Conditioner",
94
121
  "platform": "GREEAirConditioner",
95
122
  "port": 7002,
96
- "scanAddress": "192.168.1.255",
97
- "scanCount": 5,
98
- "scanTimeout": 10,
123
+ "scanInterval": 60,
99
124
  "devices": [
100
125
  {
101
126
  "mac": "502cc6000000",
102
127
  "name": "Living room AC",
128
+ "ip": "192.168.1.2",
129
+ "port": 7003
130
+ "statusUpdateInterval": 10,
131
+ "encryptionVersion": 0,
103
132
  "model": "Pulse 3.2kW GWH12AGB-K6DNA1A/I",
104
133
  "speedSteps": 5,
105
- "encryptionVersion": 0,
106
- "statusUpdateInterval": 10,
107
- "sensorOffset": 40,
108
134
  "minimumTargetTemperature": 16,
109
135
  "maximumTargetTemperature": 30,
110
- "xFanEnabled": true,
136
+ "sensorOffset": 40,
111
137
  "temperatureSensor": "disabled",
138
+ "xFanEnabled": true,
112
139
  "overrideDefaultVerticalSwing": 0,
113
140
  "defaultVerticalSwing": 0,
114
141
  "disabled": false
@@ -117,27 +144,31 @@ _Only the relevant part of the configuration file is displayed:_
117
144
  }
118
145
  ]
119
146
  ```
147
+ _It's not recommended to add the port and ip parameters. The above example contains them but only for showing all optional parameters also._
148
+
120
149
  * name - Unique name of the platform plugin
121
150
  * platform - **GREEAirConditioner** (fixed name, it identifies the plugin)
122
- * port - free UDP port (homebridge will use this port for network communication; it is recommended to select a port which is not used and the next 256 ports are also available because devices will be bound to a separate port based on the last part of the device's IPv4 address and the port specified in the configuration; valid values: 1025 - 65279)
123
- * scanAddress - local network broadcast address (some network knowledge is required to determine this address; in many cases its default value is 192.168.1.255)
124
- * scanCount - number of retries for locating devices on the network (minimum 3 retries have to be specified)
125
- * scanTimeout - time period in seconds between device query retries
151
+ * port - free UDP port (optional) (plugin will use this port for network communication; valid values: 1025 - 65535) **Do not specify a port unless you have trouble with automatic port assignment!**
152
+ * scanInterval - time period in seconds between device query retries (defaults to 60 sec if missing)
126
153
  * devices - devices should be listed in this block (specify as many devices as you have on your network)
127
- * mac - MAC address (Serial Number) of the device
128
- * name - custom name of the device (optional)
129
- * model - model name, information only (optional)
130
- * speedSteps - fan speed steps of the unit (valid values are: 3 and 5)
131
- * encryptionVersion - Auto (0) is fine for most AC units. If auto does not work then you can force v1 (1) or v2 (2) encryption version to use in network communication
132
- * statusUpdateInterval - device status will be refreshed based on this interval (in seconds)
133
- * sensorOffset - device temperature sensor offset value for current temperature calibration (default is 40 °C, must be specified in °C)
134
- * minimumTargetTemperature - minimum target temperature accepted by the device (default is 16 °C, must be specified in °C, valid values: 16-30)
135
- * maximumTargetTemperature - maximum target temperature accepted by the device (default is 30 °C, must be specified in °C, valid values: 16-30)
136
- * xFanEnabled - automatically turn on xFan functionality in supported device modes (xFan actual setting is not modified by the Home App if disabled)
137
- * temperatureSensor - control additional temperature sensor accessory in Home App (disabled = do not add to Home App / child = add as a child accessory / separate = add as a separate (independent) accessory)
138
- * overrideDefaultVerticalSwing - by default this plugin does not change the vertical swing position of the AC unit but some devices do not keep the original vertical position set by the remote control if controlled from Homebridge and return back to device default position; this setting allows to override the default position -> if AC unit is set to default vertical swing position Homebridge modifies it to a predefined position (set by defaultVerticalSwing) (Never (0) = turn off override, let device use default / After power on (1) = override default position on each power on / After power on and swing disable (2) = override default position on each power on and each time when swing is switched to disabled)
139
- * defaultVerticalSwing - specify the vertical swing position to be used instead of device default when overriding is enabled (Device default (0) = use device default, same position as used by device by default without overriding / one of the following 5 positions: fixed Highest (2), fixed Higher (3), fixed Middle (4), fixed Lower (5), fixed Lowest (6))
140
- * disabled - set to true if you do not want to control this device in the Home App (old devices can be removed using this parameter)
154
+ * mac - MAC address (Serial Number) of the device
155
+ * name - custom name of the device (optional) Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis.
156
+ * ip - device IP address (optional) Address is auto detected if this parameter is missing. **Specify only if device is located on a different subnet then homebridge!**
157
+ * port - free UDP port (optional) (plugin will listen on this port for data received from the device; valid values: 1025 - 65535) **Do not specify a port unless you have trouble with automatic port assignment!**
158
+ * statusUpdateInterval - device status will be refreshed based on this interval (in seconds)
159
+ * encryptionVersion - Auto (0) is fine for most AC units. If auto does not work then you can force v1 (1) or v2 (2) encryption version to use in network communication
160
+ * model - model name, information only (optional)
161
+ * speedSteps - fan speed steps of the unit (valid values are: 3 and 5)
162
+ * minimumTargetTemperature - minimum target temperature accepted by the device (default is 16 °C, must be specified in °C, valid values: 16-30)
163
+ * maximumTargetTemperature - maximum target temperature accepted by the device (default is 30 °C, must be specified in °C, valid values: 16-30)
164
+ * sensorOffset - device temperature sensor offset value for current temperature calibration (default is 40 °C, must be specified in °C)
165
+ * temperatureSensor - control additional temperature sensor accessory in Home App (disabled = do not add to Home App / child = add as a child accessory / separate = add as a separate (independent) accessory)
166
+ * xFanEnabled - automatically turn on xFan functionality in supported device modes (xFan actual setting is not modified by the Home App if disabled)
167
+ * overrideDefaultVerticalSwing - by default this plugin does not change the vertical swing position of the AC unit but some devices do not keep the original vertical position set by the remote control if controlled from Homebridge and return back to device default position; this setting allows to override the default position -> if AC unit is set to default vertical swing position Homebridge modifies it to a predefined position (set by defaultVerticalSwing) (Never (0) = turn off override, let device use default / After power on (1) = override default position on each power on / After power on and swing disable (2) = override default position on each power on and each time when swing is switched to disabled)
168
+ * defaultVerticalSwing - specify the vertical swing position to be used instead of device default when overriding is enabled (Device default (0) = use device default, same position as used by device by default without overriding / one of the following 5 positions: fixed Highest (2), fixed Higher (3), fixed Middle (4), fixed Lower (5), fixed Lowest (6))
169
+ * disabled - set to true if you do not want to control this device in the Home App _(can be used also to temporarily remove the device from Home App but not if the device is not responding any more on the network)_
170
+
171
+ Recommended configuration:
141
172
 
142
173
  ![Homebridge UI](./uiconfig.jpg)
143
174
 
@@ -149,25 +180,19 @@ Open selected device and in the upper right corner select menu symbol:
149
180
 
150
181
  ![AC device](./greedevice.jpg)![MAC Address](./greemac.jpg)
151
182
 
152
- ### Network broadcast address
183
+ ### MAC address alternative detection method
153
184
 
154
- All devices on the local network use the same broadcast address. The broadcast address can be calculated from the IP address and the subnet mask of any device which is connected to the LAN. (E.g. your router or computer) You can find several online calculators which help to determine the broadcast address.
185
+ If you are not familiar with the GREE+ mobile app there is an alternative method to detect the MAC address of your devices:
155
186
 
156
- On Unix-like systems you can query the broadcast address using the following command:
157
- ```bash
158
- ifconfig | grep broadcast
159
- # result
160
- # inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
161
- ```
162
- On Windows there is no easy way to read the broadcast address. You can query the IP address and the subnet mask using the following command:
163
- ```cmd
164
- ipconfig
165
- # result
166
- # IPv4 Address. . . . . . . . . . . : 192.168.1.10
167
- # Subnet Mask . . . . . . . . . . . : 255.255.255.0
168
- # Default Gateway . . . . . . . . . : 192.168.1.254
169
- ```
170
- You have to calculate the broadcast address from the IP address and the Subnet mask.
187
+ - Install the plugin
188
+ - Do not configure AC unit devices
189
+ - (Re)start Homebridge
190
+ - GREE Air Conditioner Platform Plugin will auto detect all accessible devices and write an entry to the log
191
+ - The log entry contains the MAC address of the device E.g.: MAC address is 502cc6000000 in the following log entry:
192
+
193
+ > Accessory **502cc6000000** not configured - skipped
194
+
195
+ Unfortunaltely if you have multiple devices you will not know which MAC address belongs to which AC unit. In this case you have to test it. This may require some adding - removal - re-adding cycle before final configuration.
171
196
 
172
197
  ### Device settings
173
198
 
@@ -179,17 +204,30 @@ Some settings are initialized by Home App only once (when enabling the device).
179
204
 
180
205
  All other settings are applied when starting up Homebridge. You have to restart Homebridge to apply changes in configuration settings.
181
206
 
207
+ ### IP address
208
+
209
+ IP addresses of the AC units are determined automatically by the plugin. However this auto detection works only if the AC unit is on the same subnet as homebridge. There is an optional IP address parameter which can be used to specifiy the unit's IP address if it is on a different subnet. (Routing should be correctly set up to communicate with units on different subnets.)
210
+
211
+ ### Port
212
+
213
+ Network communication uses UDP ports. There are two kind of ports:
214
+
215
+ - Plugin port. This port is used by the plugin to communicate on the network.
216
+ - Device specific port. The plugin is listening for data received from the device using this port.
217
+
218
+ All ports are set up automatically by default. In some cases auto detection is not appropriate. (E.g. when firewall rules should be set up) It is possible to overwrite the default ports by optional port parameters (for the plugin and also for each devices).
219
+
182
220
  ### Temperature display units
183
221
 
184
222
  Home App allows to set the device temperature display units but it is independent from the temperature units shown in Home App. Home App always displays temperature values as specified by iOS/MacOS (can be changed in Preferences / Regional settings section). Display unit conversion is made by the Home App device (e.g. iPhone).
185
223
 
186
224
  ### Temperature measurement
187
225
 
188
- Temperature measurement is not perfect if using the built-in sensor. It is highly affected by current operation and can differ from actual temperature of other places in the room. It is recommended to use a sperarate temperature sensor and place it not too close to the AC unit if you plan to set up automations based on temperature values.
226
+ Temperature measurement is not perfect if using the built-in sensor. It is highly affected by current operation and can differ from actual temperature of other places in the room. It is recommended to use a sperarate HomeKit compatible temperature sensor and place it not too close to the AC unit if you plan to set up automations based on temperature values.
189
227
 
190
228
  ### Invalid room temperature
191
229
 
192
- Some AC units have a built-in temperature sensor but the actual room temperature is not displayed in Home App. This is an AC firmware problem. Older firware versions do not report temperature values at all and there are some firmware versions which report a fixed value (e.g. zero) instead of the measured one. This plugin replaces the missing value and the fixed zero value by the desired target temperature. To get the correct measured temperature please try to upgrade or downgrade the AC firmware.
230
+ Some AC units have a built-in temperature sensor but the actual room temperature is not displayed in Home App. This is an AC firmware problem. Older firmware versions do not report temperature values at all and there are some firmware versions which report a fixed value (e.g. zero) instead of the measured one. This plugin replaces the missing value and the fixed zero value by the desired target temperature. To get the correct measured temperature please try to upgrade or downgrade the AC firmware.
193
231
 
194
232
  ### Fan speed
195
233
 
@@ -201,6 +239,47 @@ Slider description: Zero means off. Minimum value turns on Quiet mode. Next valu
201
239
 
202
240
  ** these values are supported only on 5-speed models
203
241
 
242
+ ### Accessory removal
243
+
244
+ If an AC unit is still working and accessible on the network you can remove the associated accessory by setting the device's "disabled" parameter to true and restarting Homebridge.
245
+
246
+ If you need to remove an old AC unit which is not accessible any more (e.g hardware failure or device was replaced with a new one) you need to use the graphical user interface of Homebridge ([Homebridge Config UI X](https://www.npmjs.com/package/homebridge-config-ui-x)). Follow these steps:
247
+ 1) Open Homebridge GUI
248
+ 1) Go to Settings page
249
+ 1) Go to Accessories section
250
+ 1) Select Remove Single Accessory
251
+ 1) Search for the accessory to be removed in list
252
+ 1) Click on the waste icon of the selected accessory
253
+
254
+ On some platforms the graphical user interface of Homebridge does not support accessory removal. In this case you have to remove and reinstall the plugin to remove a deprecated accessory or you need to manually edit the cache file (it requires advanced Homebridge technical knowledge).
255
+
256
+ ### Troubleshouting
257
+
258
+ Most known errors are fixed by later versions. If so yo can upgrade to the latest version and it will solve the problem. Some errors may require some additional steps.
259
+
260
+ #### "Failed to save cached accessories to disk: Converting circular structure to JSON" error
261
+
262
+ This error is fixed in v2.1.2 and later. First upgrade the plugin to the latest version and restart Homebridge twice. Wait a few minutes between restarts. If it does not solve the problem follow these steps:
263
+
264
+ 1) Uninstall the plugin (and remove the child bridge if a dedicated child bridge was added)
265
+ 1) Go through all cached accessories and delete every instance of accessories created by this plugin:
266
+ - Homebridge GUI > Settings page
267
+ - Accessories section > Remove Single Accessory
268
+ - Click the waste icon of the selected accessory
269
+ 1) Restart Homebridge
270
+ 1) Install the latest version of the plugin
271
+ 1) Configure the plugin
272
+
273
+ Do not try to restore Homebridge configuration from backup because this error means that the cached configuration is corrupt and all the backups contain also the corrupt configuration! Restoring settings from backup will restore the error also.
274
+
275
+ #### Unusual behaviour
276
+
277
+ Check if you are using the correct version of configuration settings. It is always recommended to open and save the actual configuration settings using the graphical user interface of Homebridge. Pressing the Save button on the GUI automatically converts the configuration settings to the actual version. It is useful to re-save the configuration after each upgrade or downgrade even if there are no visible changes in the parameters.
278
+
279
+ #### Device not responding
280
+
281
+ If an AC unit device is not supported it may be added successfully to the Home App as an accessory but never appears the "Device is bound ..." message in the Homebridge log. Unbound devices can't respond to network requests so they are unresponsive in Home App. There is no way to decide if the unresponsive device is only turned off (no AC power) or it has a not supported firmware version. It means that a missing error message does not mean that the device is supported. You can check the Homebrdige log. All supported devices write a "Device is bound ..." message into the Homebridge log after successful configuration upon Homebridge startup.
282
+
204
283
  ## Refs & Credits
205
284
 
206
285
  Special thanks to [tomikaa87](https://github.com/tomikaa87) and [kongkx](https://github.com/kongkx) for GREE network protocol information and code samples. Thank you [mateuszm7](https://github.com/mateuszm7) and [zivanek](https://github.com/zivanek) for helping to implement the version 2 network protocol.
@@ -12,27 +12,14 @@
12
12
  },
13
13
  "port": {
14
14
  "type": "integer",
15
- "required": true,
16
- "default": 7002,
15
+ "required": false,
17
16
  "minimum": 1025
18
17
  },
19
- "scanAddress": {
20
- "type": "string",
21
- "required": true,
22
- "default": "192.168.1.255",
23
- "format": "ipv4"
24
- },
25
- "scanCount": {
26
- "type": "integer",
27
- "required": true,
28
- "default": 10,
29
- "minimum": 3
30
- },
31
- "scanTimeout": {
18
+ "scanInterval": {
32
19
  "type": "integer",
33
- "required": true,
34
- "default": 3,
35
- "minimum": 1
20
+ "required": false,
21
+ "default": 60,
22
+ "minimum": 5
36
23
  },
37
24
  "devices": {
38
25
  "type": "array",
@@ -75,28 +62,28 @@
75
62
  "type": "integer",
76
63
  "required": false,
77
64
  "minimum": 1,
78
- "default": 10
65
+ "placeholder": 10
79
66
  },
80
67
  "sensorOffset": {
81
68
  "type": "integer",
82
69
  "required": false,
83
- "default": 40
70
+ "placeholder": 40
84
71
  },
85
72
  "minimumTargetTemperature": {
86
73
  "type": "integer",
87
74
  "required": false,
88
75
  "minimum": 16,
89
- "default": 16
76
+ "placeholder": 16
90
77
  },
91
78
  "maximumTargetTemperature": {
92
79
  "type": "integer",
93
80
  "required": false,
94
81
  "maximum": 30,
95
- "default": 30
82
+ "placeholder": 30
96
83
  },
97
84
  "xFanEnabled": {
98
85
  "type": "boolean",
99
- "default": false
86
+ "default": true
100
87
  },
101
88
  "temperatureSensor": {
102
89
  "type": "string",
@@ -218,6 +205,16 @@
218
205
  ]
219
206
  }
220
207
  ]
208
+ },
209
+ "port": {
210
+ "type": "integer",
211
+ "required": false,
212
+ "minimum": 1025
213
+ },
214
+ "ip": {
215
+ "type": "string",
216
+ "required": false,
217
+ "format": "ipv4"
221
218
  }
222
219
  }
223
220
  }
@@ -233,28 +230,17 @@
233
230
  "type": "flex",
234
231
  "flex-flow": "row wrap",
235
232
  "items": [
236
- {
237
- "key": "scanAddress",
238
- "flex": "1 1 50%",
239
- "title": "Scan address:",
240
- "description": "Local network broadcast address"
241
- },
242
233
  {
243
234
  "key": "port",
244
235
  "flex": "1 1 50%",
245
- "title": "Port:"
236
+ "title": "Port:",
237
+ "description": "Platform level UDP port (auto if empty)"
246
238
  },
247
239
  {
248
- "key": "scanCount",
240
+ "key": "scanInterval",
249
241
  "flex": "1 1 50%",
250
- "title": "Scan count:",
251
- "description": "Initial device discovery retry count"
252
- },
253
- {
254
- "key": "scanTimeout",
255
- "flex": "1 1 50%",
256
- "title": "Scan timeout:",
257
- "description": "Timeout in seconds between device discovery retries"
242
+ "title": "Scan interval:",
243
+ "description": "Interval in seconds between device discovery retries (60 sec if empty)"
258
244
  }
259
245
  ]
260
246
  },
@@ -281,7 +267,7 @@
281
267
  "key": "devices[].name",
282
268
  "flex": "1 1 50%",
283
269
  "title": "Device name:",
284
- "description": "Custom name of the device"
270
+ "description": "Custom name of the device. Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis."
285
271
  },
286
272
  {
287
273
  "key": "devices[].disabled",
@@ -293,17 +279,19 @@
293
279
  }
294
280
  },
295
281
  {
296
- "key": "devices[].model",
282
+ "key": "devices[].ip",
297
283
  "flex": "1 1 50%",
298
- "title": "Device model:",
284
+ "title": "IP address:",
285
+ "description": "Device IP address (auto if empty)",
299
286
  "condition": {
300
287
  "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
301
288
  }
302
289
  },
303
290
  {
304
- "key": "devices[].speedSteps",
291
+ "key": "devices[].port",
305
292
  "flex": "1 1 50%",
306
- "title": "Fan speed steps:",
293
+ "title": "Port:",
294
+ "description": "Device specific UDP port (auto if empty)",
307
295
  "condition": {
308
296
  "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
309
297
  }
@@ -326,6 +314,22 @@
326
314
  "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
327
315
  }
328
316
  },
317
+ {
318
+ "key": "devices[].model",
319
+ "flex": "1 1 50%",
320
+ "title": "Device model:",
321
+ "condition": {
322
+ "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
323
+ }
324
+ },
325
+ {
326
+ "key": "devices[].speedSteps",
327
+ "flex": "1 1 50%",
328
+ "title": "Fan speed steps:",
329
+ "condition": {
330
+ "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
331
+ }
332
+ },
329
333
  {
330
334
  "key": "devices[].minimumTargetTemperature",
331
335
  "flex": "1 1 50%",
@@ -353,15 +357,6 @@
353
357
  "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
354
358
  }
355
359
  },
356
- {
357
- "key": "devices[].xFanEnabled",
358
- "flex": "1 1 50%",
359
- "title": "xFan enabled",
360
- "description": "If enabled, then xFan functionality is turned on automatically on the device",
361
- "condition": {
362
- "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
363
- }
364
- },
365
360
  {
366
361
  "key": "devices[].temperatureSensor",
367
362
  "flex": "1 1 50%",
@@ -372,7 +367,10 @@
372
367
  }
373
368
  },
374
369
  {
375
- "flex": "1 1 50%",
370
+ "key": "devices[].xFanEnabled",
371
+ "flex": "1 1 100%",
372
+ "title": "xFan enabled",
373
+ "description": "If enabled, then xFan functionality is turned on automatically on the device",
376
374
  "condition": {
377
375
  "functionBody": "return (model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].mac && /^[a-f0-9]{12}$/.test(model.devices[arrayIndices].mac) && model.devices[arrayIndices].disabled !== true);"
378
376
  }
@@ -1,5 +1,4 @@
1
1
  import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic } from 'homebridge';
2
- import { GreeAirConditioner } from './platformAccessory';
3
2
  /**
4
3
  * HomebridgePlatform
5
4
  * This class is the main constructor for your plugin, this is where you should
@@ -15,8 +14,7 @@ export declare class GreeACPlatform implements DynamicPlatformPlugin {
15
14
  private initializedDevices;
16
15
  private skippedDevices;
17
16
  private socket;
18
- private timer;
19
- private scanCount;
17
+ private pluginAddresses;
20
18
  constructor(log: Logger, config: PlatformConfig, api: API);
21
19
  /**
22
20
  * This function is invoked when homebridge restores cached accessories from disk at startup.
@@ -27,9 +25,11 @@ export declare class GreeACPlatform implements DynamicPlatformPlugin {
27
25
  * Accessories must only be registered once, previously created accessories
28
26
  * must not be registered again to prevent "duplicate UUID" errors.
29
27
  */
28
+ bindCallback(): void;
30
29
  discoverDevices(): void;
31
30
  handleMessage: (msg: any, rinfo: any) => void;
32
- registerDevice: (deviceInfo: any) => GreeAirConditioner | undefined;
31
+ registerDevice: (deviceInfo: any) => void;
33
32
  broadcastScan(): void;
33
+ getNetworkAddresses(): {};
34
34
  }
35
35
  //# sourceMappingURL=platform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AAGxI,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIzD;;;;GAIG;AACH,qBAAa,cAAe,YAAW,qBAAqB;aAaxC,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAd1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,kBAAkB,CAA0B;IACpD,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,SAAS,CAAS;gBAGR,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAqB1B;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAgB/C;;;OAGG;IACH,eAAe;IAyCf,aAAa,iCA2CX;IAEF,cAAc,sDAoGZ;IAEF,aAAa;CASd"}
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AAUxI;;;;GAIG;AACH,qBAAa,cAAe,YAAW,qBAAqB;aAYxC,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAb1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,kBAAkB,CAA0B;IACpD,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,eAAe,CAA8B;gBAGnC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAsC1B;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAe/C;;;OAGG;IACH,YAAY;IAQZ,eAAe;IAUf,aAAa,iCA4CX;IAEF,cAAc,4BA+IZ;IAEF,aAAa;IAiBb,mBAAmB;CAoDpB"}