iobroker.openknx 0.0.12 → 0.0.17

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 (65) hide show
  1. package/README.md +113 -61
  2. package/admin/index_m.html +37 -407
  3. package/admin/openknx.png +0 -0
  4. package/admin/words.js +2 -10
  5. package/io-package.json +1 -1
  6. package/lib/knx/AUTHORS +3 -0
  7. package/lib/knx/LICENSE +19 -0
  8. package/lib/knx/README-API.md +138 -0
  9. package/lib/knx/README-datapoints.md +62 -0
  10. package/lib/knx/README-events.md +50 -0
  11. package/lib/knx/README-knxd.md +5 -0
  12. package/lib/knx/README-resilience.md +38 -0
  13. package/lib/knx/README.md +54 -0
  14. package/lib/knx/bitbucket-pipelines.yml +7 -0
  15. package/lib/knx/index.d.ts +70 -0
  16. package/lib/knx/index.js +19 -0
  17. package/lib/knx/manualtest/test-toggle.js +54 -0
  18. package/lib/knx/manualtest/test-writestorm.js +43 -0
  19. package/lib/knx/package.json +117 -0
  20. package/lib/knx/run-wired-tests.sh +2 -0
  21. package/lib/knx/src/Address.js +116 -0
  22. package/lib/knx/src/Connection.js +328 -0
  23. package/lib/knx/src/Datapoint.js +136 -0
  24. package/lib/knx/src/FSM.js +649 -0
  25. package/lib/knx/src/IpRoutingConnection.js +68 -0
  26. package/lib/knx/src/IpTunnelingConnection.js +43 -0
  27. package/lib/knx/src/KnxConstants.js +129 -0
  28. package/lib/knx/src/KnxLog.js +28 -0
  29. package/lib/knx/src/KnxProtocol.js +691 -0
  30. package/lib/knx/src/devices/BinarySwitch.js +51 -0
  31. package/lib/knx/src/devices/index.js +1 -0
  32. package/lib/knx/src/dptlib/dpt1.js +223 -0
  33. package/lib/knx/src/dptlib/dpt10.js +96 -0
  34. package/lib/knx/src/dptlib/dpt11.js +78 -0
  35. package/lib/knx/src/dptlib/dpt12.js +25 -0
  36. package/lib/knx/src/dptlib/dpt13.js +73 -0
  37. package/lib/knx/src/dptlib/dpt14.js +165 -0
  38. package/lib/knx/src/dptlib/dpt15.js +24 -0
  39. package/lib/knx/src/dptlib/dpt16.js +45 -0
  40. package/lib/knx/src/dptlib/dpt17.js +25 -0
  41. package/lib/knx/src/dptlib/dpt18.js +84 -0
  42. package/lib/knx/src/dptlib/dpt19.js +56 -0
  43. package/lib/knx/src/dptlib/dpt2.js +136 -0
  44. package/lib/knx/src/dptlib/dpt20.js +40 -0
  45. package/lib/knx/src/dptlib/dpt21.js +78 -0
  46. package/lib/knx/src/dptlib/dpt232.js +51 -0
  47. package/lib/knx/src/dptlib/dpt237.js +72 -0
  48. package/lib/knx/src/dptlib/dpt238.js +74 -0
  49. package/lib/knx/src/dptlib/dpt3.js +78 -0
  50. package/lib/knx/src/dptlib/dpt4.js +49 -0
  51. package/lib/knx/src/dptlib/dpt5.js +54 -0
  52. package/lib/knx/src/dptlib/dpt6.js +33 -0
  53. package/lib/knx/src/dptlib/dpt7.js +94 -0
  54. package/lib/knx/src/dptlib/dpt8.js +83 -0
  55. package/lib/knx/src/dptlib/dpt9.js +229 -0
  56. package/lib/knx/src/dptlib/index.js +215 -0
  57. package/lib/knx/typescript-sample/README.md +15 -0
  58. package/lib/knx/typescript-sample/package.json +17 -0
  59. package/lib/knx/typescript-sample/test-toggle-onoff.ts +43 -0
  60. package/lib/knx/typescript-sample/tsconfig.json +20 -0
  61. package/lib/knx/typescript-sample/tslint.json +58 -0
  62. package/lib/{generateGAS.js → projectImport.js} +51 -56
  63. package/lib/tools.js +47 -1
  64. package/main.js +186 -146
  65. package/package.json +1 -1
