node-red-contrib-ta-cmi-coe 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/LICENSE +201 -0
- package/README.md +277 -0
- package/__tests__/blockinfo.test.js +24 -0
- package/__tests__/conversion.test.js +22 -0
- package/__tests__/udp.test.js +46 -0
- package/coe/coe-input.html +61 -0
- package/coe/coe-input.js +144 -0
- package/coe/coe-monitor.html +60 -0
- package/coe/coe-monitor.js +138 -0
- package/coe/coe-output.html +99 -0
- package/coe/coe-output.js +68 -0
- package/coe/config.html +52 -0
- package/coe/config.js +101 -0
- package/coe/locales/de/coe-input.html +10 -0
- package/coe/locales/de/coe-input.json +19 -0
- package/coe/locales/de/coe-monitor.html +10 -0
- package/coe/locales/de/coe-monitor.json +20 -0
- package/coe/locales/de/coe-output.html +14 -0
- package/coe/locales/de/coe-output.json +18 -0
- package/coe/locales/de/config.html +13 -0
- package/coe/locales/de/config.json +10 -0
- package/coe/locales/en-US/coe-input.html +10 -0
- package/coe/locales/en-US/coe-input.json +19 -0
- package/coe/locales/en-US/coe-monitor.html +10 -0
- package/coe/locales/en-US/coe-monitor.json +20 -0
- package/coe/locales/en-US/coe-output.html +14 -0
- package/coe/locales/en-US/coe-output.json +18 -0
- package/coe/locales/en-US/config.html +13 -0
- package/coe/locales/en-US/config.json +10 -0
- package/coe/units-config.js +36 -0
- package/lib/coe-v2.js +189 -0
- package/lib/coe.js +109 -0
- package/lib/queueing.js +188 -0
- package/lib/units.js +78 -0
- package/lib/utils.js +163 -0
- package/package.json +39 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Changelog
|
|
2
|
+
|
|
3
|
+
### Version 1.0.0 (Erst-Release)
|
|
4
|
+
- Added Support for CoE Version 2.0
|
|
5
|
+
- Timeout für Input Nodes
|
|
6
|
+
- Konfiguration Adresse UDP-Listener
|
|
7
|
+
- Ergänzungen Dokumentation
|
|
8
|
+
- Einstellung des Block Output Nodes
|
|
9
|
+
- Zweisprachige Einheiten
|
|
10
|
+
- Bug-Fixes
|
|
11
|
+
|
|
12
|
+
### Version 0.9.1
|
|
13
|
+
- Vorbereitungen für zweisprachige Version
|
|
14
|
+
- Fehlerbehebung Output-Nodes
|
|
15
|
+
- Ergänzungen Dokumentation
|
|
16
|
+
|
|
17
|
+
### Version 0.9.0
|
|
18
|
+
- Initiale Veröffentlichung
|
|
19
|
+
- CoE Input, Output und Block Output Nodes
|
|
20
|
+
- Automatische Unit-Konvertierung
|
|
21
|
+
- Unterstützung für alle TA Messgrößen
|
|
22
|
+
- Shared UDP Socket
|
|
23
|
+
- Umfassende Dokumentation
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Florian Mayrhofer
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
**Status**: Erst-Release 27.11.2025
|
|
2
|
+
|
|
3
|
+
# node-red-contrib-ta-cmi-coe
|
|
4
|
+
|
|
5
|
+
Node-RED Bibliothek zum Lesen und Schreiben von Werten an Technische Alternative CMI über CAN over Ethernet (CoE).
|
|
6
|
+
|
|
7
|
+
## Funktionsumfang
|
|
8
|
+
|
|
9
|
+
- Unterstützung für CoE-Version 1 + 2
|
|
10
|
+
- **CoE Input Node**: Empfang von analogen und digitalen Einzelwerten von der CMI
|
|
11
|
+
- **CoE Output Node**: Senden einzelner Werte an das CMI/Regler
|
|
12
|
+
- **CoE Monitor**: Empfängt und überwacht Pakete von allen Quellen
|
|
13
|
+
- Automatische Konvertierung analoger Werte basierend auf Unit ID
|
|
14
|
+
- Unterstützung für von TA definierte Messgrößen
|
|
15
|
+
- Konfiguration von CMI und CoE-Version
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
### Über Node-RED Palette Manager (empfohlen)
|
|
20
|
+
|
|
21
|
+
1. Öffne Node-RED
|
|
22
|
+
2. Menü → Manage palette → Install
|
|
23
|
+
3. Suche nach `node-red-contrib-ta-cmi-coe`
|
|
24
|
+
4. Installiere das Paket
|
|
25
|
+
|
|
26
|
+
### Manuelle Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd ~/.node-red
|
|
30
|
+
npm install node-red-contrib-ta-cmi-coe
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Lokale Entwicklungsumgebung
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd ~/.node-red
|
|
37
|
+
git clone https://github.com/mayflo/node-red-contrib-ta-cmi-coe.git
|
|
38
|
+
cd node-red-contrib-ta-cmi-coe
|
|
39
|
+
npm link
|
|
40
|
+
cd ~/.node-red
|
|
41
|
+
npm link node-red-contrib-ta-cmi-coe
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Starte Node-RED neu.
|
|
45
|
+
|
|
46
|
+
## Voraussetzungen
|
|
47
|
+
|
|
48
|
+
- Node-RED v1.0.0 oder höher
|
|
49
|
+
- CMI von Technische Alternative mit Firmware 1.39.1 oder höher
|
|
50
|
+
- Die verwendete CoE-Version wird auf dem CMI konfiguriert (Einstellungen > CAN > CoE).
|
|
51
|
+
- Für Empfang: CoE-Ausgänge müssen auf der CMI konfiguriert werden (Einstellungen > Ausgänge > CoE).
|
|
52
|
+
- Für Senden: CAN-Eingänge müssen auf dem Regler konfiguriert werden.
|
|
53
|
+
- Für den Empfang von Nachrichten benötigt die verwendeten CMIs eine fest eingestellte IP-Addresse
|
|
54
|
+
- Die Kommunikation erfolgt über UDP-Ports, welche auf dem Node-RED-Host geöffnet werden müssen (CoE V1 Port 5441 / CoE V2 Port 5442)
|
|
55
|
+
|
|
56
|
+
## Unterstützte Geräte
|
|
57
|
+
|
|
58
|
+
Die Bibliothek wurde für UVR610 entwickelt und getestet, funktioniert aber grundsätzlich mit allen Geräten, die über den CAN-Bus der CMI verbunden sind:
|
|
59
|
+
|
|
60
|
+
- UVR16x2
|
|
61
|
+
- UVR1611
|
|
62
|
+
- UVR61-3
|
|
63
|
+
- X2 Regler
|
|
64
|
+
- Andere CAN-Bus Geräte von Technische Alternative
|
|
65
|
+
|
|
66
|
+
## Schnellstart
|
|
67
|
+
|
|
68
|
+
### 1. CMI Configuration Node erstellen
|
|
69
|
+
|
|
70
|
+
Erstelle zunächst eine CMI Configuration:
|
|
71
|
+
- Öffne einen beliebigen Node zur Bearbeitung
|
|
72
|
+
- Bei "CMI Config" auf Plus klicken → "Add new CMI config..."
|
|
73
|
+
- **Lokale IP**: IP-Adressbereich des UDP-Ports (0.0.0.0 = alle Interfaces, 127.0.0.1 = lokales Netzwerk)
|
|
74
|
+
- **CMI Adresse**: (Feste) IP-Adresse des CMI
|
|
75
|
+
- **CoE Version**: CoE V1/V2
|
|
76
|
+
|
|
77
|
+
### 2. CMI konfigurieren
|
|
78
|
+
|
|
79
|
+
#### Für Empfang (CoE Input):
|
|
80
|
+
Auf der CMI unter **Einstellungen → Ausgänge → CoE**:
|
|
81
|
+
- **Eingang**: CAN-Bus Eingang (z.B. CAN1)
|
|
82
|
+
- **IP**: IP-Adresse von Node-RED
|
|
83
|
+
- **Knoten**: Wert aus "Node Number" des Input Nodes
|
|
84
|
+
- **Netzwerkausgang**: Nummer des Ausgangs (1-32)
|
|
85
|
+
- **Sendebedingung**: Nach Bedarf
|
|
86
|
+
|
|
87
|
+
#### Für Senden (CoE Output):
|
|
88
|
+
Auf dem Regler: CAN-Eingang konfigurieren
|
|
89
|
+
- **Knoten**: Wert aus "Node Number" des Output Nodes
|
|
90
|
+
- **Ausgangsnummer**: Nummer des Ausgangs (1-32)
|
|
91
|
+
- **Messgröße**: "Automatisch" für Unit von Node-RED
|
|
92
|
+
|
|
93
|
+
### 3. Beispiel Flow
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
[
|
|
97
|
+
{
|
|
98
|
+
"id": "mycmi",
|
|
99
|
+
"type": "cmiconfig",
|
|
100
|
+
"name": "Mein CMI",
|
|
101
|
+
"localip": "0.0.0.0",
|
|
102
|
+
"address": "192.168.0.100",
|
|
103
|
+
"coeVersion": 1
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "input_example",
|
|
107
|
+
"type": "coe-input",
|
|
108
|
+
"name": "Temperatur Sensor",
|
|
109
|
+
"cmiconfig": "mycmi",
|
|
110
|
+
"nodeNumber": 10,
|
|
111
|
+
"outputNumber": 1,
|
|
112
|
+
"dataType": "analog",
|
|
113
|
+
"timeout": 20,
|
|
114
|
+
"x": 150,
|
|
115
|
+
"y": 100,
|
|
116
|
+
"wires": [["debug123"]]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "debug123",
|
|
120
|
+
"type": "debug",
|
|
121
|
+
"name": "Message",
|
|
122
|
+
"x": 350,
|
|
123
|
+
"y": 100
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "inject1",
|
|
127
|
+
"type": "inject",
|
|
128
|
+
"name": "Setze Sollwert",
|
|
129
|
+
"payload": "22.5",
|
|
130
|
+
"payloadType": "num",
|
|
131
|
+
"repeat": "",
|
|
132
|
+
"x": 150,
|
|
133
|
+
"y": 200,
|
|
134
|
+
"wires": [["output_example"]]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "output_example",
|
|
138
|
+
"type": "coe-output",
|
|
139
|
+
"name": "Sollwert Heizung",
|
|
140
|
+
"cmiconfig": "mycmi",
|
|
141
|
+
"nodeNumber": 11,
|
|
142
|
+
"outputNumber": 5,
|
|
143
|
+
"dataType": "analog",
|
|
144
|
+
"unit": 1,
|
|
145
|
+
"x": 350,
|
|
146
|
+
"y": 200
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Node Typen
|
|
152
|
+
|
|
153
|
+
### CoE Input Node
|
|
154
|
+
|
|
155
|
+
Empfängt Werte von der CMI.
|
|
156
|
+
|
|
157
|
+
**Output Message:**
|
|
158
|
+
```javascript
|
|
159
|
+
{
|
|
160
|
+
payload: 22.5, // Der Wert
|
|
161
|
+
topic: "coe/10/analog/1", // Format: coe/{node}/{type}/{output}
|
|
162
|
+
coe: {
|
|
163
|
+
nodeNumber: 10, // CAN Knoten-Nummer
|
|
164
|
+
blockNumber: 1, // CoE Block-Nummer
|
|
165
|
+
outputNumber: 1, // Netzwerkausgang
|
|
166
|
+
dataType: "analog", // Typ
|
|
167
|
+
unit: 1, // Unit ID (z.B. 1 = °C)
|
|
168
|
+
unitName: "Temperatur °C", // Unit Name
|
|
169
|
+
unitSymbol: "°C°", // Unit Symbol
|
|
170
|
+
sourceIP: "192.168.1.100", // IP der CMI
|
|
171
|
+
raw: { ... } // Rohdaten
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### CoE Output Node
|
|
177
|
+
|
|
178
|
+
Sendet einzelne Werte an die CMI.
|
|
179
|
+
|
|
180
|
+
**Input Message:**
|
|
181
|
+
```javascript
|
|
182
|
+
// Einfach:
|
|
183
|
+
msg.payload = 22.5;
|
|
184
|
+
|
|
185
|
+
// Mit eigener Unit:
|
|
186
|
+
msg.payload = 22.5;
|
|
187
|
+
msg.coe = { unit: 1 }; // Überschreibt Config
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Troubleshooting
|
|
191
|
+
|
|
192
|
+
### Keine Daten empfangen?
|
|
193
|
+
|
|
194
|
+
1. **CMI CoE-Ausgänge prüfen**: IP und Port korrekt?
|
|
195
|
+
2. **Lokale IP**: Max. Empfangsbereich mit Lokale IP = 0.0.0.0 (alle) überprüfen (insbesondere für Docker-Umgebungen)
|
|
196
|
+
3. **Firewall**: Port 5441/UDP (CoE V1) bzw. 5442/UDP (CoE V2) offen?
|
|
197
|
+
4. **Node Number**: Stimmt mit CMI-Konfiguration überein?
|
|
198
|
+
5. **Debug aktivieren**: "Receive All" aktivieren und Debug-Output prüfen
|
|
199
|
+
|
|
200
|
+
### Senden funktioniert nicht?
|
|
201
|
+
|
|
202
|
+
1. **CMI erreichbar?** Ping zur CMI IP
|
|
203
|
+
2. **CAN-Eingang auf Regler**: Knoten-Nr und Ausgangsnr korrekt?
|
|
204
|
+
3. **Timeout auf Regler?** "Sende Ausgänge alle" Intervall nutzen
|
|
205
|
+
|
|
206
|
+
### Mehrere CMIs?
|
|
207
|
+
|
|
208
|
+
- Verwende unterschiedliche Node Numbers
|
|
209
|
+
- ODER verwende unterschiedliche Blocks
|
|
210
|
+
- Sonst überschreiben sich die Werte gegenseitig!
|
|
211
|
+
|
|
212
|
+
### Werte falsch?
|
|
213
|
+
|
|
214
|
+
- **Zu große Werte**: CAN-Bus V1 ist limitiert auf ±32767 (dimensionslos)
|
|
215
|
+
- **Falsche Unit**: Manche Units (Arbeitszahl, Euro) haben Einschränkungen
|
|
216
|
+
- **Nachkommastellen**: Prüfe ob korrekte Unit ID verwendet wird
|
|
217
|
+
|
|
218
|
+
## Bekannte Einschränkungen
|
|
219
|
+
|
|
220
|
+
1. **Max. Wertbereich**: CAN-Bus Version 1 ist limitiert auf ±32767 (V2 für größeren Wertebereich)
|
|
221
|
+
2. **Keine Quittierung**: CoE hat keine Bestätigung (fire-and-forget)
|
|
222
|
+
3. **CMI als Gateway**: Werte werden vom CMI übertragen, können aber nicht direkt an CMI gesendet werden (nur an Regler)
|
|
223
|
+
|
|
224
|
+
## Erweiterte Nutzung
|
|
225
|
+
|
|
226
|
+
### Periodisches Senden (verhindert Timeout)
|
|
227
|
+
|
|
228
|
+
```javascript
|
|
229
|
+
// In Function Node:
|
|
230
|
+
const intervalMinutes = 5;
|
|
231
|
+
|
|
232
|
+
// Timer starten
|
|
233
|
+
if (!context.timer) {
|
|
234
|
+
context.timer = setInterval(() => {
|
|
235
|
+
node.send({ payload: msg.payload });
|
|
236
|
+
}, intervalMinutes * 60 * 1000);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return msg;
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Custom Unit Conversion
|
|
243
|
+
|
|
244
|
+
```javascript
|
|
245
|
+
// In Function Node vor Output:
|
|
246
|
+
const rawValue = msg.payload * 100; // 2 Nachkommastellen
|
|
247
|
+
msg.payload = rawValue;
|
|
248
|
+
msg.coe = { unit: 0 }; // Dimensionslos
|
|
249
|
+
return msg;
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Lizenz
|
|
253
|
+
|
|
254
|
+
Veröffentlicht unter der [Apache 2.0 Lizenz](LICENSE)
|
|
255
|
+
|
|
256
|
+
- ✅ Private und gewerbliche Nutzung
|
|
257
|
+
- ⚠️ Keine Haftung für Schäden durch Nutzung
|
|
258
|
+
|
|
259
|
+
## Credits
|
|
260
|
+
|
|
261
|
+
Basiert auf dem Protokoll-Verständnis und der Dokumentation von:
|
|
262
|
+
- [SymconJoTTACoE](https://github.com/jotata/SymconJoTTACoE/) von jotata
|
|
263
|
+
- [Ta-CoE](https://gitlab.com/DeerMaximum/ta-coe) von DeerMaximum
|
|
264
|
+
|
|
265
|
+
## Support
|
|
266
|
+
|
|
267
|
+
- **Issues**: GitHub Issue Tracker
|
|
268
|
+
- **Fragen**: GitHub Discussions
|
|
269
|
+
- **Dokumentation**: Siehe README und Node-RED Info-Panel
|
|
270
|
+
|
|
271
|
+
## Autor
|
|
272
|
+
|
|
273
|
+
mayflo
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
**Hinweis**: Diese Bibliothek wurde in der Freizeit entwickelt. Support erfolgt nach Verfügbarkeit. Besten Dank für dein Verständnis! 😊
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const { getBlockInfo } = require("../lib/utils");
|
|
2
|
+
|
|
3
|
+
describe("Block Info Tests", () => {
|
|
4
|
+
test("Analog Output 1 → Block 1, Position 0", () => {
|
|
5
|
+
expect(getBlockInfo("analog", 1)).toEqual({ block: 1, position: 0 });
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
test("Analog Output 5 → Block 2, Position 0", () => {
|
|
9
|
+
expect(getBlockInfo("analog", 5)).toEqual({ block: 2, position: 0 });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test("Digital Output 10 → Block 0, Position 9", () => {
|
|
13
|
+
expect(getBlockInfo("digital", 10)).toEqual({ block: 0, position: 9 });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("Digital Output 20 → Block 9, Position 3", () => {
|
|
17
|
+
expect(getBlockInfo("digital", 20)).toEqual({ block: 9, position: 3 });
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("Ungültiger Output → Default", () => {
|
|
21
|
+
expect(getBlockInfo("analog", 0)).toEqual({ block: 1, position: 0 });
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { convertCoEToValue, convertValueToCoE, getUnitInfo } = require("../lib/utils");
|
|
2
|
+
|
|
3
|
+
describe("CoE Conversion Utilities", () => {
|
|
4
|
+
test("°C mit Unit=1, decimals=1", () => {
|
|
5
|
+
const unitInfo = { decimals: 1 };
|
|
6
|
+
expect(convertCoEToValue(225, 1, 1)).toBe(22.5);
|
|
7
|
+
expect(convertValueToCoE(22.5, 1, 1)).toBe(225);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test("kW mit Unit=10, Protocol V2 override", () => {
|
|
11
|
+
// V2 überschreibt decimals=2
|
|
12
|
+
expect(convertCoEToValue(2500, 10, 2)).toBe(25.0);
|
|
13
|
+
expect(convertValueToCoE(25.0, 10, 2)).toBe(2500);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("Unknown Unit", () => {
|
|
17
|
+
const info = getUnitInfo(999, "de");
|
|
18
|
+
expect(info.name).toMatch(/Unknown/);
|
|
19
|
+
expect(convertCoEToValue(1234, 999, 1)).toBe(1234); // decimals=0
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const dgram = require("dgram");
|
|
2
|
+
|
|
3
|
+
describe("UDP Integration mit Mock", () => {
|
|
4
|
+
let server;
|
|
5
|
+
let received;
|
|
6
|
+
|
|
7
|
+
beforeAll(() => {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
server = dgram.createSocket("udp4");
|
|
10
|
+
server.on("listening", resolve);
|
|
11
|
+
server.on("message", (msg) => {
|
|
12
|
+
received = msg.toString();
|
|
13
|
+
});
|
|
14
|
+
server.bind(5555); // besser eigenen Test-Port nehmen
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
afterAll(() => {
|
|
19
|
+
server.close();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test("Sendet Testpaket", () => {
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const client = dgram.createSocket("udp4");
|
|
25
|
+
const payload = Buffer.from("Hallo UDP-Mock!");
|
|
26
|
+
|
|
27
|
+
client.send(payload, 5555, "127.0.0.1", (err) => {
|
|
28
|
+
if (err) {
|
|
29
|
+
client.close();
|
|
30
|
+
return reject(err);
|
|
31
|
+
}
|
|
32
|
+
client.close();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
try {
|
|
37
|
+
expect(received).toBe("Hallo UDP-Mock!");
|
|
38
|
+
resolve();
|
|
39
|
+
} catch (e) {
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
}, 200);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
CoE Input Node HTML-File
|
|
3
|
+
|
|
4
|
+
Copyright 2025 Florian Mayrhofer
|
|
5
|
+
Licensed under the Apache License, Version 2.0
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
<script type="text/javascript">
|
|
9
|
+
RED.nodes.registerType('coe-input', {
|
|
10
|
+
category: 'TA CMI',
|
|
11
|
+
color: '#C0DEED',
|
|
12
|
+
defaults: {
|
|
13
|
+
name: { value: "" },
|
|
14
|
+
cmiconfig: { value: "", type: "cmiconfig", required: true },
|
|
15
|
+
nodeNumber: { value: 1, validate: RED.validators.number() },
|
|
16
|
+
outputNumber: { value: 1, validate: RED.validators.number() },
|
|
17
|
+
dataType: { value: "analog" },
|
|
18
|
+
timeout: { value: 20 }
|
|
19
|
+
},
|
|
20
|
+
inputs: 0,
|
|
21
|
+
outputs: 1,
|
|
22
|
+
icon: "arrow-in.svg",
|
|
23
|
+
label: function() {
|
|
24
|
+
const type = this.dataType === 'analog' ? 'A' : 'D';
|
|
25
|
+
return this.name || `CoE In (${type}${this.outputNumber})`;
|
|
26
|
+
},
|
|
27
|
+
labelStyle: function() {
|
|
28
|
+
return this.name ? "node_label_italic" : "";
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<script type="text/html" data-template-name="coe-input">
|
|
34
|
+
<div class="form-row">
|
|
35
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="coe-input.label.name"></span></label>
|
|
36
|
+
<input type="text" id="node-input-name">
|
|
37
|
+
</div>
|
|
38
|
+
<div class="form-row">
|
|
39
|
+
<label for="node-input-cmiconfig"><i class="fa fa-cog"></i> <span data-i18n="coe-input.label.cmiconfig"></span></label>
|
|
40
|
+
<input type="text" id="node-input-cmiconfig">
|
|
41
|
+
</div>
|
|
42
|
+
<div class="form-row">
|
|
43
|
+
<label for="node-input-nodeNumber"><i class="fa fa-sitemap"></i> <span data-i18n="coe-input.label.nodeNumber"></span></label>
|
|
44
|
+
<input type="number" id="node-input-nodeNumber" placeholder="1" min="0" max="62">
|
|
45
|
+
</div>
|
|
46
|
+
<div class="form-row">
|
|
47
|
+
<label for="node-input-outputNumber"><i class="fa fa-arrow-down"></i> <span data-i18n="coe-input.label.outputNumber"></span></label>
|
|
48
|
+
<input type="number" id="node-input-outputNumber" placeholder="1" min="1" max="32">
|
|
49
|
+
</div>
|
|
50
|
+
<div class="form-row">
|
|
51
|
+
<label for="node-input-dataType"><i class="fa fa-list"></i> <span data-i18n="coe-input.label.dataType"></span></label>
|
|
52
|
+
<select id="node-input-dataType">
|
|
53
|
+
<option value="analog">Analog</span></option>
|
|
54
|
+
<option value="digital">Digital</span></option>
|
|
55
|
+
</select>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="form-row">
|
|
58
|
+
<label for="node-input-timeout"><i class="fa fa-clock-o"></i> <span data-i18n="coe-input.label.timeout"></span></label>
|
|
59
|
+
<input type="number" id="node-input-timeout" placeholder="Timeout (Min.)" value="20">
|
|
60
|
+
</div>
|
|
61
|
+
</script>
|