iobroker.zendure-solarflow 1.8.0 → 1.8.1
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/README.md
CHANGED
|
@@ -46,10 +46,9 @@ If you find the adapter useful for you and want to support my work, feel free to
|
|
|
46
46
|
[](https://www.paypal.com/paypalme/PeterFrommert)
|
|
47
47
|
|
|
48
48
|
## Changelog
|
|
49
|
-
### 1.8.
|
|
49
|
+
### 1.8.1 (2024-08-06)
|
|
50
50
|
|
|
51
|
-
- Fix
|
|
52
|
-
- Add Calculation for Grid Input (only for Ace 1500 and Hyper 2000)
|
|
51
|
+
- Fix Control State
|
|
53
52
|
|
|
54
53
|
### 1.7.7 (2024-08-02)
|
|
55
54
|
|
|
@@ -119,15 +119,6 @@ const createSolarFlowStates = async (adapter, device, type) => {
|
|
|
119
119
|
"electricLevel",
|
|
120
120
|
device.electricity
|
|
121
121
|
);
|
|
122
|
-
if (adapter.config.useCalculation && type != "smartPlug") {
|
|
123
|
-
await (0, import_adapterService.updateSolarFlowControlState)(
|
|
124
|
-
adapter,
|
|
125
|
-
device.productKey,
|
|
126
|
-
device.deviceKey,
|
|
127
|
-
"soc",
|
|
128
|
-
device.electricity
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
122
|
}
|
|
132
123
|
if (device.snNumber) {
|
|
133
124
|
await (0, import_adapterService.updateSolarFlowState)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers/createSolarFlowStates.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/indent */\r\n\r\nimport { aceStates } from \"../constants/aceStates\";\r\nimport { aioStates } from \"../constants/aioStates\";\r\nimport { hubStates } from \"../constants/hubStates\";\r\nimport { hyperStates } from \"../constants/hyperStates\";\r\nimport { smartPlugStates } from \"../constants/smartPlugStates\";\r\nimport { ZendureSolarflow } from \"../main\";\r\nimport { ISolarFlowDeviceDetails } from \"../models/ISolarFlowDeviceDetails\";\r\nimport { ISolarflowState } from \"../models/ISolarflowState\";\r\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAA0B;AAC1B,uBAA0B;AAC1B,uBAA0B;AAC1B,yBAA4B;AAC5B,6BAAgC;AAIhC,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/indent */\r\n\r\nimport { aceStates } from \"../constants/aceStates\";\r\nimport { aioStates } from \"../constants/aioStates\";\r\nimport { hubStates } from \"../constants/hubStates\";\r\nimport { hyperStates } from \"../constants/hyperStates\";\r\nimport { smartPlugStates } from \"../constants/smartPlugStates\";\r\nimport { ZendureSolarflow } from \"../main\";\r\nimport { ISolarFlowDeviceDetails } from \"../models/ISolarFlowDeviceDetails\";\r\nimport { ISolarflowState } from \"../models/ISolarflowState\";\r\nimport { updateSolarFlowState } from \"../services/adapterService\";\r\nimport { createCalculationStates } from \"./createCalculationStates\";\r\nimport { createControlStates } from \"./createControlStates\";\r\n//import { deleteCalculationStates } from \"./deleteCalculationStates\";\r\n\r\nexport const getStateDefinition = (type: string): ISolarflowState[] => {\r\n switch (type) {\r\n case \"aio\":\r\n return aioStates;\r\n case \"hyper\":\r\n return hyperStates;\r\n case \"solarflow\":\r\n return hubStates;\r\n case \"ace\":\r\n return aceStates;\r\n case \"smartPlug\":\r\n return smartPlugStates;\r\n default:\r\n return [];\r\n }\r\n};\r\n\r\nexport const createSolarFlowStates = async (\r\n adapter: ZendureSolarflow,\r\n device: ISolarFlowDeviceDetails,\r\n type: string\r\n): Promise<void> => {\r\n const productKey = device.productKey.replace(adapter.FORBIDDEN_CHARS, \"\");\r\n const deviceKey = device.deviceKey.replace(adapter.FORBIDDEN_CHARS, \"\");\r\n\r\n adapter.log.debug(\r\n `[createSolarFlowStates] Creating or updating SolarFlow states for ${device.productName} (${productKey}/${deviceKey}) and name '${device.name}'.`\r\n );\r\n\r\n // Create device (e.g. the product type -> SolarFlow)\r\n await adapter?.extendObject(productKey, {\r\n type: \"device\",\r\n common: {\r\n name: {\r\n de: `${device.productName} (${productKey})`,\r\n en: `${device.productName} (${productKey})`,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // Create channel (e.g. the device specific key)\r\n await adapter?.extendObject(productKey + \".\" + deviceKey, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: `${device.name} (${deviceKey})`,\r\n en: `${device.name} (${deviceKey})`,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // Create calculations folder\r\n await adapter?.extendObject(`${productKey}.${deviceKey}.calculations`, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: \"Berechnungen f\u00FCr Ger\u00E4t \" + deviceKey,\r\n en: \"Calculations for Device \" + deviceKey,\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n // Create pack data folder\r\n await adapter?.extendObject(`${productKey}.${deviceKey}.packData`, {\r\n type: \"channel\",\r\n common: {\r\n name: {\r\n de: \"Batterie Packs\",\r\n en: \"Battery packs\",\r\n },\r\n },\r\n native: {},\r\n });\r\n\r\n const states = getStateDefinition(type);\r\n\r\n states.forEach(async (state: ISolarflowState) => {\r\n await adapter?.extendObject(`${productKey}.${deviceKey}.${state.title}`, {\r\n type: \"state\",\r\n common: {\r\n name: {\r\n de: state.nameDe,\r\n en: state.nameEn,\r\n },\r\n type: state.type,\r\n desc: state.title,\r\n role: state.role,\r\n read: true,\r\n write: false,\r\n unit: state.unit,\r\n },\r\n native: {},\r\n });\r\n });\r\n\r\n // Set SOC from device\r\n if (device.electricity && type != \"smartPlug\") {\r\n await updateSolarFlowState(\r\n adapter,\r\n device.productKey,\r\n device.deviceKey,\r\n \"electricLevel\",\r\n device.electricity\r\n );\r\n }\r\n\r\n // Set sn number from device\r\n if (device.snNumber) {\r\n await updateSolarFlowState(\r\n adapter,\r\n device.productKey,\r\n device.deviceKey,\r\n \"snNumber\",\r\n device.snNumber.toString()\r\n );\r\n }\r\n\r\n // Set product name from device\r\n await updateSolarFlowState(\r\n adapter,\r\n device.productKey,\r\n device.deviceKey,\r\n \"productName\",\r\n device.productName\r\n );\r\n\r\n // Set wifi state from device\r\n await updateSolarFlowState(\r\n adapter,\r\n device.productKey,\r\n device.deviceKey,\r\n \"wifiState\",\r\n device.wifiStatus ? \"Connected\" : \"Disconnected\"\r\n );\r\n\r\n // Create control states only when using App MQTT servers - and not the fallback one!\r\n if (!adapter.config.useFallbackService) {\r\n await createControlStates(adapter, productKey, deviceKey, type);\r\n }\r\n\r\n if (adapter.config.useCalculation) {\r\n await createCalculationStates(adapter, productKey, deviceKey, type);\r\n } else {\r\n //await deleteCalculationStates(adapter, productKey, deviceKey);\r\n }\r\n};\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAA0B;AAC1B,uBAA0B;AAC1B,uBAA0B;AAC1B,yBAA4B;AAC5B,6BAAgC;AAIhC,4BAAqC;AACrC,qCAAwC;AACxC,iCAAoC;AAG7B,MAAM,qBAAqB,CAAC,SAAoC;AACrE,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO,CAAC;AAAA,EACZ;AACF;AAEO,MAAM,wBAAwB,OACnC,SACA,QACA,SACkB;AAClB,QAAM,aAAa,OAAO,WAAW,QAAQ,QAAQ,iBAAiB,EAAE;AACxE,QAAM,YAAY,OAAO,UAAU,QAAQ,QAAQ,iBAAiB,EAAE;AAEtE,UAAQ,IAAI;AAAA,IACV,qEAAqE,OAAO,WAAW,KAAK,UAAU,IAAI,SAAS,eAAe,OAAO,IAAI;AAAA,EAC/I;AAGA,SAAM,mCAAS,aAAa,YAAY;AAAA,IACtC,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,QACP,MAAM,MAAM;AAAA,MACd;AAAA,MACA,QAAQ,CAAC;AAAA,IACX;AAAA,EACF,CAAC;AAGD,MAAI,OAAO,eAAe,QAAQ,aAAa;AAC7C,cAAM;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,MACP,OAAO;AAAA,MACP;AAAA,MACA,OAAO;AAAA,IACT;AAAA,EACF;AAGA,MAAI,OAAO,UAAU;AACnB,cAAM;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,MACP,OAAO;AAAA,MACP;AAAA,MACA,OAAO,SAAS,SAAS;AAAA,IAC3B;AAAA,EACF;AAGA,YAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP,OAAO;AAAA,IACP;AAAA,IACA,OAAO;AAAA,EACT;AAGA,YAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP,OAAO;AAAA,IACP;AAAA,IACA,OAAO,aAAa,cAAc;AAAA,EACpC;AAGA,MAAI,CAAC,QAAQ,OAAO,oBAAoB;AACtC,cAAM,gDAAoB,SAAS,YAAY,WAAW,IAAI;AAAA,EAChE;AAEA,MAAI,QAAQ,OAAO,gBAAgB;AACjC,cAAM,wDAAwB,SAAS,YAAY,WAAW,IAAI;AAAA,EACpE,OAAO;AAAA,EAEP;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "zendure-solarflow",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.1",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.8.1": {
|
|
7
|
+
"en": "Fix Control State",
|
|
8
|
+
"de": "Kontrollzustand",
|
|
9
|
+
"ru": "Fix Control State",
|
|
10
|
+
"pt": "Estado de controle fixo",
|
|
11
|
+
"nl": "Fix Control State",
|
|
12
|
+
"fr": "Fix État de contrôle",
|
|
13
|
+
"it": "Stato di controllo",
|
|
14
|
+
"es": "Estado de control fijo",
|
|
15
|
+
"pl": "Napraw stan kontroli",
|
|
16
|
+
"uk": "Контрольний стан",
|
|
17
|
+
"zh-cn": "控制状态"
|
|
18
|
+
},
|
|
6
19
|
"1.8.0": {
|
|
7
20
|
"en": "Fix SOC and energyWhMax Value (counted by type of attached batteries - seems to work better now)\nAdd Calculation for Grid Input (only for Ace 1500 and Hyper 2000)",
|
|
8
21
|
"de": "SOC und EnergyWhMax Value (gezählt nach Art der angeschlossenen Batterien - scheint jetzt besser zu arbeiten)\nBerechnung für Grid Input hinzufügen (nur für Ace 1500 und Hyper 2000)",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "Popraw wartość wejściową AC dla Hyper do max. 1200W\nNapraw wartość dcSwitch i acSwitch",
|
|
81
94
|
"uk": "Фіксувати значення введення змінного струму для Hyper до макс. 1200В\nВиправлення dcSwitch і значення acSwitch",
|
|
82
95
|
"zh-cn": "将 Hyper 的 AC 输入值固定为最大 。 1200W (英语)\n修正 dcSwitch 和 acSwitch 值"
|
|
83
|
-
},
|
|
84
|
-
"1.7.2": {
|
|
85
|
-
"en": "Fix acSwitch for ACE and Hyper",
|
|
86
|
-
"de": "Fix acSwitch für ACE und Hyper",
|
|
87
|
-
"ru": "Fix acSwitch для ACE и Hyper",
|
|
88
|
-
"pt": "Fix acSwitch para ACE e Hyper",
|
|
89
|
-
"nl": "Fix acSwitch voor ACE en Hyper",
|
|
90
|
-
"fr": "Correction acSwitch pour ACE et Hyper",
|
|
91
|
-
"it": "Fissare acSwitch per ACE e Hyper",
|
|
92
|
-
"es": "Fijar acSwitch para ACE e Hyper",
|
|
93
|
-
"pl": "Napraw acSwitch dla ACE i Hyper",
|
|
94
|
-
"uk": "Виправлення acSwitch для ACE і Hyper",
|
|
95
|
-
"zh-cn": "修正ACE 和 Hyper 的 ACE 开关"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|