iobroker.bydhvs 1.3.0 → 1.4.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/CHANGELOG_OLD.md +30 -17
- package/README.md +29 -22
- package/admin/admin.d.ts +93 -93
- package/admin/index_m.html +112 -112
- package/admin/style.css +32 -32
- package/admin/words.js +80 -80
- package/io-package.json +280 -267
- package/main.js +965 -828
- package/package.json +18 -18
package/CHANGELOG_OLD.md
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
# Older changes
|
2
|
+
## 1.2.2 (2021-06-14)
|
3
|
+
* bump to new patch-level (to get rid of the "-0")
|
4
|
+
|
5
|
+
## 1.2.2-0 (2021-05-30)
|
6
|
+
* Create States for Diagnose-Data only if necessary
|
7
|
+
* changes according review of the adapter
|
8
|
+
|
9
|
+
## 1.2.2-0 (2021-05-30)
|
10
|
+
* Create States for Diagnose-Data only if necessary
|
11
|
+
* changes according review of the adapter
|
12
|
+
|
2
13
|
## 1.2.1 (2021-05-20)
|
3
14
|
* Power is now fixed with 2 number after the decimal point
|
4
|
-
* bug removed, cell voltage for cell 64 works now
|
5
|
-
|
15
|
+
* bug removed, cell voltage for cell 64 works now
|
16
|
+
|
6
17
|
## 1.2.0 (2021-05-15)
|
7
18
|
* preparation for being listed in official repository
|
8
19
|
* English part in readme.md
|
@@ -13,9 +24,8 @@
|
|
13
24
|
* New: type of battery
|
14
25
|
* compatibility with new js-controller 3.3
|
15
26
|
* compatibility with nodejs 15
|
16
|
-
* compatibility with admin UI 5
|
17
|
-
|
18
|
-
|
27
|
+
* compatibility with admin UI 5
|
28
|
+
|
19
29
|
## 1.1.0 (2021-04-22)
|
20
30
|
* HVS-Version with two banks and - hopefully - correct display
|
21
31
|
* states are now with units, the existing states are changed
|
@@ -24,23 +34,26 @@
|
|
24
34
|
* moved state from State.ErrorNum to System.ErrorNum --> old states exists further on, I do not know how to delete it, adapter.deletestate does not work.
|
25
35
|
* deleted test-answers --> moved to my BYD-HVS-Simulator
|
26
36
|
* some minor bugs removed
|
27
|
-
* obviously the adapter works for hvm, too -> need more testers and an idea for a new name
|
28
|
-
|
37
|
+
* obviously the adapter works for hvm, too -> need more testers and an idea for a new name
|
38
|
+
|
29
39
|
## 1.0.0 (2021-04-05)
|
30
40
|
* Update all dependencies
|
31
|
-
* first public version
|
41
|
+
* first public version
|
42
|
+
|
32
43
|
## 0.1.4-beta.0 (2021-04-02)
|
33
|
-
* 1st change with release-script
|
44
|
+
* 1st change with release-script
|
45
|
+
|
34
46
|
## 0.1.3
|
35
|
-
- Test Mode for getting hex data easily, removed check for 2 modules, moved "diagnosis-states" to extra folder, renaming CellStates
|
47
|
+
- Test Mode for getting hex data easily, removed check for 2 modules, moved "diagnosis-states" to extra folder, renaming CellStates
|
48
|
+
|
36
49
|
## 0.1.2
|
37
|
-
- Battery Voltage is unsigned, should now work with 4 modules
|
50
|
+
- Battery Voltage is unsigned, should now work with 4 modules
|
51
|
+
|
38
52
|
## 0.1.1
|
39
|
-
- start of documentation (German)
|
53
|
+
- start of documentation (German)
|
54
|
+
|
40
55
|
## 0.1.0
|
41
|
-
- (Christian) first testing release with (limited) public announcement
|
56
|
+
- (Christian) first testing release with (limited) public announcement
|
57
|
+
|
42
58
|
## 0.0.1
|
43
|
-
- (Christian) initial release
|
44
|
-
|
45
|
-
|
46
|
-
|
59
|
+
- (Christian) initial release
|
package/README.md
CHANGED
@@ -8,15 +8,15 @@ BYD HVS Battery poll data
|
|
8
8
|
|
9
9
|
## Introduction
|
10
10
|
|
11
|
-
This Adapter takes data from a byd PV battery ( https://www.bydbatterybox.com/ ) and puts them into datapoints in the adapter.
|
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.
|
12
12
|
|
13
13
|
## be careful
|
14
14
|
|
15
|
-
There are two steps in the beConnect app, in the first step you get the normal data, in the second step you get detail-data for all cells (individual cell temperature and voltage and some more details) To get the detail-data there has to be a delay after one of the data-packets till I can get the result. I think in the meantime alle cells are measured, but I am not sure.
|
15
|
+
There are two steps in the beConnect app, in the first step you get the normal data, in the second step you get detail-data for all cells (individual cell temperature and voltage and some more details) To get the detail-data there has to be a delay after one of the data-packets till I can get the result. I think in the meantime alle cells are measured, but I am not sure. I am definitely not sure if you harm your battery with polling this data too often, so be aware: You are on your own risk!
|
16
16
|
|
17
|
-
##
|
17
|
+
## support for up to 5 modules
|
18
18
|
|
19
|
-
|
19
|
+
Up to 5 HVS Modules are now supported.
|
20
20
|
|
21
21
|
## settings
|
22
22
|
|
@@ -34,7 +34,7 @@ Test Mode - show data in error log: If you check this box: the sent and recieved
|
|
34
34
|
|
35
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
36
|
|
37
|
-
|
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
38
|
|
39
39
|
## Zu den Einstellungen:
|
40
40
|
Intervall: Zeitlicher Abstand zwischen den Abfragen des Adapters
|
@@ -43,34 +43,41 @@ IP-Adresse: Eigentlich logisch, damit ist die IP-Adresse des Adapters gemeint. D
|
|
43
43
|
|
44
44
|
Batterie-Details: Steuerung, ob die Details zu den Zellen gelesen werden sollen
|
45
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.
|
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
47
|
|
48
|
-
Zu den Batterie-Größen: Der Adapter funktioniert
|
48
|
+
Zu den Batterie-Größen: Der Adapter funktioniert für Zelltemperaturen und ZellSpannungen bei 2-5 Batterie-Modulen.
|
49
49
|
|
50
50
|
|
51
51
|
## Changelog
|
52
52
|
<!--
|
53
53
|
Placeholder for the next version (at the beginning of the line):
|
54
54
|
### __WORK IN PROGRESS__
|
55
|
-
-->
|
55
|
+
-->
|
56
|
+
### 1.4.1 (2023-09-24)
|
57
|
+
* Compatibility with js.controller 5x
|
58
|
+
* Removed some bugs in detecting inverter
|
59
|
+
* Inverternumber ist logged, so I can easily add new inverters if neccerary, just send me the silly-log if inverter is unknown.
|
60
|
+
|
61
|
+
### 1.4.0 (2022-10-31)
|
62
|
+
* Update of referred modules (mainly around testing)
|
63
|
+
* improvmenets contributed by Tapter (5 modules, readme and better readable code)
|
64
|
+
* Better detection of battery type and inverter
|
65
|
+
* SOC not only from normal data but from diagnosis-data, too. There we have one decimal place more
|
66
|
+
* removed frequency limit for battery detail data
|
67
|
+
* increased max count of temperature measurements for HVS to 64
|
68
|
+
* support for up to 5 HVS modules
|
69
|
+
|
56
70
|
### 1.3.0 (2021-11-06)
|
57
71
|
* updated even more dependencies
|
58
|
-
* official release with new state SOH
|
59
|
-
|
72
|
+
* official release with new state SOH
|
73
|
+
|
60
74
|
### 1.2.4-0 (2021-11-02)
|
61
75
|
* Added state: SOH
|
62
|
-
* updated dependencies as suggested from bot
|
63
|
-
|
76
|
+
* updated dependencies as suggested from bot
|
77
|
+
|
64
78
|
### 1.2.3 (2021-06-18)
|
65
|
-
* changed ratio of logo
|
66
|
-
|
67
|
-
### 1.2.2 (2021-06-14)
|
68
|
-
* bump to new patch-level (to get rid of the "-0")
|
69
|
-
|
70
|
-
### 1.2.2-0 (2021-05-30)
|
71
|
-
* Create States for Diagnose-Data only if necessary
|
72
|
-
* changes according review of the adapter
|
73
|
-
|
79
|
+
* changed ratio of logo
|
80
|
+
|
74
81
|
###
|
75
82
|
|
76
83
|
## License
|
@@ -94,4 +101,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
94
101
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
95
102
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
96
103
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
97
|
-
SOFTWARE.
|
104
|
+
SOFTWARE.
|
package/admin/admin.d.ts
CHANGED
@@ -1,93 +1,93 @@
|
|
1
|
-
declare let systemDictionary: Record<string, Record<string, string>>;
|
2
|
-
|
3
|
-
declare let load: (settings: Record<string, unknown>, onChange: (hasChanges: boolean) => void) => void;
|
4
|
-
declare let save: (callback: (settings: Record<string, unknown>) => void) => void;
|
5
|
-
|
6
|
-
// make load and save exist on the window object
|
7
|
-
interface Window {
|
8
|
-
load: typeof load;
|
9
|
-
save: typeof save;
|
10
|
-
}
|
11
|
-
|
12
|
-
declare const instance: number;
|
13
|
-
declare const adapter: string;
|
14
|
-
/** Translates text */
|
15
|
-
declare function _(text: string): string;
|
16
|
-
declare const socket: ioBrokerSocket;
|
17
|
-
declare function sendTo(
|
18
|
-
instance: any | null,
|
19
|
-
command: string,
|
20
|
-
message: any,
|
21
|
-
callback: (result: SendToResult) => void | Promise<void>,
|
22
|
-
): void;
|
23
|
-
|
24
|
-
interface SendToResult {
|
25
|
-
error?: string | Error;
|
26
|
-
result?: any;
|
27
|
-
}
|
28
|
-
|
29
|
-
// tslint:disable-next-line:class-name
|
30
|
-
interface ioBrokerSocket {
|
31
|
-
emit(
|
32
|
-
command: "subscribeObjects",
|
33
|
-
pattern: string,
|
34
|
-
callback?: (err?: string) => void | Promise<void>,
|
35
|
-
): void;
|
36
|
-
emit(
|
37
|
-
command: "subscribeStates",
|
38
|
-
pattern: string,
|
39
|
-
callback?: (err?: string) => void | Promise<void>,
|
40
|
-
): void;
|
41
|
-
emit(
|
42
|
-
command: "unsubscribeObjects",
|
43
|
-
pattern: string,
|
44
|
-
callback?: (err?: string) => void | Promise<void>,
|
45
|
-
): void;
|
46
|
-
emit(
|
47
|
-
command: "unsubscribeStates",
|
48
|
-
pattern: string,
|
49
|
-
callback?: (err?: string) => void | Promise<void>,
|
50
|
-
): void;
|
51
|
-
|
52
|
-
emit(
|
53
|
-
event: "getObjectView",
|
54
|
-
view: "system",
|
55
|
-
type: "device",
|
56
|
-
options: ioBroker.GetObjectViewParams,
|
57
|
-
callback: (
|
58
|
-
err: string | undefined,
|
59
|
-
result?: any,
|
60
|
-
) => void | Promise<void>,
|
61
|
-
): void;
|
62
|
-
emit(
|
63
|
-
event: "getStates",
|
64
|
-
callback: (
|
65
|
-
err: string | undefined,
|
66
|
-
result?: Record<string, any>,
|
67
|
-
) => void,
|
68
|
-
): void;
|
69
|
-
emit(
|
70
|
-
event: "getState",
|
71
|
-
id: string,
|
72
|
-
callback: (err: string | undefined, result?: ioBroker.State) => void,
|
73
|
-
): void;
|
74
|
-
emit(
|
75
|
-
event: "setState",
|
76
|
-
id: string,
|
77
|
-
state: unknown,
|
78
|
-
callback: (err: string | undefined, result?: any) => void,
|
79
|
-
): void;
|
80
|
-
|
81
|
-
on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void;
|
82
|
-
on(event: "stateChange", handler: ioBroker.StateChangeHandler): void;
|
83
|
-
removeEventHandler(
|
84
|
-
event: "objectChange",
|
85
|
-
handler: ioBroker.ObjectChangeHandler,
|
86
|
-
): void;
|
87
|
-
removeEventHandler(
|
88
|
-
event: "stateChange",
|
89
|
-
handler: ioBroker.StateChangeHandler,
|
90
|
-
): void;
|
91
|
-
|
92
|
-
// TODO: other events
|
93
|
-
}
|
1
|
+
declare let systemDictionary: Record<string, Record<string, string>>;
|
2
|
+
|
3
|
+
declare let load: (settings: Record<string, unknown>, onChange: (hasChanges: boolean) => void) => void;
|
4
|
+
declare let save: (callback: (settings: Record<string, unknown>) => void) => void;
|
5
|
+
|
6
|
+
// make load and save exist on the window object
|
7
|
+
interface Window {
|
8
|
+
load: typeof load;
|
9
|
+
save: typeof save;
|
10
|
+
}
|
11
|
+
|
12
|
+
declare const instance: number;
|
13
|
+
declare const adapter: string;
|
14
|
+
/** Translates text */
|
15
|
+
declare function _(text: string): string;
|
16
|
+
declare const socket: ioBrokerSocket;
|
17
|
+
declare function sendTo(
|
18
|
+
instance: any | null,
|
19
|
+
command: string,
|
20
|
+
message: any,
|
21
|
+
callback: (result: SendToResult) => void | Promise<void>,
|
22
|
+
): void;
|
23
|
+
|
24
|
+
interface SendToResult {
|
25
|
+
error?: string | Error;
|
26
|
+
result?: any;
|
27
|
+
}
|
28
|
+
|
29
|
+
// tslint:disable-next-line:class-name
|
30
|
+
interface ioBrokerSocket {
|
31
|
+
emit(
|
32
|
+
command: "subscribeObjects",
|
33
|
+
pattern: string,
|
34
|
+
callback?: (err?: string) => void | Promise<void>,
|
35
|
+
): void;
|
36
|
+
emit(
|
37
|
+
command: "subscribeStates",
|
38
|
+
pattern: string,
|
39
|
+
callback?: (err?: string) => void | Promise<void>,
|
40
|
+
): void;
|
41
|
+
emit(
|
42
|
+
command: "unsubscribeObjects",
|
43
|
+
pattern: string,
|
44
|
+
callback?: (err?: string) => void | Promise<void>,
|
45
|
+
): void;
|
46
|
+
emit(
|
47
|
+
command: "unsubscribeStates",
|
48
|
+
pattern: string,
|
49
|
+
callback?: (err?: string) => void | Promise<void>,
|
50
|
+
): void;
|
51
|
+
|
52
|
+
emit(
|
53
|
+
event: "getObjectView",
|
54
|
+
view: "system",
|
55
|
+
type: "device",
|
56
|
+
options: ioBroker.GetObjectViewParams,
|
57
|
+
callback: (
|
58
|
+
err: string | undefined,
|
59
|
+
result?: any,
|
60
|
+
) => void | Promise<void>,
|
61
|
+
): void;
|
62
|
+
emit(
|
63
|
+
event: "getStates",
|
64
|
+
callback: (
|
65
|
+
err: string | undefined,
|
66
|
+
result?: Record<string, any>,
|
67
|
+
) => void,
|
68
|
+
): void;
|
69
|
+
emit(
|
70
|
+
event: "getState",
|
71
|
+
id: string,
|
72
|
+
callback: (err: string | undefined, result?: ioBroker.State) => void,
|
73
|
+
): void;
|
74
|
+
emit(
|
75
|
+
event: "setState",
|
76
|
+
id: string,
|
77
|
+
state: unknown,
|
78
|
+
callback: (err: string | undefined, result?: any) => void,
|
79
|
+
): void;
|
80
|
+
|
81
|
+
on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void;
|
82
|
+
on(event: "stateChange", handler: ioBroker.StateChangeHandler): void;
|
83
|
+
removeEventHandler(
|
84
|
+
event: "objectChange",
|
85
|
+
handler: ioBroker.ObjectChangeHandler,
|
86
|
+
): void;
|
87
|
+
removeEventHandler(
|
88
|
+
event: "stateChange",
|
89
|
+
handler: ioBroker.StateChangeHandler,
|
90
|
+
): void;
|
91
|
+
|
92
|
+
// TODO: other events
|
93
|
+
}
|
package/admin/index_m.html
CHANGED
@@ -1,113 +1,113 @@
|
|
1
|
-
<html>
|
2
|
-
|
3
|
-
<head>
|
4
|
-
|
5
|
-
<!-- Load ioBroker scripts and styles-->
|
6
|
-
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
|
7
|
-
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
|
8
|
-
|
9
|
-
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
|
10
|
-
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
11
|
-
|
12
|
-
<script type="text/javascript" src="../../js/translate.js"></script>
|
13
|
-
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
|
14
|
-
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
|
15
|
-
|
16
|
-
<!-- Load our own files -->
|
17
|
-
<link rel="stylesheet" type="text/css" href="style.css" />
|
18
|
-
<script type="text/javascript" src="words.js"></script>
|
19
|
-
|
20
|
-
<script type="text/javascript">
|
21
|
-
// This will be called by the admin adapter when the settings page loads
|
22
|
-
function load(settings, onChange) {
|
23
|
-
// example: select elements with id=key and class=value and insert value
|
24
|
-
if (!settings) return;
|
25
|
-
$('.value').each(function () {
|
26
|
-
var $key = $(this);
|
27
|
-
var id = $key.attr('id');
|
28
|
-
if ($key.attr('type') === 'checkbox') {
|
29
|
-
// do not call onChange direct, because onChange could expect some arguments
|
30
|
-
$key.prop('checked', settings[id])
|
31
|
-
.on('change', () => onChange())
|
32
|
-
;
|
33
|
-
} else {
|
34
|
-
// do not call onChange direct, because onChange could expect some arguments
|
35
|
-
$key.val(settings[id])
|
36
|
-
.on('change', () => onChange())
|
37
|
-
.on('keyup', () => onChange())
|
38
|
-
;
|
39
|
-
}
|
40
|
-
});
|
41
|
-
onChange(false);
|
42
|
-
// reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
|
43
|
-
if (M) M.updateTextFields();
|
44
|
-
}
|
45
|
-
|
46
|
-
// This will be called by the admin adapter when the user presses the save button
|
47
|
-
function save(callback) {
|
48
|
-
// example: select elements with class=value and build settings object
|
49
|
-
var obj = {};
|
50
|
-
$('.value').each(function () {
|
51
|
-
var $this = $(this);
|
52
|
-
if ($this.attr('type') === 'checkbox') {
|
53
|
-
obj[$this.attr('id')] = $this.prop('checked');
|
54
|
-
} else if ($this.attr('type') === 'number') {
|
55
|
-
obj[$this.attr('id')] = parseFloat($this.val());
|
56
|
-
} else {
|
57
|
-
obj[$this.attr('id')] = $this.val();
|
58
|
-
}
|
59
|
-
});
|
60
|
-
callback(obj);
|
61
|
-
}
|
62
|
-
</script>
|
63
|
-
|
64
|
-
</head>
|
65
|
-
|
66
|
-
<body>
|
67
|
-
|
68
|
-
<div class="m adapter-container">
|
69
|
-
|
70
|
-
<div class="row">
|
71
|
-
<div class="col s12 m4 l2">
|
72
|
-
<img src="bydhvs.png" class="logo">
|
73
|
-
</div>
|
74
|
-
</div>
|
75
|
-
|
76
|
-
<!-- Put your content here -->
|
77
|
-
|
78
|
-
<!-- For example columns with settings: -->
|
79
|
-
<div class="row">
|
80
|
-
<div class="col s6 input-field">
|
81
|
-
<input type="text" class="value" id="ConfPollInterval" />
|
82
|
-
<label for="PollInterval" class="translate">Interval (s)</label>
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div class="col s6 input-field">
|
86
|
-
<input type="text" class="value" id="ConfIPAdress" />
|
87
|
-
<label for="IP Adress" class="translate">IP Adress</label>
|
88
|
-
</div>
|
89
|
-
<div class="row">
|
90
|
-
<div class="col s6 input-field">
|
91
|
-
<input type="checkbox" class="value" id="ConfBatDetails" />
|
92
|
-
<label for="ConfBatDetails" class="translate">Diagnosis Data from Battery (only tested with two and four modules)</label>
|
93
|
-
</div>
|
94
|
-
</div>
|
95
|
-
<div class="row">
|
96
|
-
<div class="col s6 input-field">
|
97
|
-
<input type="checkbox" class="value" id="ConfTestMode" />
|
98
|
-
<label for="ConfTestMode" class="translate">Test Mode - show data in error log</label>
|
99
|
-
</div>
|
100
|
-
</div>
|
101
|
-
<div class="row">
|
102
|
-
<div class="col s6 input-field">
|
103
|
-
<input type="text" class="value" id="ConfDetailshowoften" />
|
104
|
-
<label for="ConfDetailshowoften" class="translate">Battery-details - every ... cycles</label>
|
105
|
-
</div>
|
106
|
-
</div>
|
107
|
-
</div>
|
108
|
-
|
109
|
-
</div>
|
110
|
-
|
111
|
-
</body>
|
112
|
-
|
1
|
+
<html>
|
2
|
+
|
3
|
+
<head>
|
4
|
+
|
5
|
+
<!-- Load ioBroker scripts and styles-->
|
6
|
+
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
|
7
|
+
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
|
8
|
+
|
9
|
+
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
|
10
|
+
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
11
|
+
|
12
|
+
<script type="text/javascript" src="../../js/translate.js"></script>
|
13
|
+
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
|
14
|
+
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
|
15
|
+
|
16
|
+
<!-- Load our own files -->
|
17
|
+
<link rel="stylesheet" type="text/css" href="style.css" />
|
18
|
+
<script type="text/javascript" src="words.js"></script>
|
19
|
+
|
20
|
+
<script type="text/javascript">
|
21
|
+
// This will be called by the admin adapter when the settings page loads
|
22
|
+
function load(settings, onChange) {
|
23
|
+
// example: select elements with id=key and class=value and insert value
|
24
|
+
if (!settings) return;
|
25
|
+
$('.value').each(function () {
|
26
|
+
var $key = $(this);
|
27
|
+
var id = $key.attr('id');
|
28
|
+
if ($key.attr('type') === 'checkbox') {
|
29
|
+
// do not call onChange direct, because onChange could expect some arguments
|
30
|
+
$key.prop('checked', settings[id])
|
31
|
+
.on('change', () => onChange())
|
32
|
+
;
|
33
|
+
} else {
|
34
|
+
// do not call onChange direct, because onChange could expect some arguments
|
35
|
+
$key.val(settings[id])
|
36
|
+
.on('change', () => onChange())
|
37
|
+
.on('keyup', () => onChange())
|
38
|
+
;
|
39
|
+
}
|
40
|
+
});
|
41
|
+
onChange(false);
|
42
|
+
// reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
|
43
|
+
if (M) M.updateTextFields();
|
44
|
+
}
|
45
|
+
|
46
|
+
// This will be called by the admin adapter when the user presses the save button
|
47
|
+
function save(callback) {
|
48
|
+
// example: select elements with class=value and build settings object
|
49
|
+
var obj = {};
|
50
|
+
$('.value').each(function () {
|
51
|
+
var $this = $(this);
|
52
|
+
if ($this.attr('type') === 'checkbox') {
|
53
|
+
obj[$this.attr('id')] = $this.prop('checked');
|
54
|
+
} else if ($this.attr('type') === 'number') {
|
55
|
+
obj[$this.attr('id')] = parseFloat($this.val());
|
56
|
+
} else {
|
57
|
+
obj[$this.attr('id')] = $this.val();
|
58
|
+
}
|
59
|
+
});
|
60
|
+
callback(obj);
|
61
|
+
}
|
62
|
+
</script>
|
63
|
+
|
64
|
+
</head>
|
65
|
+
|
66
|
+
<body>
|
67
|
+
|
68
|
+
<div class="m adapter-container">
|
69
|
+
|
70
|
+
<div class="row">
|
71
|
+
<div class="col s12 m4 l2">
|
72
|
+
<img src="bydhvs.png" class="logo">
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<!-- Put your content here -->
|
77
|
+
|
78
|
+
<!-- For example columns with settings: -->
|
79
|
+
<div class="row">
|
80
|
+
<div class="col s6 input-field">
|
81
|
+
<input type="text" class="value" id="ConfPollInterval" />
|
82
|
+
<label for="PollInterval" class="translate">Interval (s)</label>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div class="col s6 input-field">
|
86
|
+
<input type="text" class="value" id="ConfIPAdress" />
|
87
|
+
<label for="IP Adress" class="translate">IP Adress</label>
|
88
|
+
</div>
|
89
|
+
<div class="row">
|
90
|
+
<div class="col s6 input-field">
|
91
|
+
<input type="checkbox" class="value" id="ConfBatDetails" />
|
92
|
+
<label for="ConfBatDetails" class="translate">Diagnosis Data from Battery (only tested with two and four modules)</label>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="row">
|
96
|
+
<div class="col s6 input-field">
|
97
|
+
<input type="checkbox" class="value" id="ConfTestMode" />
|
98
|
+
<label for="ConfTestMode" class="translate">Test Mode - show data in error log</label>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
<div class="row">
|
102
|
+
<div class="col s6 input-field">
|
103
|
+
<input type="text" class="value" id="ConfDetailshowoften" />
|
104
|
+
<label for="ConfDetailshowoften" class="translate">Battery-details - every ... cycles</label>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
</body>
|
112
|
+
|
113
113
|
</html>
|
package/admin/style.css
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
/* You can delete those if you want. I just found them very helpful */
|
2
|
-
* {
|
3
|
-
box-sizing: border-box
|
4
|
-
}
|
5
|
-
.m {
|
6
|
-
/* Don't cut off dropdowns! */
|
7
|
-
overflow: initial;
|
8
|
-
}
|
9
|
-
.m.adapter-container,
|
10
|
-
.m.adapter-container > div.App {
|
11
|
-
/* Fix layout/scrolling issues with tabs */
|
12
|
-
height: 100%;
|
13
|
-
width: 100%;
|
14
|
-
position: relative;
|
15
|
-
}
|
16
|
-
.m .select-wrapper + label {
|
17
|
-
/* The positioning for dropdown labels is messed up */
|
18
|
-
transform: none !important;
|
19
|
-
}
|
20
|
-
|
21
|
-
label > i[title] {
|
22
|
-
/* Display the help cursor for the tooltip icons and fix their positioning */
|
23
|
-
cursor: help;
|
24
|
-
margin-left: 0.25em;
|
25
|
-
}
|
26
|
-
|
27
|
-
.dropdown-content {
|
28
|
-
/* Don't wrap text in dropdowns */
|
29
|
-
white-space: nowrap;
|
30
|
-
}
|
31
|
-
|
32
|
-
/* Add your styles here */
|
1
|
+
/* You can delete those if you want. I just found them very helpful */
|
2
|
+
* {
|
3
|
+
box-sizing: border-box
|
4
|
+
}
|
5
|
+
.m {
|
6
|
+
/* Don't cut off dropdowns! */
|
7
|
+
overflow: initial;
|
8
|
+
}
|
9
|
+
.m.adapter-container,
|
10
|
+
.m.adapter-container > div.App {
|
11
|
+
/* Fix layout/scrolling issues with tabs */
|
12
|
+
height: 100%;
|
13
|
+
width: 100%;
|
14
|
+
position: relative;
|
15
|
+
}
|
16
|
+
.m .select-wrapper + label {
|
17
|
+
/* The positioning for dropdown labels is messed up */
|
18
|
+
transform: none !important;
|
19
|
+
}
|
20
|
+
|
21
|
+
label > i[title] {
|
22
|
+
/* Display the help cursor for the tooltip icons and fix their positioning */
|
23
|
+
cursor: help;
|
24
|
+
margin-left: 0.25em;
|
25
|
+
}
|
26
|
+
|
27
|
+
.dropdown-content {
|
28
|
+
/* Don't wrap text in dropdowns */
|
29
|
+
white-space: nowrap;
|
30
|
+
}
|
31
|
+
|
32
|
+
/* Add your styles here */
|