@pietrolubini/homebridge-ecoflow 1.2.1 → 1.3.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.
Files changed (203) hide show
  1. package/.gitattributes +7 -0
  2. package/.prettierrc.json +1 -0
  3. package/README.md +153 -24
  4. package/config.schema.json +65 -2
  5. package/dist/accessories/batteries/batteryAccessoryBase.d.ts +26 -0
  6. package/dist/accessories/batteries/batteryAccessoryBase.js +126 -0
  7. package/dist/accessories/batteries/batteryAccessoryBase.js.map +1 -0
  8. package/dist/accessories/batteries/batteryAccessoryBase.spec.d.ts +1 -0
  9. package/dist/accessories/batteries/delta2Accessory.d.ts +2 -2
  10. package/dist/accessories/batteries/delta2Accessory.js +6 -2
  11. package/dist/accessories/batteries/delta2Accessory.js.map +1 -1
  12. package/dist/accessories/batteries/delta2maxAccessory.d.ts +2 -2
  13. package/dist/accessories/batteries/delta2maxAccessory.js +6 -2
  14. package/dist/accessories/batteries/delta2maxAccessory.js.map +1 -1
  15. package/dist/accessories/batteries/interfaces/httpApiBatteryContracts.d.ts +33 -0
  16. package/dist/accessories/batteries/interfaces/httpApiBatteryContracts.js +3 -0
  17. package/dist/accessories/batteries/interfaces/httpApiBatteryContracts.js.map +1 -0
  18. package/dist/accessories/batteries/interfaces/mqttApiBatteryContracts.d.ts +36 -0
  19. package/dist/accessories/batteries/interfaces/mqttApiBatteryContracts.js +18 -0
  20. package/dist/accessories/batteries/interfaces/mqttApiBatteryContracts.js.map +1 -0
  21. package/dist/accessories/batteries/services/outletAcService.d.ts +8 -0
  22. package/dist/accessories/batteries/services/outletAcService.js +24 -0
  23. package/dist/accessories/batteries/services/outletAcService.js.map +1 -0
  24. package/dist/accessories/batteries/services/outletAcService.spec.d.ts +1 -0
  25. package/dist/accessories/batteries/services/outletBatteryServiceBase.d.ts +5 -0
  26. package/dist/accessories/batteries/services/outletBatteryServiceBase.js +18 -0
  27. package/dist/accessories/batteries/services/outletBatteryServiceBase.js.map +1 -0
  28. package/dist/accessories/batteries/services/outletCarService.d.ts +6 -0
  29. package/dist/accessories/batteries/services/outletCarService.js +17 -0
  30. package/dist/accessories/batteries/services/outletCarService.js.map +1 -0
  31. package/dist/accessories/batteries/services/outletCarService.spec.d.ts +1 -0
  32. package/dist/accessories/batteries/services/outletUsbService.d.ts +6 -0
  33. package/dist/accessories/batteries/services/outletUsbService.js +15 -0
  34. package/dist/accessories/batteries/services/outletUsbService.js.map +1 -0
  35. package/dist/accessories/batteries/services/outletUsbService.spec.d.ts +1 -0
  36. package/dist/accessories/batteries/simulations/batterySimulator.d.ts +6 -0
  37. package/dist/accessories/batteries/simulations/batterySimulator.js +60 -0
  38. package/dist/accessories/batteries/simulations/batterySimulator.js.map +1 -0
  39. package/dist/accessories/ecoFlowAccessoryBase.d.ts +41 -0
  40. package/dist/accessories/ecoFlowAccessoryBase.js +114 -0
  41. package/dist/accessories/ecoFlowAccessoryBase.js.map +1 -0
  42. package/dist/accessories/ecoFlowAccessoryBase.spec.d.ts +1 -0
  43. package/dist/accessories/ecoFlowAccessoryWithQuotaBase.d.ts +15 -0
  44. package/dist/accessories/ecoFlowAccessoryWithQuotaBase.js +34 -0
  45. package/dist/accessories/ecoFlowAccessoryWithQuotaBase.js.map +1 -0
  46. package/dist/accessories/ecoFlowAccessoryWithQuotaBase.spec.d.ts +1 -0
  47. package/dist/accessories/powerstream/interfaces/httpApiPowerStreamContracts.d.ts +16 -0
  48. package/dist/accessories/powerstream/interfaces/httpApiPowerStreamContracts.js +3 -0
  49. package/dist/accessories/powerstream/interfaces/httpApiPowerStreamContracts.js.map +1 -0
  50. package/dist/accessories/powerstream/interfaces/mqttApiPowerStreamContracts.d.ts +41 -0
  51. package/dist/accessories/powerstream/interfaces/mqttApiPowerStreamContracts.js +21 -0
  52. package/dist/accessories/powerstream/interfaces/mqttApiPowerStreamContracts.js.map +1 -0
  53. package/dist/accessories/powerstream/powerStreamAccessory.d.ts +26 -0
  54. package/dist/accessories/powerstream/powerStreamAccessory.js +113 -0
  55. package/dist/accessories/powerstream/powerStreamAccessory.js.map +1 -0
  56. package/dist/accessories/powerstream/powerStreamAccessory.spec.d.ts +1 -0
  57. package/dist/accessories/powerstream/services/brightnessService.d.ts +7 -0
  58. package/dist/accessories/powerstream/services/brightnessService.js +27 -0
  59. package/dist/accessories/powerstream/services/brightnessService.js.map +1 -0
  60. package/dist/accessories/powerstream/services/brightnessService.spec.d.ts +1 -0
  61. package/dist/accessories/powerstream/services/outletInvService.d.ts +7 -0
  62. package/dist/accessories/powerstream/services/outletInvService.js +14 -0
  63. package/dist/accessories/powerstream/services/outletInvService.js.map +1 -0
  64. package/dist/accessories/powerstream/services/outletInvService.spec.d.ts +1 -0
  65. package/dist/accessories/powerstream/services/outletService.d.ts +8 -0
  66. package/dist/accessories/powerstream/services/outletService.js +14 -0
  67. package/dist/accessories/powerstream/services/outletService.js.map +1 -0
  68. package/dist/accessories/powerstream/services/outletService.spec.d.ts +1 -0
  69. package/dist/accessories/powerstream/services/powerDemandService.d.ts +7 -0
  70. package/dist/accessories/powerstream/services/powerDemandService.js +27 -0
  71. package/dist/accessories/powerstream/services/powerDemandService.js.map +1 -0
  72. package/dist/accessories/powerstream/services/powerDemandService.spec.d.ts +1 -0
  73. package/dist/accessories/powerstream/simulations/powerStreamSimulator.d.ts +6 -0
  74. package/dist/accessories/powerstream/simulations/powerStreamSimulator.js +39 -0
  75. package/dist/accessories/powerstream/simulations/powerStreamSimulator.js.map +1 -0
  76. package/dist/apis/containers/deviceInfo.d.ts +13 -0
  77. package/dist/apis/containers/deviceInfo.js +23 -0
  78. package/dist/apis/containers/deviceInfo.js.map +1 -0
  79. package/dist/apis/containers/deviceInfo.spec.d.ts +1 -0
  80. package/dist/apis/containers/mqttClientContainer.d.ts +17 -0
  81. package/dist/apis/containers/mqttClientContainer.js +45 -0
  82. package/dist/apis/containers/mqttClientContainer.js.map +1 -0
  83. package/dist/apis/containers/mqttClientContainer.spec.d.ts +1 -0
  84. package/dist/apis/containers/mqttDevice.d.ts +15 -0
  85. package/dist/apis/containers/mqttDevice.js +43 -0
  86. package/dist/apis/containers/mqttDevice.js.map +1 -0
  87. package/dist/apis/containers/mqttDevice.spec.d.ts +1 -0
  88. package/dist/apis/ecoFlowHttpApiManager.d.ts +13 -0
  89. package/dist/apis/{ecoFlowHttpApi.js → ecoFlowHttpApiManager.js} +55 -45
  90. package/dist/apis/ecoFlowHttpApiManager.js.map +1 -0
  91. package/dist/apis/ecoFlowHttpApiManager.spec.d.ts +1 -0
  92. package/dist/apis/ecoFlowMqttApiManager.d.ts +25 -0
  93. package/dist/apis/ecoFlowMqttApiManager.js +152 -0
  94. package/dist/apis/ecoFlowMqttApiManager.js.map +1 -0
  95. package/dist/apis/ecoFlowMqttApiManager.spec.d.ts +1 -0
  96. package/dist/apis/interfaces/httpApiContracts.d.ts +30 -0
  97. package/dist/apis/interfaces/httpApiContracts.js +9 -0
  98. package/dist/apis/interfaces/httpApiContracts.js.map +1 -0
  99. package/dist/apis/interfaces/mqttApiContracts.d.ts +26 -0
  100. package/dist/apis/interfaces/mqttApiContracts.js +9 -0
  101. package/dist/apis/interfaces/mqttApiContracts.js.map +1 -0
  102. package/dist/apis/simulations/mockMqttClient.d.ts +15 -0
  103. package/dist/apis/simulations/mockMqttClient.js +59 -0
  104. package/dist/apis/simulations/mockMqttClient.js.map +1 -0
  105. package/dist/apis/simulations/mockMqttClient.spec.d.ts +1 -0
  106. package/dist/apis/simulations/simulator.d.ts +13 -0
  107. package/dist/apis/simulations/simulator.js +26 -0
  108. package/dist/apis/simulations/simulator.js.map +1 -0
  109. package/dist/characteristics/{CustomCharacteristic.js → customCharacteristic.js} +18 -11
  110. package/dist/characteristics/customCharacteristic.js.map +1 -0
  111. package/dist/characteristics/customCharacteristic.spec.d.ts +1 -0
  112. package/dist/config.d.ts +28 -4
  113. package/dist/config.js +15 -6
  114. package/dist/config.js.map +1 -1
  115. package/dist/helpers/logger.js +5 -1
  116. package/dist/helpers/logger.js.map +1 -1
  117. package/dist/helpers/logger.spec.d.ts +1 -0
  118. package/dist/helpers/machineIdProvider.d.ts +4 -0
  119. package/dist/helpers/machineIdProvider.js +19 -0
  120. package/dist/helpers/machineIdProvider.js.map +1 -0
  121. package/dist/helpers/machineIdProvider.spec.d.ts +1 -0
  122. package/dist/helpers/tests/accessoryTestHelper.d.ts +5 -0
  123. package/dist/helpers/tests/serviceTestHelper.d.ts +6 -0
  124. package/dist/helpers/tests/sleep.d.ts +1 -0
  125. package/dist/homebridge-ui/public/index.d.ts +2 -0
  126. package/dist/homebridge-ui/public/index.html +6 -0
  127. package/dist/homebridge-ui/public/index.js +1 -0
  128. package/dist/homebridge-ui/public/index.spec.d.ts +1 -0
  129. package/dist/homebridge-ui/public/interfaces/contracts.d.ts +13 -0
  130. package/dist/homebridge-ui/public/interfaces/homebridge.d.ts +52 -0
  131. package/dist/homebridge-ui/public/renderers/componentRenderer.d.ts +6 -0
  132. package/dist/homebridge-ui/public/renderers/componentRenderer.spec.d.ts +1 -0
  133. package/dist/homebridge-ui/public/renderers/pluginConfigDevicesRenderer.d.ts +20 -0
  134. package/dist/homebridge-ui/public/renderers/pluginConfigDevicesRenderer.spec.d.ts +1 -0
  135. package/dist/homebridge-ui/public/renderers/pluginConfigNameRenderer.d.ts +5 -0
  136. package/dist/homebridge-ui/public/renderers/pluginConfigNameRenderer.spec.d.ts +1 -0
  137. package/dist/homebridge-ui/public/renderers/pluginConfigRenderer.d.ts +6 -0
  138. package/dist/homebridge-ui/public/renderers/pluginConfigRenderer.spec.d.ts +1 -0
  139. package/dist/homebridge-ui/public/renderers/pluginConfigRendererBase.d.ts +9 -0
  140. package/dist/index.js +7 -4
  141. package/dist/index.js.map +1 -1
  142. package/dist/index.spec.d.ts +1 -0
  143. package/dist/platform.d.ts +11 -8
  144. package/dist/platform.js +88 -32
  145. package/dist/platform.js.map +1 -1
  146. package/dist/platform.spec.d.ts +1 -0
  147. package/dist/services/accessoryInformationService.d.ts +5 -3
  148. package/dist/services/accessoryInformationService.js +15 -12
  149. package/dist/services/accessoryInformationService.js.map +1 -1
  150. package/dist/services/accessoryInformationService.spec.d.ts +1 -0
  151. package/dist/services/batteryStatusService.d.ts +6 -4
  152. package/dist/services/batteryStatusService.js +19 -17
  153. package/dist/services/batteryStatusService.js.map +1 -1
  154. package/dist/services/batteryStatusService.spec.d.ts +1 -0
  155. package/dist/services/fanServiceBase.d.ts +16 -0
  156. package/dist/services/fanServiceBase.js +42 -0
  157. package/dist/services/fanServiceBase.js.map +1 -0
  158. package/dist/services/fanServiceBase.spec.d.ts +1 -0
  159. package/dist/services/lightBulbServiceBase.d.ts +16 -0
  160. package/dist/services/lightBulbServiceBase.js +42 -0
  161. package/dist/services/lightBulbServiceBase.js.map +1 -0
  162. package/dist/services/lightBulbServiceBase.spec.d.ts +1 -0
  163. package/dist/services/outletServiceBase.d.ts +7 -15
  164. package/dist/services/outletServiceBase.js +20 -28
  165. package/dist/services/outletServiceBase.js.map +1 -1
  166. package/dist/services/outletServiceBase.spec.d.ts +1 -0
  167. package/dist/services/serviceBase.d.ts +10 -5
  168. package/dist/services/serviceBase.js +31 -8
  169. package/dist/services/serviceBase.js.map +1 -1
  170. package/dist/settings.js +5 -2
  171. package/dist/settings.js.map +1 -1
  172. package/docs/images/plugin_icon.png +0 -0
  173. package/jest.config.ts +46 -0
  174. package/junit.xml +843 -0
  175. package/package.json +42 -12
  176. package/tsconfig.build.json +5 -0
  177. package/tsconfig.spec.json +8 -0
  178. package/dist/accessories/batteries/batteryAccessory.d.ts +0 -59
  179. package/dist/accessories/batteries/batteryAccessory.js +0 -120
  180. package/dist/accessories/batteries/batteryAccessory.js.map +0 -1
  181. package/dist/accessories/ecoFlowAccessory.d.ts +0 -42
  182. package/dist/accessories/ecoFlowAccessory.js +0 -122
  183. package/dist/accessories/ecoFlowAccessory.js.map +0 -1
  184. package/dist/apis/ecoFlowHttpApi.d.ts +0 -47
  185. package/dist/apis/ecoFlowHttpApi.js.map +0 -1
  186. package/dist/apis/ecoFlowMqttApi.d.ts +0 -53
  187. package/dist/apis/ecoFlowMqttApi.js +0 -100
  188. package/dist/apis/ecoFlowMqttApi.js.map +0 -1
  189. package/dist/characteristics/CustomCharacteristic.js.map +0 -1
  190. package/dist/helpers/machineId.d.ts +0 -2
  191. package/dist/helpers/machineId.js +0 -15
  192. package/dist/helpers/machineId.js.map +0 -1
  193. package/dist/helpers/machineIdHelper.cjs +0 -5
  194. package/dist/services/outletAcService.d.ts +0 -8
  195. package/dist/services/outletAcService.js +0 -17
  196. package/dist/services/outletAcService.js.map +0 -1
  197. package/dist/services/outletCarService.d.ts +0 -6
  198. package/dist/services/outletCarService.js +0 -12
  199. package/dist/services/outletCarService.js.map +0 -1
  200. package/dist/services/outletUsbService.d.ts +0 -6
  201. package/dist/services/outletUsbService.js +0 -10
  202. package/dist/services/outletUsbService.js.map +0 -1
  203. /package/dist/characteristics/{CustomCharacteristic.d.ts → customCharacteristic.d.ts} +0 -0
