iobroker.bydhvs 1.4.2 → 1.5.2

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_OLD.md CHANGED
@@ -1,4 +1,21 @@
1
1
  # Older changes
2
+ ## 1.4.0 (2022-10-31)
3
+ * Update of referred modules (mainly around testing)
4
+ * improvmenets contributed by Tapter (5 modules, readme and better readable code)
5
+ * Better detection of battery type and inverter
6
+ * SOC not only from normal data but from diagnosis-data, too. There we have one decimal place more
7
+ * removed frequency limit for battery detail data
8
+ * increased max count of temperature measurements for HVS to 64
9
+ * support for up to 5 HVS modules
10
+
11
+ ## 1.3.0 (2021-11-06)
12
+ * updated even more dependencies
13
+ * official release with new state SOH
14
+
15
+ ## 1.2.4-0 (2021-11-02)
16
+ * Added state: SOH
17
+ * updated dependencies as suggested from bot
18
+
2
19
  ## 1.2.3 (2021-06-18)
3
20
  * changed ratio of logo
4
21
 
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Christian <github@familie-herrmann.de>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Christian <github@familie-herrmann.de>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+
2
+
3
+ ## Ein wenig Erklärungen:
4
+
5
+ Prinzipiell ist der Adapter durch Anaylse der Datenpakete zwischen der BYD-App und dem BYD-Akku-System entstanden. Es werden im Wesentlichen die Daten aus dem TAB System Info und aus dem TAB Diagnosis dargestellt. Offensichtlich sind die Daten für "System Info" sofort in der Batterie bereit zum abholen, für die Diagnose-Daten sieht es so aus als wäre ein Messvorgang erforderlich, zwischen der Abfrage und den Werten muss ein Zeitintervall von gut 3 Sekunden eingehalten werden.
6
+
7
+ Ich bin mir nicht sicher ob das BYD-System durch zu häufige Abfragen beschädigt wird, also: Es ist Dein Risiko was Du hier einträgst!
8
+
9
+ ## Zu den Einstellungen:
10
+ Intervall: Zeitlicher Abstand zwischen den Abfragen des Adapters
11
+
12
+ IP-Adresse: Eigentlich logisch, damit ist die IP-Adresse des Adapters gemeint. Dafür gibt es zwei Möglichkeiten: Entweder hält man sich an die Anleitung von Becker3 aus dem Photovoltaik-Forum, ist hier verlinkt: https://www.photovoltaikforum.com/thread/150898-byd-hvs-firmware-update/?postID=2215343#post2215343 . Das hat den Vorteil das auch die BYD-APP läuft und man mit dieser direkt an die Daten, auch zum Vergleich, herankommt. Oder man trägt "nur" die IP-Adresse die die BYD-Box per DHCP erhalten hat ein. Ausdrücklich waren möchte ich vor Änderungen an den IP-Einstellungen der BOX! Im Forum kann man Berichte von Leute lesen die sich die Erreichbarkeit der Box dauerhaft ruiniert haben.
13
+
14
+ Batterie-Details: Steuerung, ob die Details zu den Zellen gelesen werden sollen
15
+
16
+ Lesezyklen zu Batterie-Details: Anzahl der "Normal-Lese-Zyklen" bis wieder einmal die Diagnose-Daten gelesen werden. Hier die Warnung dazu: Ich habe keine Idee ob man sich durch häufige Diagnose-Messungen Nachteile einhandelt, daher empfehle ich den Wert möglichst hoch zu setzen. Ich wüsste auch nicht was man mit den Diagnose-Daten im regelmäßigen Poll anfangen sollte.
17
+
18
+ Zu den Batterie-Größen: Der Adapter funktioniert für Zelltemperaturen und ZellSpannungen bei 2-5 Batterie-Modulen.
19
+
20
+ [Zurück zur automatisch übersetzten Readme](README.md)
21
+
package/README.md CHANGED
@@ -4,11 +4,9 @@
4
4
 
5
5
  BYD HVS Battery poll data
6
6
 
7
- ## English:
8
-
9
7
  ## Introduction
10
8
 
