homebridge-midea-platform 0.4.12 → 1.0.0
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/.gitattributes +3 -0
- package/.husky/pre-commit +2 -1
- package/.prettierrc +1 -0
- package/README.md +14 -156
- package/config.schema.json +174 -7
- package/dist/accessory/AccessoryFactory.d.ts +3 -1
- package/dist/accessory/AccessoryFactory.d.ts.map +1 -1
- package/dist/accessory/AccessoryFactory.js +6 -0
- package/dist/accessory/AccessoryFactory.js.map +1 -1
- package/dist/accessory/AirConditionerAccessory.d.ts +14 -0
- package/dist/accessory/AirConditionerAccessory.d.ts.map +1 -1
- package/dist/accessory/AirConditionerAccessory.js +156 -10
- package/dist/accessory/AirConditionerAccessory.js.map +1 -1
- package/dist/accessory/DehumidifierAccessory.d.ts +5 -0
- package/dist/accessory/DehumidifierAccessory.d.ts.map +1 -1
- package/dist/accessory/DehumidifierAccessory.js +43 -3
- package/dist/accessory/DehumidifierAccessory.js.map +1 -1
- package/dist/accessory/ElectricWaterHeaterAccessory.d.ts +45 -0
- package/dist/accessory/ElectricWaterHeaterAccessory.d.ts.map +1 -0
- package/dist/accessory/ElectricWaterHeaterAccessory.js +179 -0
- package/dist/accessory/ElectricWaterHeaterAccessory.js.map +1 -0
- package/dist/accessory/GasWaterHeaterAccessory.d.ts +52 -0
- package/dist/accessory/GasWaterHeaterAccessory.d.ts.map +1 -0
- package/dist/accessory/GasWaterHeaterAccessory.js +219 -0
- package/dist/accessory/GasWaterHeaterAccessory.js.map +1 -0
- package/dist/core/MideaCloud.d.ts +14 -14
- package/dist/core/MideaCloud.d.ts.map +1 -1
- package/dist/core/MideaCloud.js +150 -92
- package/dist/core/MideaCloud.js.map +1 -1
- package/dist/core/MideaConstants.d.ts +7 -2
- package/dist/core/MideaConstants.d.ts.map +1 -1
- package/dist/core/MideaConstants.js +8 -1
- package/dist/core/MideaConstants.js.map +1 -1
- package/dist/core/MideaPacketBuilder.d.ts.map +1 -1
- package/dist/core/MideaPacketBuilder.js +3 -2
- package/dist/core/MideaPacketBuilder.js.map +1 -1
- package/dist/core/MideaSecurity.d.ts +35 -11
- package/dist/core/MideaSecurity.d.ts.map +1 -1
- package/dist/core/MideaSecurity.js +75 -28
- package/dist/core/MideaSecurity.js.map +1 -1
- package/dist/core/MideaUtils.js +2 -1
- package/dist/core/MideaUtils.js.map +1 -1
- package/dist/devices/DeviceFactory.d.ts +4 -2
- package/dist/devices/DeviceFactory.d.ts.map +1 -1
- package/dist/devices/DeviceFactory.js +6 -0
- package/dist/devices/DeviceFactory.js.map +1 -1
- package/dist/devices/e2/MideaE2Device.d.ts +45 -0
- package/dist/devices/e2/MideaE2Device.d.ts.map +1 -0
- package/dist/devices/e2/MideaE2Device.js +120 -0
- package/dist/devices/e2/MideaE2Device.js.map +1 -0
- package/dist/devices/e2/MideaE2Message.d.ts +34 -0
- package/dist/devices/e2/MideaE2Message.d.ts.map +1 -0
- package/dist/devices/e2/MideaE2Message.js +133 -0
- package/dist/devices/e2/MideaE2Message.js.map +1 -0
- package/dist/devices/e3/MideaE3Device.d.ts +44 -0
- package/dist/devices/e3/MideaE3Device.d.ts.map +1 -0
- package/dist/devices/e3/MideaE3Device.js +126 -0
- package/dist/devices/e3/MideaE3Device.js.map +1 -0
- package/dist/devices/e3/MideaE3Message.d.ts +52 -0
- package/dist/devices/e3/MideaE3Message.d.ts.map +1 -0
- package/dist/devices/e3/MideaE3Message.js +137 -0
- package/dist/devices/e3/MideaE3Message.js.map +1 -0
- package/dist/platformUtils.d.ts +28 -1
- package/dist/platformUtils.d.ts.map +1 -1
- package/dist/platformUtils.js +28 -3
- package/dist/platformUtils.js.map +1 -1
- package/docs/a1.md +20 -0
- package/docs/ac.md +41 -0
- package/docs/e2.md +21 -0
- package/docs/e3.md +27 -0
- package/homebridge-ui/public/index.html +78 -25
- package/homebridge-ui/server.js +23 -4
- package/package.json +8 -1
package/.gitattributes
ADDED
package/.husky/pre-commit
CHANGED
package/.prettierrc
CHANGED
package/README.md
CHANGED
|
@@ -5,18 +5,28 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/homebridge-midea-platform)
|
|
6
6
|
[](https://www.npmjs.com/package/homebridge-midea-platform)
|
|
7
7
|
|
|
8
|
-
*Unofficial* plugin for Midea. This is implemented by building on the Homebridge platform plugin template and the work done by [@georgezhao2010](https://github.com/georgezhao2010) in the [midea_ac_lan](https://github.com/georgezhao2010/midea_ac_lan) project for Home Assistant.
|
|
8
|
+
*Unofficial* plugin for Midea. This is implemented by building on the Homebridge platform plugin template and the work done by [@georgezhao2010](https://github.com/georgezhao2010) in the [midea_ac_lan](https://github.com/georgezhao2010/midea_ac_lan) project for Home Assistant. Also thanks to the work done by [@mill1000](https://github.com/mill1000) in the [midea-msmart (msmart-ng)](https://github.com/mill1000/midea-msmart) project.
|
|
9
9
|
|
|
10
10
|
**Warning** this plugin is new and not fully tested for all devices.
|
|
11
11
|
|
|
12
12
|
Pull requests and/or other offers of development assistance gratefully received.
|
|
13
13
|
|
|
14
|
+
More information can be found in the [wiki](https://github.com/kovapatrik/homebridge-midea-platform/wiki).
|
|
15
|
+
|
|
14
16
|
## Features
|
|
15
17
|
|
|
16
18
|
Currently supports the following devices:
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
| Device | ID | Docs |
|
|
21
|
+
|--------|----|------|
|
|
22
|
+
| Air Conditioner | AC | [link](/docs/ac.md) |
|
|
23
|
+
| Dehumidifier | A1 | [link](/docs/a1.md) |
|
|
24
|
+
| Electric Water Heater | E2 | [link](/docs/e2.md) |
|
|
25
|
+
| Gas Water Heater | E3 | [link](/docs/e3.md) |
|
|
26
|
+
|
|
27
|
+
### Unsupported Devices
|
|
28
|
+
|
|
29
|
+
If you have a device not supported by the plugin then useful information will be logged as warnings. If you are interested in developing support for a device please contact the authors by opening an [issue](https://github.com/kovapatrik/homebridge-midea-platform/issues).
|
|
20
30
|
|
|
21
31
|
## Installation
|
|
22
32
|
|
|
@@ -38,161 +48,9 @@ Midea device status is retrieved over your Local Area Network (LAN) and credenti
|
|
|
38
48
|
|
|
39
49
|
[Homebridge Config UI X](https://github.com/oznu/homebridge-config-ui-x) is the easiest and **strongly recommended** way to configure this plugin.
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Midea devices use different communication protocols. Protocol version 3 needs credentials for each device. Credentials for these Midea devices on your Local Area Network (LAN) must be retrieved from Midea cloud server, this is done through the Settings window in the Homebridge Config User Interface. On opening the settings window, click on *Discover Devices* and enter the requested information. You can run the discovery without providing your login credentials, however in this case if a protocol version 3 device is found in your network, it cannot be added. If you see *No credentials" instead of an *Add* or *Update* button then you must provide your login credentials.
|
|
44
|
-
|
|
45
|
-
* **Registered app** *(optional)*: Name of the Midea mobile app that you registered your userid and password with. Defaults to *Midea SmartHome (MSmartHome)*, but you can also select *NetHome Plus* or *Meiju*.
|
|
46
|
-
* **Username** *(optional)*: Email address / userid that you use to login to the Midea cloud service.
|
|
47
|
-
* **Password** *(optional)*: Password for Midea cloud service.
|
|
48
|
-
* **IP Addresses** *(optional)*: Comma- or space-separated list of device IP addresses.
|
|
49
|
-
|
|
50
|
-
On clicking *Discover All Devices* the plugin sends a message to the broadcast address for the subnet of each network interface attached to the Homebridge server. Midea devices attached to the network will respond. Network discovery is repeated multiple times (currently 4 times at interval of 2 seconds between each). At the end of the process details of all devices discovered are listed in the Settings window. From there, you can add new devices or update the *token/key* credentials for existing devices. You can then edit details for each device (for example change the name).
|
|
51
|
-
|
|
52
|
-
If your Midea device is not connected to the same LAN subnet as your Homebridge server then you must manually add the IP addresses of each device before running discovery. Add a space- or comma-separated list of IP addresses to the entry field above the *Discover All devices* button.
|
|
53
|
-
|
|
54
|
-
*You must click Save button* to update the Homebridge config.json file and restart the plugin.
|
|
55
|
-
|
|
56
|
-
Midea cloud credentals (Username / Password) are not saved as these are only required for retrieval of each device token/key pair. Once those are known and saved this plugin no longer accesses Midea cloud servers over the internet.
|
|
57
|
-
|
|
58
|
-
### Deleting a device
|
|
59
|
-
|
|
60
|
-
If you delete a device in the plugin settings window, or the Homebridge config.json file, then note that this does *not* delete the cached accessory from Homebridge... the device will still be visible in Homebridge and Apple Home, but it will not respond to any requests or update any data. To remove the device from Apple Home you must use Homebridge Settings and select *Remove Single Cached Accessory* to complete the deletion. **Caution:** removing an accessory from Apple Home may impact any automations that are dependent on the accessory, possibly deleting the automations.
|
|
61
|
-
|
|
62
|
-
### Configuration File
|
|
63
|
-
|
|
64
|
-
```json
|
|
65
|
-
"platforms": [
|
|
66
|
-
{
|
|
67
|
-
"name": "Midea Platform",
|
|
68
|
-
"platform": "midea-platform",
|
|
69
|
-
"refreshInterval": 30,
|
|
70
|
-
"heartbeatInterval": 10,
|
|
71
|
-
"verbose": false,
|
|
72
|
-
"logRecoverableErrors": true,
|
|
73
|
-
"uiDebug": false,
|
|
74
|
-
"devices": [
|
|
75
|
-
{
|
|
76
|
-
"type": "dehumidifier",
|
|
77
|
-
"name": "Dehumidifier",
|
|
78
|
-
"id": "123456789012345",
|
|
79
|
-
"advanced_options": {
|
|
80
|
-
"ip": "192.168.100.1",
|
|
81
|
-
"token": "ABCDEF1234567890",
|
|
82
|
-
"key": "1234567890ABCDEF",
|
|
83
|
-
"verbose": false,
|
|
84
|
-
"logRecoverableErrors": true
|
|
85
|
-
},
|
|
86
|
-
"<device_options>": {
|
|
87
|
-
"device_option": "value"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
```
|
|
94
|
-
* **Platform Properties**
|
|
95
|
-
* **name** *(required)*: Platform name, set to 'Midea Platform'.
|
|
96
|
-
* **platform** *(required)*: Platform identifier, set to 'midea-platform'.
|
|
97
|
-
* **refreshInterval** *(optional)*: Frequency in seconds that the plugin will query a device for status. The plugin maintains a cache of device status so that it can respond quickly to state requests from HomeKit without having to send a request to the Midea device. Many Midea devices will automatically notify the plugin of any status change (e.g. temperature or humidity) but the plugin will also regularly request status from each device at the interval specified. The default is 30 seconds, the maximum is 86400 (24 hours). Setting value to 0 (zero) disables polling and updates will only be noted if devices sends it automatically.
|
|
98
|
-
* **heartbeatInterval** *(optional)*: Frequency in seconds that the plugin will send a heartbeat message to a device to keep the network socket open. The default and minimum is 10 seconds, you can increase this up to a maximum of 120 (2 minutes). If you see socket closed error messages in the log reduce this value.
|
|
99
|
-
* **verbose** *(optional)*: Enables more verbose debug logging. This requires that Homebridge is run with debug mode enabled and will add additional network traffic details to the log. Default is false. See *logging* section below.
|
|
100
|
-
* **logRecoverableErrors** *(optional)*: Enables logging of recoverable warning or error messages. Default is true. See *logging* and *network resiliency* sections below.
|
|
101
|
-
* **uiDebug** *(optional)*: Debug data for the custom UI device discovery process will be logged to the Homebridge log and Javascript console. Default is false.
|
|
102
|
-
* **devices** *(required)*: Array of device settings, see below.
|
|
103
|
-
|
|
104
|
-
* **devices** is an array of objects that allow settings or overrides for each device and contains the following fields:
|
|
105
|
-
* **type** *(required)*: Must be set to one of the supported devices.
|
|
106
|
-
* **name** *(optional)*: This replaces the name set by the Midea device and is displayed in the Homebridge accessories page. Entries in the log are prefixed with this name to assist in identifying the source of information being logged.
|
|
107
|
-
* **id** *(required)*: ID to identify specific device. This will be filled in by the device discovery process in the Settings window but uou can also find this from the Homebridge log during plugin initialization or in the Homebridge Config UI X by clicking on an accessory settings and copying the *Product Data* field.
|
|
108
|
-
* **advanced_options** *(required)*: Object with settings specific for this device:
|
|
109
|
-
* **ip** *(optional)*: IP address of device on your local LAN. Required if the device is not on the same LAN subnet as your Homebridge server.
|
|
110
|
-
* **token** *(optional)*: Device login token. Required for protocol version 3 devices.
|
|
111
|
-
* **key** *(optional)*: Device login key. Specifying a token/key pair will override any values previously cached by the plugin. Required for protocol version 3 devices.
|
|
112
|
-
* **verbose** *(optional)*: Override global setting for this one device.
|
|
113
|
-
* **logRecoverableErrors** *(optional)*: Override global setting for this one device.
|
|
114
|
-
* **<device_options>** *(optional)*: Object with name and options that are device type specific. See *device notes* below.
|
|
115
|
-
|
|
116
|
-
## Plugin Initialization
|
|
117
|
-
|
|
118
|
-
When the plugin initializes it attempts to find all devices attached to the Local Area Network (LAN) by sending a message to the broadcast address of the subnet for each network interface attached to the Homebridge server. Midea devices attached to the network will respond and are checked against devices configured in the plugin platform config.json file. Network discovery is repeated multiple times (currently 4 times at interval of 2 seconds between each).
|
|
119
|
-
|
|
120
|
-
At the end of the discovery process, if there are devices configured in the *devices* array with deviceID that was not discovered, then a warning is noted in the log and the plugin will retry every 60 seconds until the missing device comes online.
|
|
121
|
-
|
|
122
|
-
## Device Notes
|
|
123
|
-
|
|
124
|
-
Observed behavior of various devices, and specific configuration settings are noted below for supported devices.
|
|
125
|
-
|
|
126
|
-
### Air Conditioner
|
|
127
|
-
|
|
128
|
-
Providing air conditioner settings is optional and the whole section or individual options may be ommitted and default values (noted below) will be used. Within the *devices.config* object the following air conditioner specific options.
|
|
129
|
-
|
|
130
|
-
```json
|
|
131
|
-
"AC_options": {
|
|
132
|
-
"swingMode": "Both",
|
|
133
|
-
"outDoorTemp": false,
|
|
134
|
-
"audioFeedback": false,
|
|
135
|
-
"ecoSwitch": true,
|
|
136
|
-
"switchDisplay": {
|
|
137
|
-
"flag": true,
|
|
138
|
-
"command": false
|
|
139
|
-
},
|
|
140
|
-
"minTemp": 16,
|
|
141
|
-
"maxTemp": 30,
|
|
142
|
-
"tempStep": 1,
|
|
143
|
-
"fahrenheit": false,
|
|
144
|
-
"fanOnlyMode": false
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
* **Air Conditioner options**
|
|
149
|
-
* **swingMode** *(optional)*: Set swing mode of the unit. If you AC does not support this feature then leave it on None.
|
|
150
|
-
* **outDoorTemp** *(optional)*: Toggles if the outdoor temperature is created with the accessory, default is false.
|
|
151
|
-
* **audioFeedback** *(optional)*: Toggles if the unit beeps when a command is sent, default is false.
|
|
152
|
-
* **ecoSwitch** *(optional)*: Toggles if the ECO mode switch is created with the accessory, default is true.
|
|
153
|
-
* **switchDisplay** *(optional)*: Object with following two options...
|
|
154
|
-
* **flag** *(optional)*: Toggles if a switch, which can turn the display on or off will be created or not. Default is true.
|
|
155
|
-
* **command** *(optional)*: Use this if the switch display command does not work. If it doesn't work either way then you unit does not support this feature. Default is false.
|
|
156
|
-
* **minTemp** *(optional)*: The minimum temperature that the unit can be set for. Default is 16 celsius
|
|
157
|
-
* **maxTemp** *(optional)*: The maximum temperature that the unit can be set for. Default is 30 celsius
|
|
158
|
-
* **tempStep** *(optional)*: Increment in which the temperature setting can be changed, may be set to either 0.5 or 1 degree celsius. The default is one degree.
|
|
159
|
-
* **fahrenheit** *(optional)*: Toggles if the temperature on the unit is displayed in Fahrenheit or Celsius. Default is false (displays in Celsius).
|
|
160
|
-
* **fanOnlyMode** *(optional)*: Toggles if the fan only mode is created with the accessory. Default is false.
|
|
161
|
-
|
|
162
|
-
### Dehumidifier
|
|
163
|
-
|
|
164
|
-
Providing dehumidifier settings is optional and the whole section or individual options may be ommitted and default values (noted below) will be used. Within the *devices.config* object the following dehumidifier specific options.
|
|
165
|
-
|
|
166
|
-
```json
|
|
167
|
-
"A1_options": {
|
|
168
|
-
"minHumidity": 35,
|
|
169
|
-
"maxHumidity": 85,
|
|
170
|
-
"humidityStep": 5
|
|
171
|
-
}
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
* **Dehumidifier options**
|
|
175
|
-
* **minHumidity** *(optional)*: The minimum relative humidity that the unit can be set for. Default is 35%
|
|
176
|
-
* **maxHumidity** *(optional)*: The maximum relative humidity that the unit can be set for. Default is 85%
|
|
177
|
-
* **humidityStep** *(optional)*: Increment in which the relative himidity setting can be changed, may be set to either 5% or 10%. The default is 5%.
|
|
178
|
-
|
|
179
|
-
### Unsupported Devices
|
|
180
|
-
|
|
181
|
-
If you have a device not supported by the plugin then useful information will be logged as warnings. If you are interested in developing support for a device please contact the authors by opening an [issue](https://github.com/kovapatrik/homebridge-midea-platform/issues).
|
|
182
|
-
|
|
183
|
-
## Technical Notes
|
|
184
|
-
|
|
185
|
-
### Network Resiliency
|
|
186
|
-
|
|
187
|
-
Various strategies are employed in an attempt to handle an unstable network. If a failure occurs at any point while accessing the network or Midea devices then the plugin will attempt to reconnect. During testing we have observed that if a Midea device is isolated from the public internet, and therefore unable to connect to Midea cloud servers, it will close the internal LAN connection to this plugin after a few minutes. The plugin is able to recover and reopen this connection. See *logging* setion below.
|
|
188
|
-
|
|
189
|
-
### Logging
|
|
190
|
-
|
|
191
|
-
Device status changes, for example temperature or humidity changes are logged into the Homebridge log as are any warnings or errors. This includes errors that the plugin can recover from. If your log is filling up with recoverable errors you can suppress these by setting *logRecoverableErrors* to false. You can turn on debug log by running Homebridge with debug enabled, in the Homebridge UI you can set this in Homebridge Settings.
|
|
51
|
+
You should use the UI to discover and add devices. More information on the settings can be found in the [Settings](#settings) section below.
|
|
192
52
|
|
|
193
|
-
By default the plugin does not debug-log all network traffic. If you are developing support for a new device it may be helpful to turn this on by setting *verbose* to true.
|
|
194
53
|
|
|
195
|
-
The custom UI settings window performs device discovery on your network. To enable debug log for this process you must enable *uiDebug* in the settings. Server side debug will log to the Homebridge log, client side debug will log to the browser javascript console.
|
|
196
54
|
|
|
197
55
|
## License
|
|
198
56
|
|
package/config.schema.json
CHANGED
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
"required": true,
|
|
49
49
|
"enum": [
|
|
50
50
|
"Air Conditioner",
|
|
51
|
-
"Dehumidifier"
|
|
51
|
+
"Dehumidifier",
|
|
52
|
+
"Electric Water Heater",
|
|
53
|
+
"Gas Water Heater"
|
|
52
54
|
],
|
|
53
55
|
"description": "Select the type of device you are adding."
|
|
54
56
|
},
|
|
@@ -104,6 +106,16 @@
|
|
|
104
106
|
"functionBody": "return model.devices && model.devices[arrayIndices].type === 'Dehumidifier';"
|
|
105
107
|
},
|
|
106
108
|
"properties": {
|
|
109
|
+
"temperatureSensor": {
|
|
110
|
+
"title": "Temperature Sensor",
|
|
111
|
+
"description": "Toggles if the temperature sensor is created with the accessory.",
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"pumpSwitch": {
|
|
115
|
+
"title": "Pump Switch",
|
|
116
|
+
"description": "Toggles if the pump switch is created with the accessory.",
|
|
117
|
+
"type": "boolean"
|
|
118
|
+
},
|
|
107
119
|
"minHumidity": {
|
|
108
120
|
"title": "Minimum Relative Humidity",
|
|
109
121
|
"type": "number",
|
|
@@ -145,6 +157,11 @@
|
|
|
145
157
|
"Both"
|
|
146
158
|
]
|
|
147
159
|
},
|
|
160
|
+
"heatingCapable": {
|
|
161
|
+
"title": "Heating Capability",
|
|
162
|
+
"description": "Toggles if heating is enabled on the accessory. If your unit does not support heating then leave this off.",
|
|
163
|
+
"type": "boolean"
|
|
164
|
+
},
|
|
148
165
|
"outDoorTemp": {
|
|
149
166
|
"title": "Outdoor Temperature",
|
|
150
167
|
"description": "Toggles if the outdoor temperature is created with the accessory.",
|
|
@@ -160,21 +177,36 @@
|
|
|
160
177
|
"description": "Toggles if the ECO mode switch is created with the accessory.",
|
|
161
178
|
"type": "boolean"
|
|
162
179
|
},
|
|
163
|
-
"
|
|
180
|
+
"dryModeSwitch": {
|
|
181
|
+
"title": "Dry Mode Switch",
|
|
182
|
+
"description": "Toggles if the dry mode switch is created with the accessory.",
|
|
183
|
+
"type": "boolean"
|
|
184
|
+
},
|
|
185
|
+
"breezeAwaySwitch": {
|
|
186
|
+
"title": "Breeze Away Mode",
|
|
187
|
+
"description": "Toggles if the breeze away mode swtich is created with the accessory.",
|
|
188
|
+
"type": "boolean"
|
|
189
|
+
},
|
|
190
|
+
"displaySwitch": {
|
|
164
191
|
"type": "object",
|
|
165
192
|
"properties": {
|
|
166
193
|
"flag": {
|
|
167
|
-
"title": "Switch
|
|
194
|
+
"title": "Display Switch",
|
|
168
195
|
"description": "Toggles if a switch, which can turn the display on or off will be created or not.",
|
|
169
196
|
"type": "boolean"
|
|
170
197
|
},
|
|
171
198
|
"command": {
|
|
172
|
-
"title": "Switch
|
|
199
|
+
"title": "Display Switch Alternate Command",
|
|
173
200
|
"description": "Use this if the switch display command does not work. If it doesn't work either way then you unit does not support this feature.",
|
|
174
201
|
"type": "boolean"
|
|
175
202
|
}
|
|
176
203
|
}
|
|
177
204
|
},
|
|
205
|
+
"auxHeatingSwitches": {
|
|
206
|
+
"title": "Auxiliary Heating Switches",
|
|
207
|
+
"description": "Toggles if the aux and aux+heat switches are created with the accessory.",
|
|
208
|
+
"type": "boolean"
|
|
209
|
+
},
|
|
178
210
|
"minTemp": {
|
|
179
211
|
"title": "Minimum Temperature",
|
|
180
212
|
"type": "number"
|
|
@@ -202,6 +234,106 @@
|
|
|
202
234
|
"type": "boolean"
|
|
203
235
|
}
|
|
204
236
|
}
|
|
237
|
+
},
|
|
238
|
+
"E2_options": {
|
|
239
|
+
"title": "Electric Water Heater Options",
|
|
240
|
+
"type": "object",
|
|
241
|
+
"condition": {
|
|
242
|
+
"functionBody": "return model.devices && model.devices[arrayIndices].type === 'Electric Water Heater';"
|
|
243
|
+
},
|
|
244
|
+
"properties": {
|
|
245
|
+
"protocol": {
|
|
246
|
+
"title": "Protocol",
|
|
247
|
+
"description": "Selects the protocol type of the water heater. Default to 'auto' which will try to detect the protocol automatically. Try to set this to 'old' or 'new' if the plugin is unable to communicate with the water heater.",
|
|
248
|
+
"type": "string",
|
|
249
|
+
"enum": [
|
|
250
|
+
"auto",
|
|
251
|
+
"old",
|
|
252
|
+
"new"
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
"minTemp": {
|
|
256
|
+
"title": "Minimum Temperature",
|
|
257
|
+
"type": "number"
|
|
258
|
+
},
|
|
259
|
+
"maxTemp": {
|
|
260
|
+
"title": "Maximum Temperature",
|
|
261
|
+
"type": "number"
|
|
262
|
+
},
|
|
263
|
+
"tempStep": {
|
|
264
|
+
"title": "Temperature Step",
|
|
265
|
+
"type": "number",
|
|
266
|
+
"enum": [
|
|
267
|
+
0.5,
|
|
268
|
+
1
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"variableHeatingSwitch": {
|
|
272
|
+
"title": "Variable Heating Switch",
|
|
273
|
+
"description": "Toggles if the variable heating switch is created with the accessory.",
|
|
274
|
+
"type": "boolean"
|
|
275
|
+
},
|
|
276
|
+
"wholeTankHeatingSwitch": {
|
|
277
|
+
"title": "Whole Tank Heating Switch",
|
|
278
|
+
"description": "Toggles if the whole tank heating switch is created with the accessory.",
|
|
279
|
+
"type": "boolean"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"E3_options": {
|
|
284
|
+
"title": "Gas Water Heater Options",
|
|
285
|
+
"type": "object",
|
|
286
|
+
"condition": {
|
|
287
|
+
"functionBody": "return model.devices && model.devices[arrayIndices].type === 'Gas Water Heater';"
|
|
288
|
+
},
|
|
289
|
+
"properties": {
|
|
290
|
+
"precisionHalves": {
|
|
291
|
+
"title": "Precision Halves",
|
|
292
|
+
"description": "Toggles if the temperature on the unit is displayed in half degrees.",
|
|
293
|
+
"type": "boolean"
|
|
294
|
+
},
|
|
295
|
+
"minTemp": {
|
|
296
|
+
"title": "Minimum Temperature",
|
|
297
|
+
"type": "number"
|
|
298
|
+
},
|
|
299
|
+
"maxTemp": {
|
|
300
|
+
"title": "Maximum Temperature",
|
|
301
|
+
"type": "number"
|
|
302
|
+
},
|
|
303
|
+
"tempStep": {
|
|
304
|
+
"title": "Temperature Step",
|
|
305
|
+
"type": "number",
|
|
306
|
+
"enum": [
|
|
307
|
+
0.5,
|
|
308
|
+
1
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
"burningStateSensor": {
|
|
312
|
+
"title": "Burning State Sensor",
|
|
313
|
+
"description": "Toggles if the burning state sensor is created with the accessory.",
|
|
314
|
+
"type": "boolean"
|
|
315
|
+
},
|
|
316
|
+
"protectionSensor": {
|
|
317
|
+
"title": "Protection Sensor",
|
|
318
|
+
"description": "Toggles if the protection sensor is created with the accessory.",
|
|
319
|
+
"type": "boolean"
|
|
320
|
+
},
|
|
321
|
+
"zeroColdWaterSwitch": {
|
|
322
|
+
"title": "Zero Cold Water Switch",
|
|
323
|
+
"description": "Toggles if the zero cold water switch is created with the accessory.",
|
|
324
|
+
"type": "boolean"
|
|
325
|
+
},
|
|
326
|
+
"zeroColdPulseSwitch": {
|
|
327
|
+
"title": "Zero Cold Pulse Switch",
|
|
328
|
+
"description": "Toggles if the zero cold pulse switch is created with the accessory.",
|
|
329
|
+
"type": "boolean"
|
|
330
|
+
},
|
|
331
|
+
"smartVolumeSwitch": {
|
|
332
|
+
"title": "Smart Volume Switch",
|
|
333
|
+
"description": "Toggles if the smart volume switch is created with the accessory.",
|
|
334
|
+
"type": "boolean"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
205
337
|
}
|
|
206
338
|
}
|
|
207
339
|
}
|
|
@@ -251,6 +383,8 @@
|
|
|
251
383
|
"expandable": true,
|
|
252
384
|
"expanded": false,
|
|
253
385
|
"items": [
|
|
386
|
+
"devices[].A1_options.temperatureSensor",
|
|
387
|
+
"devices[].A1_options.pumpSwitch",
|
|
254
388
|
"devices[].A1_options.minHumidity",
|
|
255
389
|
"devices[].A1_options.maxHumidity",
|
|
256
390
|
"devices[].A1_options.humidityStep"
|
|
@@ -262,14 +396,18 @@
|
|
|
262
396
|
"expanded": false,
|
|
263
397
|
"items": [
|
|
264
398
|
"devices[].AC_options.swingMode",
|
|
399
|
+
"devices[].AC_options.heatingCapable",
|
|
265
400
|
"devices[].AC_options.outDoorTemp",
|
|
266
401
|
"devices[].AC_options.audioFeedback",
|
|
267
402
|
"devices[].AC_options.ecoSwitch",
|
|
403
|
+
"devices[].AC_options.breezeAwaySwitch",
|
|
404
|
+
"devices[].AC_options.dryModeSwitch",
|
|
405
|
+
"devices[].AC_options.auxHeatingSwitches",
|
|
268
406
|
{
|
|
269
|
-
"key": "devices[].AC_options.
|
|
407
|
+
"key": "devices[].AC_options.displaySwitch",
|
|
270
408
|
"items": [
|
|
271
|
-
"devices[].AC_options.
|
|
272
|
-
"devices[].AC_options.
|
|
409
|
+
"devices[].AC_options.displaySwitch.flag",
|
|
410
|
+
"devices[].AC_options.displaySwitch.command"
|
|
273
411
|
]
|
|
274
412
|
},
|
|
275
413
|
"devices[].AC_options.minTemp",
|
|
@@ -278,6 +416,35 @@
|
|
|
278
416
|
"devices[].AC_options.fahrenheit",
|
|
279
417
|
"devices[].AC_options.fanOnlyMode"
|
|
280
418
|
]
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"key": "devices[].E2_options",
|
|
422
|
+
"expandable": true,
|
|
423
|
+
"expanded": false,
|
|
424
|
+
"items": [
|
|
425
|
+
"devices[].E2_options.protocol",
|
|
426
|
+
"devices[].E2_options.variableHeatingSwitch",
|
|
427
|
+
"devices[].E2_options.wholeTankHeatingSwitch",
|
|
428
|
+
"devices[].E2_options.minTemp",
|
|
429
|
+
"devices[].E2_options.maxTemp",
|
|
430
|
+
"devices[].E2_options.tempStep"
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"key": "devices[].E3_options",
|
|
435
|
+
"expandable": true,
|
|
436
|
+
"expanded": false,
|
|
437
|
+
"items": [
|
|
438
|
+
"devices[].E3_options.precisionHalves",
|
|
439
|
+
"devices[].E3_options.burningStateSensor",
|
|
440
|
+
"devices[].E3_options.protectionSensor",
|
|
441
|
+
"devices[].E3_options.zeroColdWaterSwitch",
|
|
442
|
+
"devices[].E3_options.zeroColdPulseSwitch",
|
|
443
|
+
"devices[].E3_options.smartVolumeSwitch",
|
|
444
|
+
"devices[].E3_options.minTemp",
|
|
445
|
+
"devices[].E3_options.maxTemp",
|
|
446
|
+
"devices[].E3_options.tempStep"
|
|
447
|
+
]
|
|
281
448
|
}
|
|
282
449
|
]
|
|
283
450
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { MideaAccessory, MideaPlatform } from '../platform';
|
|
2
2
|
import AirConditionerAccessory from './AirConditionerAccessory';
|
|
3
3
|
import DehumidifierAccessory from './DehumidifierAccessory';
|
|
4
|
+
import ElectricWaterHeaterAccessory from './ElectricWaterHeaterAccessory';
|
|
5
|
+
import GasWaterHeaterAccessory from './GasWaterHeaterAccessory';
|
|
4
6
|
import MideaDevice from '../core/MideaDevice';
|
|
5
7
|
import { DeviceConfig } from '../platformUtils';
|
|
6
8
|
export default class AccessoryFactory {
|
|
7
|
-
static createAccessory<T extends MideaDevice>(platform: MideaPlatform, accessory: MideaAccessory, device: T, configDev: DeviceConfig): AirConditionerAccessory | DehumidifierAccessory;
|
|
9
|
+
static createAccessory<T extends MideaDevice>(platform: MideaPlatform, accessory: MideaAccessory, device: T, configDev: DeviceConfig): AirConditionerAccessory | DehumidifierAccessory | ElectricWaterHeaterAccessory | GasWaterHeaterAccessory;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=AccessoryFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessoryFactory.d.ts","sourceRoot":"","sources":["../../src/accessory/AccessoryFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"AccessoryFactory.d.ts","sourceRoot":"","sources":["../../src/accessory/AccessoryFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMhD,MAAM,CAAC,OAAO,OAAO,gBAAgB;WACrB,eAAe,CAAC,CAAC,SAAS,WAAW,EACjD,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,YAAY;CAa1B"}
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const MideaConstants_1 = require("../core/MideaConstants");
|
|
7
7
|
const AirConditionerAccessory_1 = __importDefault(require("./AirConditionerAccessory"));
|
|
8
8
|
const DehumidifierAccessory_1 = __importDefault(require("./DehumidifierAccessory"));
|
|
9
|
+
const ElectricWaterHeaterAccessory_1 = __importDefault(require("./ElectricWaterHeaterAccessory"));
|
|
10
|
+
const GasWaterHeaterAccessory_1 = __importDefault(require("./GasWaterHeaterAccessory"));
|
|
9
11
|
class AccessoryFactory {
|
|
10
12
|
static createAccessory(platform, accessory, device, configDev) {
|
|
11
13
|
switch (device.type) {
|
|
@@ -13,6 +15,10 @@ class AccessoryFactory {
|
|
|
13
15
|
return new AirConditionerAccessory_1.default(platform, accessory, device, configDev);
|
|
14
16
|
case MideaConstants_1.DeviceType.DEHUMIDIFIER:
|
|
15
17
|
return new DehumidifierAccessory_1.default(platform, accessory, device, configDev);
|
|
18
|
+
case MideaConstants_1.DeviceType.ELECTRIC_WATER_HEATER:
|
|
19
|
+
return new ElectricWaterHeaterAccessory_1.default(platform, accessory, device, configDev);
|
|
20
|
+
case MideaConstants_1.DeviceType.GAS_WATER_HEATER:
|
|
21
|
+
return new GasWaterHeaterAccessory_1.default(platform, accessory, device, configDev);
|
|
16
22
|
}
|
|
17
23
|
}
|
|
18
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessoryFactory.js","sourceRoot":"","sources":["../../src/accessory/AccessoryFactory.ts"],"names":[],"mappings":";;;;;AAAA,2DAAoD;AAEpD,wFAAgE;AAChE,oFAA4D;
|
|
1
|
+
{"version":3,"file":"AccessoryFactory.js","sourceRoot":"","sources":["../../src/accessory/AccessoryFactory.ts"],"names":[],"mappings":";;;;;AAAA,2DAAoD;AAEpD,wFAAgE;AAChE,oFAA4D;AAC5D,kGAA0E;AAC1E,wFAAgE;AAQhE,MAAqB,gBAAgB;IAC5B,MAAM,CAAC,eAAe,CAC3B,QAAuB,EACvB,SAAyB,EACzB,MAAS,EACT,SAAuB;QAEvB,QAAQ,MAAM,CAAC,IAAI,EAAE;YACnB,KAAK,2BAAU,CAAC,eAAe;gBAC7B,OAAO,IAAI,iCAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;YACzG,KAAK,2BAAU,CAAC,YAAY;gBAC1B,OAAO,IAAI,+BAAqB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;YACvG,KAAK,2BAAU,CAAC,qBAAqB;gBACnC,OAAO,IAAI,sCAA4B,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;YAC9G,KAAK,2BAAU,CAAC,gBAAgB;gBAC9B,OAAO,IAAI,iCAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAkC,EAAE,SAAS,CAAC,CAAC;SAC1G;IACH,CAAC;CACF;AAlBD,mCAkBC"}
|
|
@@ -21,6 +21,10 @@ export default class AirConditionerAccessory extends BaseAccessory<MideaACDevice
|
|
|
21
21
|
private displayService?;
|
|
22
22
|
private fanService?;
|
|
23
23
|
private ecoModeService?;
|
|
24
|
+
private breezeAwayService?;
|
|
25
|
+
private dryModeService?;
|
|
26
|
+
private auxService?;
|
|
27
|
+
private auxHeatingService?;
|
|
24
28
|
/*********************************************************************
|
|
25
29
|
* Constructor registers all the service types with Homebridge, registers
|
|
26
30
|
* a callback function with the MideaDevice class, and requests device status.
|
|
@@ -42,6 +46,8 @@ export default class AirConditionerAccessory extends BaseAccessory<MideaACDevice
|
|
|
42
46
|
setTargetHeaterCoolerState(value: CharacteristicValue): Promise<void>;
|
|
43
47
|
getCurrentTemperature(): CharacteristicValue;
|
|
44
48
|
getTargetTemperature(): CharacteristicValue;
|
|
49
|
+
getFanOnlyMode(): CharacteristicValue;
|
|
50
|
+
setFanOnlyMode(value: CharacteristicValue): Promise<void>;
|
|
45
51
|
setTargetTemperature(value: CharacteristicValue): Promise<void>;
|
|
46
52
|
getSwingMode(): CharacteristicValue;
|
|
47
53
|
setSwingMode(value: CharacteristicValue): Promise<void>;
|
|
@@ -52,5 +58,13 @@ export default class AirConditionerAccessory extends BaseAccessory<MideaACDevice
|
|
|
52
58
|
setDisplayActive(value: CharacteristicValue): Promise<void>;
|
|
53
59
|
getEcoMode(): CharacteristicValue;
|
|
54
60
|
setEcoMode(value: CharacteristicValue): Promise<void>;
|
|
61
|
+
getBreezeAway(): CharacteristicValue;
|
|
62
|
+
setBreezeAway(value: CharacteristicValue): Promise<void>;
|
|
63
|
+
getDryMode(): CharacteristicValue;
|
|
64
|
+
setDryMode(value: CharacteristicValue): Promise<void>;
|
|
65
|
+
getAux(): CharacteristicValue;
|
|
66
|
+
setAux(value: CharacteristicValue): Promise<void>;
|
|
67
|
+
getAuxHeating(): CharacteristicValue;
|
|
68
|
+
setAuxHeating(value: CharacteristicValue): Promise<void>;
|
|
55
69
|
}
|
|
56
70
|
//# sourceMappingURL=AirConditionerAccessory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirConditionerAccessory.d.ts","sourceRoot":"","sources":["../../src/accessory/AirConditionerAccessory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAW,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAa,MAAM,kBAAkB,CAAC;AAC3D,OAAO,aAA+B,MAAM,6BAA6B,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,aAAa,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AirConditionerAccessory.d.ts","sourceRoot":"","sources":["../../src/accessory/AirConditionerAccessory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAW,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAa,MAAM,kBAAkB,CAAC;AAC3D,OAAO,aAA+B,MAAM,6BAA6B,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,aAAa,CAAC,aAAa,CAAC;IAkB7E,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa;IACxC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY;IAlB5C,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,yBAAyB,CAAC,CAAU;IAC5C,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,UAAU,CAAC,CAAU;IAC7B,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,iBAAiB,CAAC,CAAU;IACpC,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,UAAU,CAAC,CAAU;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAU;IAEpC;;;OAGG;gBAED,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,cAAc,EACN,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,YAAY;IA8M5C;;;OAGG;YACW,qBAAqB;IAyDnC;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAIzC,SAAS,CAAC,KAAK,EAAE,mBAAmB;IAM1C,2BAA2B,IAAI,mBAAmB;IAsBlD,0BAA0B,IAAI,mBAAmB;IAU3C,0BAA0B,CAAC,KAAK,EAAE,mBAAmB;IAc3D,qBAAqB,IAAI,mBAAmB;IAI5C,oBAAoB,IAAI,mBAAmB;IAO3C,cAAc,IAAI,mBAAmB;IAI/B,cAAc,CAAC,KAAK,EAAE,mBAAmB;IAQzC,oBAAoB,CAAC,KAAK,EAAE,mBAAmB;IAKrD,YAAY,IAAI,mBAAmB;IAM7B,YAAY,CAAC,KAAK,EAAE,mBAAmB;IAc7C,gBAAgB,IAAI,mBAAmB;IAIjC,gBAAgB,CAAC,KAAK,EAAE,mBAAmB;IAQjD,qBAAqB,IAAI,mBAAmB;IAI5C,gBAAgB,IAAI,mBAAmB;IAIjC,gBAAgB,CAAC,KAAK,EAAE,mBAAmB;IAMjD,UAAU,IAAI,mBAAmB;IAI3B,UAAU,CAAC,KAAK,EAAE,mBAAmB;IAI3C,aAAa,IAAI,mBAAmB;IAI9B,aAAa,CAAC,KAAK,EAAE,mBAAmB;IAI9C,UAAU,IAAI,mBAAmB;IAI3B,UAAU,CAAC,KAAK,EAAE,mBAAmB;IAQ3C,MAAM,IAAI,mBAAmB;IAIvB,MAAM,CAAC,KAAK,EAAE,mBAAmB;IAQvC,aAAa,IAAI,mBAAmB;IAI9B,aAAa,CAAC,KAAK,EAAE,mBAAmB;CAO/C"}
|