package/.gitattributes ADDED
@@ -0,0 +1,7 @@
1
+ *.* text eol=lf
2
+ *.png binary -crlf
3
+ *.ico binary -crlf
4
+ *.jpg binary -crlf
5
+ *.jpeg binary -crlf
6
+ *.gif binary -crlf
7
+ *.pdf binary -crlf
package/.prettierrc.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "tabWidth": 2,
3
3
  "useTabs": false,
4
4
  "singleQuote": true,
5
+ "quoteProps": "as-needed",
5
6
  "semi": true,
6
7
  "bracketSpacing": true,
7
8
  "arrowParens": "avoid",
package/README.md CHANGED
@@ -1,13 +1,18 @@
1
1
  <span align="center">
2
2
 
3
- # homebridge-ecoflow
3
+ # @pietrolubini/homebridge-ecoflow
4
4
 
5
- [![homebridge-ecoflow](https://img.shields.io/npm/v/@pietrolubini/homebridge-ecoflow.svg)](https://www.npmjs.com/package/@pietrolubini/homebridge-ecoflow)
6
- [![mit-license](https://badgen.net/npm/license/lodash)](https://github.com/pietrolubini/homebridge-ecoflow/blob/main/LICENSE)
5
+ [![latest](https://img.shields.io/npm/v/@pietrolubini/homebridge-ecoflow.svg?label=stable)](https://www.npmjs.com/package/@pietrolubini/homebridge-ecoflow/v/latest)
6
+ [![beta](https://img.shields.io/npm/v/@pietrolubini/homebridge-ecoflow/beta.svg?label=beta)](https://www.npmjs.com/package/@pietrolubini/homebridge-ecoflow/v/beta)
7
+ [![downloads](https://img.shields.io/npm/dt/@pietrolubini/homebridge-ecoflow.svg)](https://www.npmjs.com/package/@pietrolubini/homebridge-ecoflow)
8
+ [![build](https://github.com/pietrolubini/homebridge-ecoflow/actions/workflows/build.yml/badge.svg)](https://github.com/pietrolubini/homebridge-ecoflow/actions/workflows/build.yml)
9
+ [![license](https://img.shields.io/npm/l/@pietrolubini/homebridge-ecoflow)](https://github.com/pietrolubini/homebridge-ecoflow/blob/main/LICENSE)
10
+ [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
11
+ [![Donate](https://img.shields.io/badge/donate-Coinbase-blue)](https://commerce.coinbase.com/checkout/d56df2da-7609-41a3-af91-289cb6ec4d9b)
7
12
 
8
13
  </span>
9
14
 
10
- `homebridge-ecoflow` is a plugin for homebridge which allows you to control EcoFlow devices!
15
+ `@pietrolubini/homebridge-ecoflow` is a plugin for homebridge which allows you to control EcoFlow devices!
11
16
  The goal is to add HomeKit support to EcoFlow devices and make them fully controllable from the native HomeKit iOS app and Siri.
12
17
 
13
18
  > Feedback and contribution is helpful and will improve the plugin!
@@ -20,10 +25,11 @@ The goal is to add HomeKit support to EcoFlow devices and make them fully contro
20
25
  - Fully customizable HomeKit accessories
21
26
  - HomeKit automations for your EcoFlow devices
22
27
 
23
- ## Supported device types
28
+ ## Supported Device Types
24
29
 
25
- - Delta 2
26
- - Delta 2 Max
30
+ - [Delta 2](#delta-2)
31
+ - [Delta 2 Max](#delta-2-max)
32
+ - [PowerStream Micro-inverter](#powerstream-micro-inverter)
27
33
 
28
34
  For a full list of devices that could be potentially added check [here](https://developer-eu.ecoflow.com/us/document/introduction)
29
35
 
@@ -39,18 +45,15 @@ sudo npm install -g @pietrolubini/homebridge-ecoflow
39
45
 
40
46
  ## Configuration
41
47
 
42
- Add the `EcoFlowHomebridge` platform in `config.json` in your home directory inside `.homebridge`.
48
+ Add the `EcoFlowHomebridge` platform in `config.json` in your home directory inside `.homebridge`. Add your devices in the `devices` array. Example of configuration:
43
49
 
44
- Add your devices in the `devices` array.
45
-
46
- Example configuration:
47
-
48
- ```js
50
+ ```json
49
51
  {
50
52
  "platforms": [
51
53
  {
52
54
  "devices": [
53
55
  {
56
+ "disabled": false,
54
57
  "name": "Battery",
55
58
  "model": "Delta 2 Max",
56
59
  "serialNumber": "R123ABCDEGHI321",
@@ -59,26 +62,91 @@ Example configuration:
59
62
  "secretKey": "yBwYgZWqNnAlULKmF1Qrydy2Iheexj22"
60
63
  }
61
64
  ],
62
- "platform": "EcoFlowHomebridge",
65
+ "name": "Homebridge EcoFlow",
66
+ "platform": "EcoFlowHomebridge"
63
67
  }
64
68
  ]
65
69
  }
66
70
  ```
67
71
 
68
- ### Battery-specific Configuration
72
+ ### AccessKey and SecretKey
73
+
74
+ For the plugin to work EcoFlow account's `AccessKey` and `SecretKey` is required. To retrieve them
75
+
76
+ - Register on [EcoFlow IoT Developer Platform](https://developer-eu.ecoflow.com/)
77
+ - Wait until your request will be approved
78
+ - Generate `AccessKey`/`SecretKey` pair [here](https://developer-eu.ecoflow.com/us/security)
79
+
80
+ ### Simulate Accessory
69
81
 
70
- If `devices`.`model` is one of [`Delta 2`, `Delta 2 Max`] it is possible to set turn on/off additional characteristics:
82
+ It is possible to simulate accessory by adding `simulate` property to device's configuration (`accessKey` and `secretKey` could contain mock values).
83
+ Quota is sent every 10 seconds with random values in this mode.
84
+
85
+ > 🛈 Each simulated device should have fake unique `serialNumber`, `accessKey` and `secretKey`
86
+
87
+ ```json
88
+ {
89
+ "platforms": [
90
+ {
91
+ "devices": [
92
+ {
93
+ "disabled": false,
94
+ "name": "Battery",
95
+ "model": "Delta 2 Max",
96
+ "serialNumber": "R123ABCDEGHI321",
97
+ "accessKey": "key1",
98
+ "secretKey": "key2",
99
+ "simulate": true
100
+ }
101
+ ],
102
+ "name": "Homebridge EcoFlow",
103
+ "platform": "EcoFlowHomebridge"
104
+ }
105
+ ]
106
+ }
107
+ ```
108
+
109
+ ## Supported Devices
110
+
111
+ ### Delta 2
112
+
113
+ #### Services
114
+
115
+ | EcoFlow Parameter | Service | Characteristic | Standard | Permission |
116
+ | ----------------- | ---------- | --------------------- | -------- | ---------- |
117
+ | Battery Level | Battery | BatteryLevel | ✅ | Read |
118
+ | Input | Battery | ChargingState | ✅ | Read |
119
+ | Battery Level | Battery | StatusLowBattery | ✅ | Read |
120
+ | AC | Outlet AC | On | ✅ | Read/Write |
121
+ | AC Output | Outlet AC | OutletInUse | ✅ | Read |
122
+ | Battery Level | Outlet AC | Battery Level, % | 🔲 | Read |
123
+ | Input | Outlet AC | Input Consumption, W | 🔲 | Read |
124
+ | Output | Outlet AC | Output Consumption, W | 🔲 | Read |
125
+ | 12V DC | Outlet CAR | On | ✅ | Read/Write |
126
+ | 12V DC Output | Outlet CAR | OutletInUse | ✅ | Read |
127
+ | Battery Level | Outlet CAR | Battery Level, % | 🔲 | Read |
128
+ | Input | Outlet CAR | Input Consumption, W | 🔲 | Read |
129
+ | Output | Outlet CAR | Output Consumption, W | 🔲 | Read |
130
+ | USB | Outlet USB | On | ✅ | Read/Write |
131
+ | USB Output | Outlet USB | OutletInUse | ✅ | Read |
132
+ | Battery Level | Outlet USB | Battery Level, % | 🔲 | Read |
133
+ | Input | Outlet USB | Input Consumption, W | 🔲 | Read |
134
+ | Output | Outlet USB | Output Consumption, W | 🔲 | Read |
135
+
136
+ #### Configuration
137
+
138
+ The following additional characteristics is available:
71
139
 
72
140
  - Input Consumption, W
73
141
  - Output Consumption, W
74
142
  - Battery Level, %
75
143
 
76
- ```js
144
+ ```json
77
145
  {
78
146
  ...
79
147
  "devices": [
80
148
  {
81
- ...,
149
+ ...
82
150
  "model": "Delta 2 Max",
83
151
  "battery": {
84
152
  "additionalCharacteristics": [
@@ -96,13 +164,74 @@ The characteristics could be used as conditions in HomeKit Automation that uses
96
164
 
97
165
  <img src="docs/images/BatteryAdditionalCharacteristics.jpg" alt="Battery Additional Characteristics" width="300">
98
166
 
99
- ### AccessKey and SecretKey
167
+ ### Delta 2 Max
168
+
169
+ Supported services and configuration are the same as for [Delta 2](#delta-2)
170
+
171
+ ### PowerStream Micro-inverter
172
+
173
+ #### Services
174
+
175
+ | EcoFlow Parameter | Service | Characteristic | Standard | Permission |
176
+ | ------------------- | ---------- | --------------------- | -------- | ---------------------------------------------------- |
177
+ | Inverter | Outlet INV | On | ✅ | Read (Inverter AC Output > 0: ON) |
178
+ | Inverter AC Output | Outlet INV | OutletInUse | ✅ | Read |
179
+ | Inverter AC Input | Outlet INV | Input Consumption, W | 🔲 | Read |
180
+ | Inverter AC Output | Outlet INV | Output Consumption, W | 🔲 | Read |
181
+ | Solar | Outlet PV | On | ✅ | Read (Solar Generation > 0: ON) |
182
+ | Solar Generation | Outlet PV | OutletInUse | ✅ | Read |
183
+ | Solar Generation | Outlet PV | Output Consumption, W | 🔲 | Read |
184
+ | Battery | Outlet BAT | On | ✅ | Read (Battery Discharging > 0: ON) |
185
+ | Battery Discharging | Outlet BAT | OutletInUse | ✅ | Read |
186
+ | Battery Level | Outlet BAT | Battery Level, % | 🔲 | Read |
187
+ | Battery Charging | Outlet BAT | Input Consumption, W | 🔲 | Read |
188
+ | Battery Discharging | Outlet BAT | Output Consumption, W | 🔲 | Read |
189
+ | Lighting brightness | Lightbulb | On | ✅ | Read (> 0%: ON; 0%: OFF) / write (ON: 100%; OFF: 0%) |
190
+ | Lighting brightness | Lightbulb | Brightness | ✅ | Read/write |
191
+ | Power demand | Fan | On | ✅ | Read (> 0%: ON; 0%: OFF) / write (ON: 100%; OFF: 0%) |
192
+ | Power demand | Fan | RotationSpeed | ✅ | Read/write |
193
+
194
+ #### Configuration
195
+
196
+ The following additional characteristics is available:
197
+
198
+ - type (600, 800)
199
+ - battery:
200
+ - Input Consumption, W
201
+ - Output Consumption, W
202
+ - Battery Level, %
203
+ - pv:
204
+ - Output Consumption, W
205
+ - inverter:
206
+ - Input Consumption, W
207
+ - Output Consumption, W
100
208
 
101
- For the plugin to work EcoFlow account's `AccessKey` and `SecretKey` is required. To retrieve them
102
-
103
- - Register on [EcoFlow IoT Developer Platform](https://developer-eu.ecoflow.com/)
104
- - Wait until your request will be approved
105
- - Generate `AccessKey`/`SecretKey` pair [here](https://developer-eu.ecoflow.com/us/security)
209
+ ```json
210
+ {
211
+ ...
212
+ "devices": [
213
+ {
214
+ ...
215
+ "model": "PowerStream",
216
+ "powerStream": {
217
+ "type": "800",
218
+ "batteryAdditionalCharacteristics": [
219
+ "Battery Level, %",
220
+ "Input Consumption, W",
221
+ "Output Consumption, W"
222
+ ],
223
+ "pvAdditionalCharacteristics": [
224
+ "Output Consumption, W"
225
+ ],
226
+ "inverterAdditionalCharacteristics": [
227
+ "Input Consumption, W",
228
+ "Output Consumption, W"
229
+ ]
230
+ }
231
+ }
232
+ ],
233
+ }
234
+ ```
106
235
 
107
236
  ## Troubleshooting
108
237
 
@@ -2,6 +2,8 @@
2
2
  "pluginAlias": "EcoFlowHomebridge",
3
3
  "pluginType": "platform",
4
4
  "singular": true,
5
+ "customUi": true,
6
+ "customUiPath": "./dist/homebridge-ui",
5
7
  "schema": {
6
8
  "type": "object",
7
9
  "properties": {
@@ -12,6 +14,7 @@
12
14
  "required": true
13
15
  },
14
16
  "devices": {
17
+ "title": "Devices",
15
18
  "type": "array",
16
19
  "required": true,
17
20
  "uniqueItems": true,
@@ -27,8 +30,9 @@
27
30
  "model": {
28
31
  "title": "Model",
29
32
  "type": "string",
33
+ "default": "Delta 2",
30
34
  "required": true,
31
- "enum": ["Delta 2", "Delta 2 Max"]
35
+ "enum": ["Delta 2", "Delta 2 Max", "PowerStream"]
32
36
  },
33
37
  "serialNumber": {
34
38
  "title": "Serial Number",
@@ -56,12 +60,24 @@
56
60
  "required": true,
57
61
  "description": "Secret Key from \"EcoFlow IoT Developer Platform\" (https://developer-eu.ecoflow.com)"
58
62
  },
63
+ "disabled": {
64
+ "title": "Disabled",
65
+ "type": "boolean",
66
+ "required": false,
67
+ "description": "A value indicating whether device should be ignored"
68
+ },
69
+ "simulate": {
70
+ "title": "Simulate",
71
+ "type": "boolean",
72
+ "required": false,
73
+ "description": "A value indicating whether device should be simulated"
74
+ },
59
75
  "battery": {
60
76
  "title": "Battery Settings",
61
77
  "type": "object",
62
78
  "properties": {
63
79
  "additionalCharacteristics": {
64
- "title": "Additional characteristics",
80
+ "title": "Battery Additional Characteristics",
65
81
  "description": "List of additional characteristics for battery",
66
82
  "type": "array",
67
83
  "uniqueItems": true,
@@ -72,6 +88,53 @@
72
88
  }
73
89
  }
74
90
  }
91
+ },
92
+ "powerStream": {
93
+ "title": "PowerStream Settings",
94
+ "type": "object",
95
+ "properties": {
96
+ "type": {
97
+ "title": "Type",
98
+ "type": "string",
99
+ "required": true,
100
+ "default": "600",
101
+ "enum": ["600", "800"],
102
+ "description": "Maximum power, W"
103
+ },
104
+ "batteryAdditionalCharacteristics": {
105
+ "title": "Battery Additional Characteristics",
106
+ "description": "List of additional characteristics for Battery connected to PowerStream",
107
+ "type": "array",
108
+ "uniqueItems": true,
109
+ "items": {
110
+ "title": "Characteristic",
111
+ "type": "string",
112
+ "enum": ["Battery Level, %", "Input Consumption, W", "Output Consumption, W"]
113
+ }
114
+ },
115
+ "pvAdditionalCharacteristics": {
116
+ "title": "PV Additional Characteristics",
117
+ "description": "List of additional characteristics for PVs connected for PowerStream",
118
+ "type": "array",
119
+ "uniqueItems": true,
120
+ "items": {
121
+ "title": "Characteristic",
122
+ "type": "string",
123
+ "enum": ["Output Consumption, W"]
124
+ }
125
+ },
126
+ "inverterAdditionalCharacteristics": {
127
+ "title": "Inverter Additional Characteristics",
128
+ "description": "List of additional characteristics for PowerStream",
129
+ "type": "array",
130
+ "uniqueItems": true,
131
+ "items": {
132
+ "title": "Characteristic",
133
+ "type": "string",
134
+ "enum": ["Input Consumption, W", "Output Consumption, W"]
135
+ }
136
+ }
137
+ }
75
138
  }
76
139
  }
77
140
  }
@@ -0,0 +1,26 @@
1
+ import { BatteryAllQuotaData } from '@ecoflow/accessories/batteries/interfaces/httpApiBatteryContracts';
2
+ import { EcoFlowAccessoryWithQuotaBase } from '@ecoflow/accessories/ecoFlowAccessoryWithQuotaBase';
3
+ import { EcoFlowHttpApiManager } from '@ecoflow/apis/ecoFlowHttpApiManager';
4
+ import { EcoFlowMqttApiManager } from '@ecoflow/apis/ecoFlowMqttApiManager';
5
+ import { MqttQuotaMessage } from '@ecoflow/apis/interfaces/mqttApiContracts';
6
+ import { DeviceConfig } from '@ecoflow/config';
7
+ import { EcoFlowHomebridgePlatform } from '@ecoflow/platform';
8
+ import { ServiceBase } from '@ecoflow/services/serviceBase';
9
+ import { Logging, PlatformAccessory } from 'homebridge';
10
+ export declare abstract class BatteryAccessoryBase extends EcoFlowAccessoryWithQuotaBase<BatteryAllQuotaData> {
11
+ private readonly batteryService;
12
+ private readonly outletUsbService;
13
+ private readonly outletAcService;
14
+ private readonly outletCarService;
15
+ constructor(platform: EcoFlowHomebridgePlatform, accessory: PlatformAccessory, config: DeviceConfig, log: Logging, httpApiManager: EcoFlowHttpApiManager, mqttApiManager: EcoFlowMqttApiManager);
16
+ protected getServices(): ServiceBase[];
17
+ protected processQuotaMessage(message: MqttQuotaMessage): void;
18
+ protected initializeQuota(quota: BatteryAllQuotaData | null): BatteryAllQuotaData;
19
+ protected updateInitialValues(initialData: BatteryAllQuotaData): void;
20
+ private updateEmsInitialValues;
21
+ private updateInvInitialValues;
22
+ private updatePdInitialValues;
23
+ private updateEmsValues;
24
+ private updateInvValues;
25
+ private updatePdValues;
26
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BatteryAccessoryBase = void 0;
4
+ const mqttApiBatteryContracts_1 = require("@ecoflow/accessories/batteries/interfaces/mqttApiBatteryContracts");
5
+ const outletAcService_1 = require("@ecoflow/accessories/batteries/services/outletAcService");
6
+ const outletCarService_1 = require("@ecoflow/accessories/batteries/services/outletCarService");
7
+ const outletUsbService_1 = require("@ecoflow/accessories/batteries/services/outletUsbService");
8
+ const ecoFlowAccessoryWithQuotaBase_1 = require("@ecoflow/accessories/ecoFlowAccessoryWithQuotaBase");
9
+ const batteryStatusService_1 = require("@ecoflow/services/batteryStatusService");
10
+ class BatteryAccessoryBase extends ecoFlowAccessoryWithQuotaBase_1.EcoFlowAccessoryWithQuotaBase {
11
+ batteryService;
12
+ outletUsbService;
13
+ outletAcService;
14
+ outletCarService;
15
+ constructor(platform, accessory, config, log, httpApiManager, mqttApiManager) {
16
+ super(platform, accessory, config, log, httpApiManager, mqttApiManager);
17
+ this.batteryService = new batteryStatusService_1.BatteryStatusService(this);
18
+ this.outletUsbService = new outletUsbService_1.OutletUsbService(this);
19
+ this.outletAcService = new outletAcService_1.OutletAcService(this);
20
+ this.outletCarService = new outletCarService_1.OutletCarService(this);
21
+ }
22
+ getServices() {
23
+ return [this.batteryService, this.outletUsbService, this.outletAcService, this.outletCarService];
24
+ }
25
+ processQuotaMessage(message) {
26
+ const batteryMessage = message;
27
+ if (batteryMessage.typeCode === mqttApiBatteryContracts_1.MqttBatteryMessageType.EMS) {
28
+ const emsStatus = message.params;
29
+ Object.assign(this.quota.bms_emsStatus, emsStatus);
30
+ this.updateEmsValues(emsStatus);
31
+ }
32
+ else if (batteryMessage.typeCode === mqttApiBatteryContracts_1.MqttBatteryMessageType.INV) {
33
+ const invStatus = message.params;
34
+ Object.assign(this.quota.inv, invStatus);
35
+ this.updateInvValues(invStatus);
36
+ }
37
+ else if (batteryMessage.typeCode === mqttApiBatteryContracts_1.MqttBatteryMessageType.PD) {
38
+ const pdStatus = message.params;
39
+ Object.assign(this.quota.pd, pdStatus);
40
+ this.updatePdValues(pdStatus);
41
+ }
42
+ }
43
+ initializeQuota(quota) {
44
+ const result = quota ?? {};
45
+ if (!result.bms_emsStatus) {
46
+ result.bms_emsStatus = {};
47
+ }
48
+ if (!result.inv) {
49
+ result.inv = {};
50
+ }
51
+ if (!result.pd) {
52
+ result.pd = {};
53
+ }
54
+ return result;
55
+ }
56
+ updateInitialValues(initialData) {
57
+ this.updateEmsInitialValues(initialData.bms_emsStatus);
58
+ this.updateInvInitialValues(initialData.inv);
59
+ this.updatePdInitialValues(initialData.pd);
60
+ }
61
+ updateEmsInitialValues(params) {
62
+ const message = {
63
+ typeCode: mqttApiBatteryContracts_1.MqttBatteryMessageType.EMS,
64
+ params,
65
+ };
66
+ this.processQuotaMessage(message);
67
+ }
68
+ updateInvInitialValues(params) {
69
+ const message = {
70
+ typeCode: mqttApiBatteryContracts_1.MqttBatteryMessageType.INV,
71
+ params,
72
+ };
73
+ this.processQuotaMessage(message);
74
+ }
75
+ updatePdInitialValues(params) {
76
+ const message = {
77
+ typeCode: mqttApiBatteryContracts_1.MqttBatteryMessageType.PD,
78
+ params,
79
+ };
80
+ this.processQuotaMessage(message);
81
+ }
82
+ updateEmsValues(params) {
83
+ if (params.f32LcdShowSoc !== undefined) {
84
+ this.batteryService.updateBatteryLevel(params.f32LcdShowSoc);
85
+ this.outletAcService.updateBatteryLevel(params.f32LcdShowSoc);
86
+ this.outletUsbService.updateBatteryLevel(params.f32LcdShowSoc);
87
+ this.outletCarService.updateBatteryLevel(params.f32LcdShowSoc);
88
+ }
89
+ }
90
+ updateInvValues(params) {
91
+ if (params.inputWatts !== undefined) {
92
+ this.batteryService.updateChargingState(params.inputWatts);
93
+ this.outletAcService.updateInputConsumption(params.inputWatts);
94
+ this.outletUsbService.updateInputConsumption(params.inputWatts);
95
+ this.outletCarService.updateInputConsumption(params.inputWatts);
96
+ }
97
+ if (params.cfgAcEnabled !== undefined) {
98
+ this.outletAcService.updateState(params.cfgAcEnabled);
99
+ }
100
+ if (params.outputWatts !== undefined) {
101
+ this.outletAcService.updateOutputConsumption(params.outputWatts);
102
+ }
103
+ }
104
+ updatePdValues(params) {
105
+ if (params.carState !== undefined) {
106
+ this.outletCarService.updateState(params.carState);
107
+ }
108
+ if (params.carWatts !== undefined) {
109
+ this.outletCarService.updateOutputConsumption(params.carWatts);
110
+ }
111
+ if (params.dcOutState !== undefined) {
112
+ this.outletUsbService.updateState(params.dcOutState);
113
+ }
114
+ if (params.usb1Watts !== undefined ||
115
+ params.usb2Watts !== undefined ||
116
+ params.qcUsb1Watts !== undefined ||
117
+ params.qcUsb2Watts !== undefined ||
118
+ params.typec1Watts !== undefined ||
119
+ params.typec2Watts !== undefined) {
120
+ const usbWatts = this.sum(params.usb1Watts, params.usb2Watts, params.qcUsb1Watts, params.qcUsb2Watts, params.typec1Watts, params.typec2Watts);
121
+ this.outletUsbService.updateOutputConsumption(usbWatts);
122
+ }
123
+ }
124
+ }
125
+ exports.BatteryAccessoryBase = BatteryAccessoryBase;
126
+ //# sourceMappingURL=batteryAccessoryBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batteryAccessoryBase.js","sourceRoot":"","sources":["../../../src/accessories/batteries/batteryAccessoryBase.ts"],"names":[],"mappings":";;;AAMA,+GAI2E;AAC3E,6FAA0F;AAC1F,+FAA4F;AAC5F,+FAA4F;AAC5F,sGAAmG;AAMnG,iFAA8E;AAI9E,MAAsB,oBAAqB,SAAQ,6DAAkD;IAClF,cAAc,CAAuB;IACrC,gBAAgB,CAAmB;IACnC,eAAe,CAAkB;IACjC,gBAAgB,CAAmB;IAEpD,YACE,QAAmC,EACnC,SAA4B,EAC5B,MAAoB,EACpB,GAAY,EACZ,cAAqC,EACrC,cAAqC;QAErC,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,cAAc,GAAG,IAAI,2CAAoB,CAAC,IAAI,CAAC,CAAC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AC;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC;QACD,IACE,MAAM,CAAC,SAAS,KAAK,SAAS;YAC9B,MAAM,CAAC,SAAS,KAAK,SAAS;YAC9B,MAAM,CAAC,WAAW,KAAK,SAAS;YAChC,MAAM,CAAC,WAAW,KAAK,SAAS;YAChC,MAAM,CAAC,WAAW,KAAK,SAAS;YAChC,MAAM,CAAC,WAAW,KAAK,SAAS,EAChC,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACvB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,CACnB,CAAC;YACF,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;CACF;AA3ID,oDA2IC"}
@@ -1,3 +1,3 @@
1
- import { BatteryAccessory } from './batteryAccessory.js';
2
- export declare class Delta2Accessory extends BatteryAccessory {
1
+ import { BatteryAccessoryBase } from '@ecoflow/accessories/batteries/batteryAccessoryBase';
2
+ export declare class Delta2Accessory extends BatteryAccessoryBase {
3
3
  }
@@ -1,4 +1,8 @@
1
- import { BatteryAccessory } from './batteryAccessory.js';
2
- export class Delta2Accessory extends BatteryAccessory {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Delta2Accessory = void 0;
4
+ const batteryAccessoryBase_1 = require("@ecoflow/accessories/batteries/batteryAccessoryBase");
5
+ class Delta2Accessory extends batteryAccessoryBase_1.BatteryAccessoryBase {
3
6
  }
7
+ exports.Delta2Accessory = Delta2Accessory;
4
8
  //# sourceMappingURL=delta2Accessory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"delta2Accessory.js","sourceRoot":"","sources":["../../../src/accessories/batteries/delta2Accessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,OAAO,eAAgB,SAAQ,gBAAgB;CAAG"}
1
+ {"version":3,"file":"delta2Accessory.js","sourceRoot":"","sources":["../../../src/accessories/batteries/delta2Accessory.ts"],"names":[],"mappings":";;;AAAA,8FAA2F;AAE3F,MAAa,eAAgB,SAAQ,2CAAoB;CAAG;AAA5D,0CAA4D"}
@@ -1,3 +1,3 @@
1
- import { BatteryAccessory } from './batteryAccessory.js';
2
- export declare class Delta2MaxAccessory extends BatteryAccessory {
1
+ import { BatteryAccessoryBase } from '@ecoflow/accessories/batteries/batteryAccessoryBase';
2
+ export declare class Delta2MaxAccessory extends BatteryAccessoryBase {
3
3
  }
@@ -1,4 +1,8 @@
1
- import { BatteryAccessory } from './batteryAccessory.js';
2
- export class Delta2MaxAccessory extends BatteryAccessory {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Delta2MaxAccessory = void 0;
4
+ const batteryAccessoryBase_1 = require("@ecoflow/accessories/batteries/batteryAccessoryBase");
5
+ class Delta2MaxAccessory extends batteryAccessoryBase_1.BatteryAccessoryBase {
3
6
  }
7
+ exports.Delta2MaxAccessory = Delta2MaxAccessory;
4
8
  //# sourceMappingURL=delta2maxAccessory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"delta2maxAccessory.js","sourceRoot":"","sources":["../../../src/accessories/batteries/delta2maxAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,OAAO,kBAAmB,SAAQ,gBAAgB;CAAG"}
1
+ {"version":3,"file":"delta2maxAccessory.js","sourceRoot":"","sources":["../../../src/accessories/batteries/delta2maxAccessory.ts"],"names":[],"mappings":";;;AAAA,8FAA2F;AAE3F,MAAa,kBAAmB,SAAQ,2CAAoB;CAAG;AAA/D,gDAA+D"}
@@ -0,0 +1,33 @@
1
+ export interface EmsStatus {
2
+ f32LcdShowSoc?: number;
3
+ }
4
+ export interface InvStatusAc {
5
+ outputWatts?: number;
6
+ cfgAcEnabled?: boolean;
7
+ cfgAcXboost?: boolean;
8
+ cfgAcOutFreq?: number;
9
+ cfgAcOutVol?: number;
10
+ }
11
+ export interface InvStatus extends InvStatusAc {
12
+ inputWatts?: number;
13
+ }
14
+ export interface PdStatusCar {
15
+ carState?: boolean;
16
+ carWatts?: number;
17
+ }
18
+ export interface PdStatusUsb {
19
+ dcOutState?: boolean;
20
+ usb1Watts?: number;
21
+ usb2Watts?: number;
22
+ qcUsb1Watts?: number;
23
+ qcUsb2Watts?: number;
24
+ typec1Watts?: number;
25
+ typec2Watts?: number;
26
+ }
27
+ export interface PdStatus extends PdStatusUsb, PdStatusCar {
28
+ }
29
+ export interface BatteryAllQuotaData {
30
+ bms_emsStatus: EmsStatus;
31
+ inv: InvStatus;
32
+ pd: PdStatus;
33
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=httpApiBatteryContracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpApiBatteryContracts.js","sourceRoot":"","sources":["../../../../src/accessories/batteries/interfaces/httpApiBatteryContracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ import { MqttQuotaMessage, MqttQuotaMessageWithParams, MqttSetMessage, MqttSetMessageWithParams, MqttSetReplyMessage } from '@ecoflow/apis/interfaces/mqttApiContracts';
2
+ export declare enum MqttBatteryMessageType {
3
+ PD = "pdStatus",
4
+ MPPT = "mpptStatus",
5
+ INV = "invStatus",
6
+ BMS = "bmsStatus",
7
+ EMS = "emsStatus"
8
+ }
9
+ export interface MqttBatteryQuotaMessage extends MqttQuotaMessage {
10
+ typeCode: MqttBatteryMessageType;
11
+ }
12
+ export interface MqttBatteryQuotaMessageWithParams<TParams> extends MqttQuotaMessageWithParams<TParams>, MqttBatteryQuotaMessage {
13
+ }
14
+ export declare enum MqttBatterySetOperationType {
15
+ MpptCar = "mpptCar",
16
+ DcOutCfg = "dcOutCfg",
17
+ AcOutCfg = "acOutCfg"
18
+ }
19
+ export interface MqttBatterySetMessage extends MqttSetMessage {
20
+ operateType: MqttBatterySetOperationType;
21
+ moduleType: number;
22
+ }
23
+ export interface MqttBatterySetMessageWithParams<TParams> extends MqttSetMessageWithParams<TParams>, MqttBatterySetMessage {
24
+ }
25
+ export interface MqttBatterySetOnMessageParams {
26
+ enabled: number;
27
+ }
28
+ export interface MqttBatterySetAcOnMessageParams extends MqttBatterySetOnMessageParams {
29
+ out_voltage: number;
30
+ out_freq: number;
31
+ xboost: number;
32
+ }
33
+ export interface MqttBatterySetReplyMessage extends MqttSetReplyMessage {
34
+ operateType: MqttBatterySetOperationType;
35
+ moduleType: number;
36
+ }