package/README.md CHANGED
@@ -7,74 +7,113 @@
7
7
 
8
8
  [![NPM](https://nodei.co/npm/iobroker.openknx.png?downloads=true)](https://nodei.co/npm/iobroker.openknx/)
9
9
 
10
+ This adapter serves as a communication interface between Iobroker Object tree and a IP Gateway on the KNX bus.
11
+ This adapter allows to generate the communication objects by importing of knxproj Files from ETS.
12
+ All generated Communication Objects are initially configured readable and writeable.
13
+
10
14
  # Installation of early versions
11
15
  This is an early untested version
12
16
  Please make a good backup of all your data!
13
17
  Please do not test in critical environments
14
18
 
15
- in shell
16
- '''
17
- cd /opt/iobroker/node_modules
18
- npm i iobroker.openknx@version
19
- iobroker add openknx
20
- '''
21
- '''
22
- after updates:
23
- iobroker upload openknx
24
- '''
19
+ install in shell
20
+ cd /opt/iobroker/node_modules
21
+ npm i iobroker.openknx
22
+ iobroker add openknx
23
+ npm i knx
24
+
25
+ updates:
26
+ npm i iobroker.openknx
27
+ iobroker upload openknx
28
+
29
+ # GA import
25
30
 
26
- This adapter serves as a communication interface between Iobroker Object tree and a IP Gateway on the KNX bus.
27
- This adapter allows to generate the communication objects by importing of knxproj Files from ETS.
28
31
 
29
32
  # Compatibility
30
- this adapter has is own namespace openknx.
31
- for existing installation that are connected to knx signals of another namspace you can use the setting:
33
+ This adapter has its own namespace 'openknx'.
34
+ for existing applications, that are connected to knx signals of other knx adapters you can use the setting:
32
35
  Override object path
33
- to e.g. knx.0, a new project import will then store the data in this object tree region.
34
- Objects are not compatible, remove them before and disable all other knx adapters.
35
- Leave setting empty to use own namespace.
36
+ to e.g. knx.0. A new project import will then store the data in this object tree space.
37
+ Objects are not compatible, remove them manually before the import and disable all other knx adapters.
38
+ Leave setting empty to use the adapters own namespace.
36
39
 
37
40
  # log level
38
41
 
39
42
 
40
43
  # Adapter setting Interface Description
41
- '''
42
- {
43
- "_id": "path.and.name.to.object",
44
- "type": "state",
45
- "common": {
46
- "desc": "Basetype: 1-bit value, Subtype: switch", //informative
47
- "min": 0, //
48
- "max": 1,
49
- "name": "Aussen Melder Licht schalten", //informative description
50
- "read": true, //default this is set, if false incoming bus values are not updating the object
51
- "role": "", //tbd
52
- "type": "boolean", //boolean, number, string, object
53
- "unit": "", //informative, derived from dpt
54
- "write": true //default true, if set change on object is triggering knx write, succ. write sets then ack flag to true
55
- },
56
- "native": {
57
- "address": "0/0/7", //knx address
58
- "answer_groupValueResponse": false, //default false, if set to true adapter responds with value on GroupValue_Read
59
- "autoread": true, //default true, adapter sends a GroupValue_read on start to sync its states
60
- "bitlength": 1, //size ob knx data
61
- "dpt": "DPT1.001", //DPT
62
- "encoding": { //informative
63
- "0": "Off",
64
- "1": "On"
44
+
45
+ {
46
+ "_id": "path.and.name.to.object", //derieved from the KNX structure
47
+ "type": "state",
48
+ "common": {
49
+ "desc": "Basetype: 1-bit value, Subtype: switch", //informative
50
+ "min": 0, //
51
+ "max": 1,
52
+ "name": "Aussen Melder Licht schalten", //informative description
53
+ "read": true, //default this is set, if false incoming bus values are not updating the object
54
+ "role": "", //tbd
55
+ "type": "boolean", //boolean, number, string, object
56
+ "unit": "", //informative, derived from dpt
57
+ "write": true //default true, if set change on object is triggering knx write, succ. write sets then ack flag to true
58
+ },
59
+ "native": {
60
+ "address": "0/0/7", //knx address
61
+ "answer_groupValueResponse": false, //default false, if set to true adapter responds with value on GroupValue_Read
62
+ "autoread": true, //default true, adapter sends a GroupValue_read on start to sync its states
63
+ "bitlength": 1, //size ob knx data
64
+ "dpt": "DPT1.001", //DPT
65
+ "encoding": { //informative
66
+ "0": "Off",
67
+ "1": "On"
68
+ },
69
+ "force_encoding": "",
70
+ "signedness": "",
71
+ "valuetype": "basic" //composite means set via a specific object
65
72
  },
66
- "force_encoding": "",
67
- "signedness": "",
68
- "valuetype": "basic"
69
- },
70
- "from": "system.adapter.openknx.0",
71
- "user": "system.user.admin",
72
- "ts": 1638913951639
73
- }
74
- '''
73
+ "from": "system.adapter.openknx.0",
74
+ "user": "system.user.admin",
75
+ "ts": 1638913951639
76
+ }
77
+
75
78
 
76
79
  # Adapter communication Interface Description
77
- Supported DPTs 1-21,232,237,238
80
+ handeled DPTs 1-21,232,237,238
81
+
82
+ Unhandeled DPTs are written as raw buffers, the iterface is a sequencial string of hexadecimal number. For example write '0102feff' to send values 0x01 0x02 0xfe 0xff on the bus.
83
+ Where number, see scaling.
84
+
85
+ Description of handeled DPTs
86
+
87
+ javascript datatype special values range
88
+ DPT-1 boolean false, true
89
+ DPT-2 object {"priority":1 bit,"data":1 bit} -
90
+ DPT-3 object {"decr_incr":1 bit,"data":2 bit} -
91
+ DPT-18 object {"save_recall":0,"scenenumber":0}
92
+ DPT-21 object {"outofservice":0,"fault":0,"overridden":0,"inalarm":0,"alarmunack":0} -
93
+ DPT-232 object {red:0..255, green:0.255, blue:0.255} -
94
+ DPT-237 object {"address":0,"addresstype":0,"readresponse":0,"lampfailure":0,"ballastfailure":0,"convertorerror":0} -
95
+ DPT-4 string one character sent as 8-bit character
96
+ DPT-16 string one character sent as 16-character string
97
+ DPT-5 number 8-bit unsigned value
98
+ DPT-5.001 number 0..100 [%] scaled to 1-byte
99
+ DPT-5.003 number 0..360 [°] scaled to 1-byte
100
+ DPT-6 number 8-bit signed -128..127
101
+ DPT-7 number 16-bit unsigned value
102
+ DPT-8 number 2-byte signed value -32768..32767
103
+ DPT-9 number 2-byte floating point value
104
+ DPT-14 number 4-byte floating point value
105
+ DPT-12 number 4-byte unsigned value
106
+ DPT-13 number 4-byte signed value
107
+ DPT-15 number 4-byte
108
+ DPT-17 number 1-byte
109
+ DPT-20 number 1-byte
110
+ DPT-238 number 1-byte
111
+ DPT-10 number for Date Object -
112
+ DPT-11 number for Date Object -
113
+ DPT-19 number for Date Object -
114
+ rest object {0 .. } -
115
+
116
+
78
117
  Only time and date information is exchanged with KNX time based datatypes, e.g. DPT-19 has unsupported fields for signal quality
79
118
 
80
119
  Object send and receive values are of type boolean (eg DPT1), number (scaled, or unscaled), string.
@@ -83,9 +122,9 @@ Other joint DPTs have similar object notation.
83
122
  DPT19 expects a Number from a Date Object, Iobroker can not handle objects, fields of KNX ko that cannot be derived from timestamp are not implemented eg. quality flags
84
123
 
85
124
  Date and time DPTs (DPT10, DPT11)
86
- Please have in mind that Javascript and KNX have very different base type for time and date.
87
- DPT10 is time (hh:mm:ss) plus "day of week". This concept is unavailable in JS, so you'll be getting/setting a regular Date Js object, but please remember you'll need to ignore the date, month and year. The exact same datagram that converts to "Mon, Jul 1st 12:34:56", will evaluate to a wildly different JS Date of "Mon, Jul 8th 12:34:56" one week later. Be warned!
88
- DPT11 is date (dd/mm/yyyy): the same applies for DPT11, you'll need to ignore the time part.
125
+ Please have in mind that Javascript and KNX have very different base type for time and date.
126
+ DPT10 is time (hh:mm:ss) plus "day of week". This concept is unavailable in JS, so you'll be getting/setting a regular Date Js object, but please remember you'll need to ignore the date, month and year. The exact same datagram that converts to "Mon, Jul 1st 12:34:56", will evaluate to a wildly different JS Date of "Mon, Jul 8th 12:34:56" one week later. Be warned!
127
+ DPT11 is date (dd/mm/yyyy): the same applies for DPT11, you'll need to ignore the time part.
89
128
 
90
129
 
91
130
  # Features
@@ -111,11 +150,15 @@ The adapter uses openknx.0 for first instance as default path for Iobroker objec
111
150
  If your existing installation has a lot of references to existing knx objects to an existing folder, then you can specify its location, for example knx.0.
112
151
  This feature will be removed in future.
113
152
 
114
- ##### Upload knxproj
115
- here you can upload your ETS Export in "knxproj" format.
116
- After successful import a message shows how much objects where recognized.
153
+ ##### Upload configuration
154
+ 1st In the ETS go to Group Addresses, select Export Grou Adresses
155
+ Select XML Output Format
156
+ 2nd upload your ETS Export XML in the adapter via the GA XML-Import dialog
157
+
158
+ After the successful import a message shows how much objects where recognized.
117
159
  Press "save & close" or "save" to restart the adapter and take over the changes.
118
160
  When starting, the adapter tries to read all GroupAdresses with have the autoread flag (default setting). This could take a while and can produce a higher load on your KNX-bus. This ensures that the adapter operates with up-to-date values from the start.
161
+ Autoread is done on the first connection with the knx bus after an adapter start or restart, not on every knx reconnection.
119
162
 
120
163
  ## Objects
121
164
  In Objects the group adress tree like in your ETS project.
@@ -125,19 +168,28 @@ If the adapter startet successfully your datapoints will be available for commun
125
168
 
126
169
  ## Datapoint Types
127
170
  Wide DPT (datapoint type) support (DPT1 - DPT21, DPT232, DPT237, DPT238 supported)
171
+ Values of unhandeled DPTs can be written and read out in raw format.
128
172
 
129
173
  # Special settings
130
174
 
131
-
132
175
  # Known Problems
133
- - raw value write where missing DPTs not implemented
134
176
  - sends write instead of response on GroupValue_Read
135
- - onlyAddNewObjects not working
136
177
  - knxprj file only tested from ETS 5.7.4
178
+ - IOBroker object role definition missing
137
179
 
180
+ # limitations
181
+ - three level group address are only supported
138
182
 
139
183
  ## Changelog
140
- ### 0.0.12 (8.12.2021)
184
+ ### 0.0.17
185
+ * raw value handling, can now write and receive ga of unsupported dpt
186
+ * setting onlyAddNewObjects fixed
187
+ * adapter restart after import
188
+
189
+ ### 0.0.14
190
+ * import ga xml
191
+
192
+ ### 0.0.12
141
193
  * initial version
142
194
 
143
195