11
- This Adapter takes data from a byd PV battery ( https://www.bydbatterybox.com/ ) and puts them into datapoints in the adapter. Unfortunately there is no official API and no documentation, so I used wireshark and a byd-hvs-simulator to try to understand the communication. My adapter simulates the byd-app, sends similar packets to the device and analyses the responses.
9
+ This Adapter takes data from a byd PV battery ( https://www.bydbatterybox.com/ ) and puts them into datapoints in the adapter. Unfortunately there is no official API and no documentation, so I used wireshark and a byd-hvs-simulator to try to understand the communication. My adapter simulates the byd-app, sends similar packets to the device and analyses the responses.
12
10
 
13
11
  ## be careful
14
12
 
@@ -21,38 +19,35 @@ Up to 5 HVS Modules are now supported.
21
19
  ## settings
22
20
 
23
21
  Interval: That's easy: how often (s) shall the data be polled
24
- IP-Adress: Thats self explaining. Either you use the standard address ( 192.168.16.254 ) and change the routing at home, e.g.: https://www.photovoltaikforum.com/thread/150898-byd-hvs-firmware-update/?postID=2215343#post2215343 . The advantage is: The beConnect app works, too. Other possibility: You change the IP-Adress of the box. But: Be warned: the text on the webpage is confusing and if you are not absolutely shure about the things you do: PLEASE do not touch the settings. In the German forums I read from people who were locked out of their system and there is no way back, either byd sends you a replacement HVU or you have to buy a new one.
22
+ IP-Adress: Thats self explaining. Either you use the standard address ( 192.168.16.254 ) and change the routing at home, e.g.: https://www.photovoltaikforum.com/thread/150898-byd-hvs-firmware-update/?postID=2215343#post2215343 . The advantage is: The beConnect app works, too. Other possibility: You change the IP-Adress of the box. But: Be warned: the text on the webpage is confusing and if you are not absolutely shure about the things you do: PLEASE do not touch the settings. In the German forums I read from people who were locked out of their system and there is no way back, either byd sends you a replacement HVU or you have to buy a new one.
25
23
  Battery-details: As explained above: Do you need the details of the battery? If so: set the checkobx.
26
24
  Battery-details - every ... cycles :Also like above, should be clear
27
25
  Test Mode - show data in error log: If you check this box: the sent and recieved data are displayed in the error-log, so you can easily download the data and send it to me in case of errors.
26
+ Copy and Paste does not work - the data is cut at the end. You will have to download it before you send it to me.
28
27
 
29
-
30
- ## German:
31
-
32
-
33
- ## Ein wenig Erklärungen:
34
-
35
- Prinzipiell ist der Adapter durch Anaylse der Datenpakete zwischen der BYD-App und dem BYD-Akku-System entstanden. Es werden im Wesentlichen die Daten aus dem TAB System Info und aus dem TAB Diagnosis dargestellt. Offensichtlich sind die Daten für "System Info" sofort in der Batterie bereit zum abholen, für die Diagnose-Daten sieht es so aus als wäre ein Messvorgang erforderlich, zwischen der Abfrage und den Werten muss ein Zeitintervall von gut 3 Sekunden eingehalten werden.
36
-
37
- Ich bin mir nicht sicher ob das BYD-System durch zu häufige Abfragen beschädigt wird, also: Es ist Dein Risiko was Du hier einträgst!
38
-
39
- ## Zu den Einstellungen:
40
- Intervall: Zeitlicher Abstand zwischen den Abfragen des Adapters
41
-
42
- IP-Adresse: Eigentlich logisch, damit ist die IP-Adresse des Adapters gemeint. Dafür gibt es zwei Möglichkeiten: Entweder hält man sich an die Anleitung von Becker3 aus dem Photovoltaik-Forum, ist hier verlinkt: https://www.photovoltaikforum.com/thread/150898-byd-hvs-firmware-update/?postID=2215343#post2215343 . Das hat den Vorteil das auch die BYD-APP läuft und man mit dieser direkt an die Daten, auch zum Vergleich, herankommt. Oder man trägt "nur" die IP-Adresse die die BYD-Box per DHCP erhalten hat ein. Ausdrücklich waren möchte ich vor Änderungen an den IP-Einstellungen der BOX! Im Forum kann man Berichte von Leute lesen die sich die Erreichbarkeit der Box dauerhaft ruiniert haben.
43
-
44
- Batterie-Details: Steuerung, ob die Details zu den Zellen gelesen werden sollen
45
-
46
- Lesezyklen zu Batterie-Details: Anzahl der "Normal-Lese-Zyklen" bis wieder einmal die Diagnose-Daten gelesen werden. Hier die Warnung dazu: Ich habe keine Idee ob man sich durch häufige Diagnose-Messungen Nachteile einhandelt, daher empfehle ich den Wert möglichst hoch zu setzen. Ich wüsste auch nicht was man mit den Diagnose-Daten im regelmäßigen Poll anfangen sollte.
47
-
48
- Zu den Batterie-Größen: Der Adapter funktioniert für Zelltemperaturen und ZellSpannungen bei 2-5 Batterie-Modulen.
49
-
28
+ [Link zur nativen deutschen Readme:](README-German.md)
50
29
 
51
30
  ## Changelog
52
31
  <!--
53
32
  Placeholder for the next version (at the beginning of the line):
54
33
  ### __WORK IN PROGRESS__
55
34
  -->
35
+ ### 1.5.2 (2025-08-02)
36
+ * (arteck) add socketConnection DP
37
+ * (arteck) use jsconConfig
38
+ * (arteck) refactoring to modern Code
39
+ * (arteck) use direct socket connection without detour IPClient
40
+ * first Version with two towers in NPM
41
+
42
+ ### 1.5.1 (2024-01-15)
43
+ * Enable the possibility to get informations from a two tower setup
44
+ * BREAKING CHANGE of Structure.
45
+
46
+ ### 1.5.0 (2023-11-04)
47
+ * Breaking change: nodejs 16 minimum required
48
+ * automated checks and release-script repaired (thanks to mcm1957, he did the work)
49
+ * nothing else changed in code
50
+
56
51
  ### 1.4.2 (2023-09-28)
57
52
  * Typo in version number removed
58
53
 
@@ -61,29 +56,12 @@ Zu den Batterie-Größen: Der Adapter funktioniert für Zelltemperaturen und Zel
61
56
  * Removed some bugs in detecting inverter
62
57
  * Inverternumber ist logged, so I can easily add new inverters if neccerary, just send me the silly-log if inverter is unknown.
63
58
 
64
- ### 1.4.0 (2022-10-31)
65
- * Update of referred modules (mainly around testing)
66
- * improvmenets contributed by Tapter (5 modules, readme and better readable code)
67
- * Better detection of battery type and inverter
68
- * SOC not only from normal data but from diagnosis-data, too. There we have one decimal place more
69
- * removed frequency limit for battery detail data
70
- * increased max count of temperature measurements for HVS to 64
71
- * support for up to 5 HVS modules
72
-
73
- ### 1.3.0 (2021-11-06)
74
- * updated even more dependencies
75
- * official release with new state SOH
76
-
77
- ### 1.2.4-0 (2021-11-02)
78
- * Added state: SOH
79
- * updated dependencies as suggested from bot
80
-
81
59
  ###
82
60
 
83
61
  ## License
84
62
  MIT License
85
63
 
86
- Copyright (c) 2021 Christian <github@familie-herrmann.de>
64
+ Copyright (c) 2025 Christian <github@familie-herrmann.de>
87
65
 
88
66
  Permission is hereby granted, free of charge, to any person obtaining a copy
89
67
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,108 @@
1
+ {
2
+ "type": "panel",
3
+ "i18n": true,
4
+ "items": {
5
+ "Account settings": {
6
+ "type": "header",
7
+ "text": "Adapter settings for BYD Battery",
8
+ "size": 2,
9
+ "newLine": true
10
+ },
11
+
12
+ "ConfPollInterval": {
13
+ "type": "number",
14
+ "label": "Interval (s)",
15
+ "unit": "sec",
16
+ "hidden": "data.ConfOverridePollInterval === true",
17
+ "min": 30,
18
+ "max": 3600,
19
+ "xs": 12,
20
+ "sm": 12,
21
+ "md": 4,
22
+ "lg": 3,
23
+ "xl": 3
24
+ },
25
+
26
+ "ConfIPAdress": {
27
+ "type": "text",
28
+ "label": "IP Address",
29
+ "xs": 12,
30
+ "sm": 12,
31
+ "md": 4,
32
+ "lg": 3,
33
+ "xl": 3
34
+ },
35
+
36
+ "ConfOverridePollInterval": {
37
+ "type": "checkbox",
38
+ "label": "Use poll interval from state and not from here",
39
+ "newLine": true,
40
+ "xs": 12,
41
+ "sm": 12,
42
+ "md": 8,
43
+ "lg": 4,
44
+ "xl": 4
45
+ },
46
+
47
+ "ConfBatDetails": {
48
+ "type": "checkbox",
49
+ "label": "Diagnosis Data from Battery (only tested with two and four modules)",
50
+ "xs": 12,
51
+ "sm": 12,
52
+ "md": 8,
53
+ "lg": 4,
54
+ "xl": 4
55
+ },
56
+
57
+ "ConfTestMode": {
58
+ "type": "checkbox",
59
+ "label": "Test Mode - show data in error log",
60
+ "newLine": true,
61
+ "xs": 12,
62
+ "sm": 12,
63
+ "md": 8,
64
+ "lg": 4,
65
+ "xl": 4
66
+ },
67
+
68
+ "ConfDetailshowoften": {
69
+ "newLine": true,
70
+ "type": "number",
71
+ "label": "Battery-details - every ... cycles",
72
+ "xs": 12,
73
+ "sm": 12,
74
+ "md": 4,
75
+ "lg": 3,
76
+ "xl": 3
77
+ },
78
+ "ConfBydTowerCount": {
79
+ "newLine": true,
80
+ "type": "select",
81
+ "label": "Count of towers",
82
+ "xs": 12,
83
+ "sm": 12,
84
+ "md": 4,
85
+ "lg": 3,
86
+ "xl": 3,
87
+ "options": [
88
+ {
89
+ "label": "1",
90
+ "value": "1"
91
+ },
92
+ {
93
+ "label": "2",
94
+ "value": "2"
95
+ }
96
+ ]
97
+ },
98
+ "ConfStoreRawMessages": {
99
+ "type": "checkbox",
100
+ "label": "Enable to store the raw messages",
101
+ "xs": 12,
102
+ "sm": 12,
103
+ "md": 8,
104
+ "lg": 4,
105
+ "xl": 4
106
+ }
107
+ }
108
+ }
@@ -0,0 +1,78 @@
1
+ # Structure of BYD HVS Messages
2
+
3
+ ## Captureing of messages
4
+ These messages and decrypted by capturing the communication between the software Be Connect and the hardware. The position and information of each information is interpreted by the community and may be incorrect. Please take only valid information from BYD or its sub-companies.
5
+
6
+
7
+ ## Messages
8
+
9
+ After a TCP Connection is estalished the communication requires to send a command to receive data or execute a measurement. The project of smarthomeNG describe it as a similarity for ModBus that we read and write registers with the TCP connection.
10
+ https://github.com/lgb-this/plugins/blob/develop/byd_bat/user_doc.rst
11
+ All Messages have a Header in Byte 1 and 2.
12
+
13
+ ### Message 0 - Initiate connection and Basic data
14
+ The send out message is ```010300000066c5e0```
15
+
16
+ | Byte | Type | Description |
17
+ |:-- |:--:|:--|
18
+ | 3 to 21 | string | This is the serialnumber. On the 2. character you can identify the hardwaretype (HVS, HVM, ...) |
19
+ | 27 + 28 | character | Version in format V(27).(28) for the first BMU |
20
+ | 29 + 30 | character | Version in format V(29).(30) for the 2nd BMU |
21
+ | 33 | integer | used tower BMU |
22
+ | 36 | 2 seperate byte integer | 1 byte - towers; 2 byte - modules (23 => 2 towers & 3 modules) |
23
+ | 38 | enum | 0: OffGrid; 1: OnGrid; 2: Backup |
24
+
25
+ ### Message 1 - System diagnosis
26
+ The send out message is ```01030500001984cc```
27
+
28
+ | Byte | Type | Descriptio |
29
+ |:-- |:--:|:--|
30
+ | 3 | int16 signed | SOC of the whole system |
31
+ | 5 | int16 signed | System max volts |
32
+ | 7 | int16 signed | System min volts |
33
+ | 9 | int16 signed | System SOH |
34
+ | 11 | int16 signed | System amperes |
35
+ | 13 | int16 unsigned | Battery volts with SF 100 |
36
+ | 15 | int16 signed | max Temperature |
37
+ | 17 | int16 signed | min Temperature |
38
+ | 19 | int16 signed | Battery Temperature |
39
+ | 29 | int16 signed | Error Number |
40
+ | 31 + 32 | characters | Param T |
41
+ | 35 | int16 unsigned | Ouput voltage with SF 100 |
42
+ | 37 | int16 unsigned | Total charge of the system |
43
+ | 41 | int16 unsinged | Total discharge of the system |
44
+
45
+ ### Message 2 - System diagnosis
46
+ the send command is ```010300100003040e```
47
+
48
+ | Byte | Type | Descriptio |
49
+ |:-- |:--:|:--|
50
+ | 3 | enum | inverter type |
51
+ | 5 | enum | Battery type: 0: HVL; 1: HVM; 2: HVS |
52
+
53
+ ### Message 5 - Tower basic information
54
+
55
+ | Byte | Type | Descriptio |
56
+ |:-- |:--:|:--|
57
+ | 5 | int16 signed | Tower max Volt |
58
+ | 7 | int16 singed | Tower min Volt |
59
+ | 9 | int | max volt cell number |
60
+ | 10 | int | min volt cell number |
61
+ | 11 | int16 signed | max temperature |
62
+ | 13 | int 16 signed | min temperature |
63
+ | 15 | int | max temperature cell |
64
+ | 16 | int | min temperature cell number |
65
+ | 17 - 32 | MSB, LSB | Balancing Flags |
66
+ | 33 | int32 Unsigned | tower charge total with SF 1000 |
67
+ | 37 | int32 Unsigned | tower discharge total with SF 1000 |
68
+ | 45 | int16 signed | tower battery voltage SF 10 |
69
+ | 51 | int16 singed | tower volt out |
70
+ | 53 | int16 signed | SOC Percentage |
71
+ | 55 | int16 signed | SOH percentage |
72
+ | 57 | int16 signed | Currentamperes |
73
+ | 59 + 60 | hex | state |
74
+
75
+ ## Glossary
76
+ | Short | Description |
77
+ |:--:|:-- |
78
+ | SF | Scale Factor (Value 1234 & SF 100 => Real Value: 12.34) |
@@ -0,0 +1,33 @@
1
+ // ioBroker eslint template configuration file for js and ts files
2
+ // Please note that esm or react based modules need additional modules loaded.
3
+ import config from '@iobroker/eslint-config';
4
+
5
+ export default [
6
+ ...config,
7
+
8
+ {
9
+ // specify files to exclude from linting here
10
+ ignores: [
11
+ '.dev-server/',
12
+ '.vscode/',
13
+ '*.test.js',
14
+ 'test/**/*.js',
15
+ '*.config.mjs',
16
+ 'build',
17
+ 'admin/build',
18
+ 'admin/words.js',
19
+ 'admin/admin.d.ts',
20
+ '**/adapter-config.d.ts'
21
+ ]
22
+ },
23
+
24
+ {
25
+ // you may disable some 'jsdoc' warnings - but using jsdoc is highly recommended
26
+ // as this improves maintainability. jsdoc warnings will not block buiuld process.
27
+ rules: {
28
+ // 'jsdoc/require-jsdoc': 'off',
29
+
30
+ },
31
+ },
32
+
33
+ ];