homebridge-hap-homematic 0.0.0-stage → 0.2.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.
Files changed (132) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +98 -0
  3. package/README.md +97 -2
  4. package/config.schema.json +119 -0
  5. package/dist/src/ccu/CcuClient.d.ts +133 -0
  6. package/dist/src/ccu/CcuClient.js +422 -0
  7. package/dist/src/ccu/CcuClient.js.map +1 -0
  8. package/dist/src/ccu/Discovery.d.ts +78 -0
  9. package/dist/src/ccu/Discovery.js +173 -0
  10. package/dist/src/ccu/Discovery.js.map +1 -0
  11. package/dist/src/ccu/EventServer.d.ts +60 -0
  12. package/dist/src/ccu/EventServer.js +154 -0
  13. package/dist/src/ccu/EventServer.js.map +1 -0
  14. package/dist/src/ccu/InterfaceSupervisor.d.ts +100 -0
  15. package/dist/src/ccu/InterfaceSupervisor.js +227 -0
  16. package/dist/src/ccu/InterfaceSupervisor.js.map +1 -0
  17. package/dist/src/ccu/RpcClient.d.ts +127 -0
  18. package/dist/src/ccu/RpcClient.js +243 -0
  19. package/dist/src/ccu/RpcClient.js.map +1 -0
  20. package/dist/src/ccu/pairing.d.ts +23 -0
  21. package/dist/src/ccu/pairing.js +53 -0
  22. package/dist/src/ccu/pairing.js.map +1 -0
  23. package/dist/src/ccu/xmlRpc.d.ts +20 -0
  24. package/dist/src/ccu/xmlRpc.js +324 -0
  25. package/dist/src/ccu/xmlRpc.js.map +1 -0
  26. package/dist/src/index.d.ts +3 -0
  27. package/dist/src/index.js +6 -0
  28. package/dist/src/index.js.map +1 -0
  29. package/dist/src/platform.d.ts +52 -0
  30. package/dist/src/platform.js +303 -0
  31. package/dist/src/platform.js.map +1 -0
  32. package/dist/src/services/AccessoryBase.d.ts +89 -0
  33. package/dist/src/services/AccessoryBase.js +277 -0
  34. package/dist/src/services/AccessoryBase.js.map +1 -0
  35. package/dist/src/services/impl/BlindAccessory.d.ts +2 -0
  36. package/dist/src/services/impl/BlindAccessory.js +224 -0
  37. package/dist/src/services/impl/BlindAccessory.js.map +1 -0
  38. package/dist/src/services/impl/ColorTempDimmerAccessory.d.ts +7 -0
  39. package/dist/src/services/impl/ColorTempDimmerAccessory.js +120 -0
  40. package/dist/src/services/impl/ColorTempDimmerAccessory.js.map +1 -0
  41. package/dist/src/services/impl/ContactAccessory.d.ts +2 -0
  42. package/dist/src/services/impl/ContactAccessory.js +89 -0
  43. package/dist/src/services/impl/ContactAccessory.js.map +1 -0
  44. package/dist/src/services/impl/DimmerAccessory.d.ts +2 -0
  45. package/dist/src/services/impl/DimmerAccessory.js +56 -0
  46. package/dist/src/services/impl/DimmerAccessory.js.map +1 -0
  47. package/dist/src/services/impl/DoorOpenerAccessory.d.ts +2 -0
  48. package/dist/src/services/impl/DoorOpenerAccessory.js +64 -0
  49. package/dist/src/services/impl/DoorOpenerAccessory.js.map +1 -0
  50. package/dist/src/services/impl/DoorbellAccessory.d.ts +14 -0
  51. package/dist/src/services/impl/DoorbellAccessory.js +66 -0
  52. package/dist/src/services/impl/DoorbellAccessory.js.map +1 -0
  53. package/dist/src/services/impl/GarageDoorAccessory.d.ts +22 -0
  54. package/dist/src/services/impl/GarageDoorAccessory.js +147 -0
  55. package/dist/src/services/impl/GarageDoorAccessory.js.map +1 -0
  56. package/dist/src/services/impl/HumidityAccessory.d.ts +2 -0
  57. package/dist/src/services/impl/HumidityAccessory.js +41 -0
  58. package/dist/src/services/impl/HumidityAccessory.js.map +1 -0
  59. package/dist/src/services/impl/IrrigationAccessory.d.ts +16 -0
  60. package/dist/src/services/impl/IrrigationAccessory.js +184 -0
  61. package/dist/src/services/impl/IrrigationAccessory.js.map +1 -0
  62. package/dist/src/services/impl/LeakAccessory.d.ts +2 -0
  63. package/dist/src/services/impl/LeakAccessory.js +37 -0
  64. package/dist/src/services/impl/LeakAccessory.js.map +1 -0
  65. package/dist/src/services/impl/LockAccessory.d.ts +2 -0
  66. package/dist/src/services/impl/LockAccessory.js +72 -0
  67. package/dist/src/services/impl/LockAccessory.js.map +1 -0
  68. package/dist/src/services/impl/MotionAccessory.d.ts +2 -0
  69. package/dist/src/services/impl/MotionAccessory.js +34 -0
  70. package/dist/src/services/impl/MotionAccessory.js.map +1 -0
  71. package/dist/src/services/impl/PowerMeterAccessory.d.ts +2 -0
  72. package/dist/src/services/impl/PowerMeterAccessory.js +122 -0
  73. package/dist/src/services/impl/PowerMeterAccessory.js.map +1 -0
  74. package/dist/src/services/impl/ProgrammableSwitchAccessory.d.ts +2 -0
  75. package/dist/src/services/impl/ProgrammableSwitchAccessory.js +48 -0
  76. package/dist/src/services/impl/ProgrammableSwitchAccessory.js.map +1 -0
  77. package/dist/src/services/impl/RgbLightAccessory.d.ts +8 -0
  78. package/dist/src/services/impl/RgbLightAccessory.js +169 -0
  79. package/dist/src/services/impl/RgbLightAccessory.js.map +1 -0
  80. package/dist/src/services/impl/SlatBlindAccessory.d.ts +2 -0
  81. package/dist/src/services/impl/SlatBlindAccessory.js +119 -0
  82. package/dist/src/services/impl/SlatBlindAccessory.js.map +1 -0
  83. package/dist/src/services/impl/SmokeAccessory.d.ts +4 -0
  84. package/dist/src/services/impl/SmokeAccessory.js +111 -0
  85. package/dist/src/services/impl/SmokeAccessory.js.map +1 -0
  86. package/dist/src/services/impl/SwitchAccessory.d.ts +2 -0
  87. package/dist/src/services/impl/SwitchAccessory.js +52 -0
  88. package/dist/src/services/impl/SwitchAccessory.js.map +1 -0
  89. package/dist/src/services/impl/TemperatureAccessory.d.ts +2 -0
  90. package/dist/src/services/impl/TemperatureAccessory.js +42 -0
  91. package/dist/src/services/impl/TemperatureAccessory.js.map +1 -0
  92. package/dist/src/services/impl/ThermostatAccessory.d.ts +2 -0
  93. package/dist/src/services/impl/ThermostatAccessory.js +111 -0
  94. package/dist/src/services/impl/ThermostatAccessory.js.map +1 -0
  95. package/dist/src/services/impl/WeatherStationAccessory.d.ts +15 -0
  96. package/dist/src/services/impl/WeatherStationAccessory.js +110 -0
  97. package/dist/src/services/impl/WeatherStationAccessory.js.map +1 -0
  98. package/dist/src/services/registry.d.ts +20 -0
  99. package/dist/src/services/registry.js +71 -0
  100. package/dist/src/services/registry.js.map +1 -0
  101. package/dist/src/services/types.d.ts +93 -0
  102. package/dist/src/services/types.js +13 -0
  103. package/dist/src/services/types.js.map +1 -0
  104. package/dist/src/settings.d.ts +8 -0
  105. package/dist/src/settings.js +11 -0
  106. package/dist/src/settings.js.map +1 -0
  107. package/dist/src/types.d.ts +126 -0
  108. package/dist/src/types.js +10 -0
  109. package/dist/src/types.js.map +1 -0
  110. package/dist/src/util/address.d.ts +18 -0
  111. package/dist/src/util/address.js +81 -0
  112. package/dist/src/util/address.js.map +1 -0
  113. package/dist/src/util/config.d.ts +24 -0
  114. package/dist/src/util/config.js +107 -0
  115. package/dist/src/util/config.js.map +1 -0
  116. package/dist/src/util/devices.d.ts +50 -0
  117. package/dist/src/util/devices.js +241 -0
  118. package/dist/src/util/devices.js.map +1 -0
  119. package/dist/src/util/logger.d.ts +21 -0
  120. package/dist/src/util/logger.js +66 -0
  121. package/dist/src/util/logger.js.map +1 -0
  122. package/dist/src/util/sanitize.d.ts +55 -0
  123. package/dist/src/util/sanitize.js +110 -0
  124. package/dist/src/util/sanitize.js.map +1 -0
  125. package/dist/src/util/storage.d.ts +27 -0
  126. package/dist/src/util/storage.js +79 -0
  127. package/dist/src/util/storage.js.map +1 -0
  128. package/homebridge-ui/public/app.js +1028 -0
  129. package/homebridge-ui/public/index.html +165 -0
  130. package/homebridge-ui/server.js +361 -0
  131. package/homebridge-ui/server.src.js +243 -0
  132. package/package.json +76 -4
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 describing the origin of the Work and
141
+ 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 Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend, and
172
+ hold each Contributor harmless for any liability incurred by, or
173
+ claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
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 2026 Matthias Einig and contributors.
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/NOTICE ADDED
@@ -0,0 +1,98 @@
1
+ homebridge-hap-homematic
2
+ Copyright 2026 california444
3
+
4
+ This product is a hard fork of Homebridge-Homematic-HAP
5
+ (https://github.com/matthiaseinig/Homebridge-Homematic-HAP), forked at
6
+ commit d635ecf (v1.2.12, 2026-05-05). The upstream notice follows
7
+ unchanged; the modifications made in this fork are listed at the end.
8
+
9
+ ----------------------------------------------------------------------
10
+
11
+ Homebridge-Homematic-HAP
12
+ Copyright 2026 Matthias Einig and contributors
13
+
14
+ This product is a derivative of, and is heavily inspired by, the
15
+ following two works by thkl (https://github.com/thkl), without which
16
+ this project would not exist. We gratefully acknowledge thkl's years
17
+ of work on the HomeMatic ↔ HomeKit ecosystem. Both upstream works are
18
+ licensed under Apache License 2.0.
19
+
20
+ * hap-homematic
21
+ https://github.com/thkl/hap-homematic
22
+ The standalone HomeKit accessory protocol bridge that runs as a
23
+ Raspberrymatic / CCU3 addon. Its configuration model, channel-to-service
24
+ dispatch design, multi-bridge instance pattern, ReGa script discovery,
25
+ and overall architecture are the primary specification this project
26
+ re-implements as a Homebridge dynamic platform plugin. The hap-homematic
27
+ backup/import format is consumed verbatim so existing users can migrate.
28
+ Copyright (c) thkl. Apache-2.0.
29
+
30
+ * homebridge-homematic
31
+ https://github.com/thkl/homebridge-homematic
32
+ The original (now unmaintained) Homebridge plugin. The four-tier channel
33
+ service dispatch (address -> device:channel -> channel -> device), the
34
+ EventServer watchdog reconnection logic, and the BIN-RPC/XML-RPC + ReGa
35
+ dual-transport split inform the modernized TypeScript implementation
36
+ here. Individual ChannelServices/* files were studied as a behavioral
37
+ reference; no source is copied verbatim.
38
+ Copyright (c) thkl. Apache-2.0.
39
+
40
+ * homebridge-homematic-asaw
41
+ https://github.com/AlexanderSchmutz/homebridge-homematic-asaw
42
+ A maintained fork of thkl/homebridge-homematic that contributed two
43
+ robustness ideas adopted in src/util/sanitize.ts: defensive coercion
44
+ of CCU datapoint values to finite, in-range numbers before pushing
45
+ them to HomeKit characteristics, and the auto-detection of LEVEL
46
+ datapoints arriving as 0..1 vs 0..100 (a CCU firmware quirk that
47
+ otherwise produces 10000% blind positions). No code is copied
48
+ verbatim; the patterns were re-implemented.
49
+ Copyright (c) Alexander Schmutz. ISC License.
50
+
51
+ This product also depends on, and gratefully links to, the following
52
+ third-party libraries:
53
+
54
+ * homematic-xmlrpc (MIT) -- XML-RPC client/server for CCU
55
+ * @homebridge/plugin-ui-utils (Apache-2.0) -- Custom Homebridge UI host
56
+ * iconv-lite (MIT) -- ISO-8859-1 string decoding
57
+ * tar (ISC) -- Backup tarball extraction
58
+ * homebridge (Apache-2.0) -- Type definitions only
59
+
60
+ See LICENSE for the full Apache 2.0 license text that governs this project.
61
+
62
+ ----------------------------------------------------------------------
63
+
64
+ Modifications (homebridge-hap-homematic, 2026, california444)
65
+
66
+ This fork is maintained independently; no changes are exchanged with
67
+ the upstream project. Modified files carry a "Modified by california444
68
+ (2026)" notice at the top (Apache-2.0, section 4(b)).
69
+
70
+ * 2026-11-11 Forked at d635ecf. Renamed package to
71
+ homebridge-hap-homematic and the platform to HapHomematic;
72
+ Node >= 24 and Homebridge >= 2.4.0 only; CI on Node 24.
73
+ * 2026-11-11 Window-covering movement reporting
74
+ (src/services/impl/BlindAccessory.ts and
75
+ test/unit/blindMovement.test.ts) taken from upstream
76
+ commit 2011787 (2026-11-11), Apache-2.0.
77
+ * 2026-11-11 XML-RPC only: removed the JSON-RPC control plane,
78
+ system variables, programs, rooms, the hap-homematic
79
+ import, multi-bridge support and the BidCos-Wired /
80
+ VirtualDevices / CUxD interfaces; discovery via XML-RPC
81
+ listDevices. The tar and iconv-lite dependencies listed
82
+ in the upstream notice above are no longer used.
83
+ * 2026-11-11 Device mappings moved to devices.json (validated);
84
+ discovery and paramset caches; XML-RPC over TLS and with
85
+ Basic auth; homematic-xmlrpc 2.0.0 without the upstream
86
+ deserializer patch; accessory UUIDs per interface, serial,
87
+ channel and service.
88
+ * 2026-11-11 Per-interface connection supervision (ping/PONG, stale
89
+ detection, backoff, re-subscribe after a CCU restart,
90
+ init handshake check) replaces the global watchdog.
91
+ * 2026-11-11 Start values via getParamset (no getValue), typed
92
+ setValue, "No Response" for unknown values, StatusFault,
93
+ value limits; HmIP transmitter/receiver pairing; smoke
94
+ detectors via SMOKE_DETECTOR_ALARM_STATUS; blind invert;
95
+ new IrrigationAccessory and DoorbellAccessory.
96
+ * 2026-11-11 Custom UI: whole-device mappings, generic service
97
+ options, D6 warning on service change, callback address
98
+ picker.
package/README.md CHANGED
@@ -1,3 +1,98 @@
1
- # Temporary Holding Version
1
+ # homebridge-hap-homematic
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <!--
4
+ Modified by california444 (2026) for homebridge-hap-homematic,
5
+ a hard fork of Homebridge-Homematic-HAP (Apache-2.0). See NOTICE.
6
+ -->
7
+
8
+ [![Release](https://github.com/california444/homebridge-hap-homematic/actions/workflows/release.yml/badge.svg)](https://github.com/california444/homebridge-hap-homematic/actions/workflows/release.yml)
9
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
10
+
11
+ A Homebridge plugin for **HomeMatic** (BidCos-RF) and **HomematicIP** (HmIP-RF)
12
+ devices on a CCU / OpenCCU. It talks to `rfd` and `HMIPServer` over **XML-RPC
13
+ only**: no JSON-RPC, no ReGa, no CCU login.
14
+
15
+ ## Which project is which?
16
+
17
+ The names are close, so to be clear:
18
+
19
+ | Project | What it is |
20
+ | --- | --- |
21
+ | **homebridge-hap-homematic** (this repo) | Homebridge plugin, hard fork of Homebridge-Homematic-HAP, XML-RPC only, one child bridge |
22
+ | [Homebridge-Homematic-HAP](https://github.com/matthiaseinig/Homebridge-Homematic-HAP) (npm `homebridge-homematic-hap`) | The upstream Homebridge plugin this fork is based on (JSON-RPC + XML-RPC, variables, programs, multi-bridge, hap-homematic import) |
23
+ | [hap-homematic](https://github.com/thkl/hap-homematic) | thkl's original HomeKit bridge, running as a CCU add-on |
24
+
25
+ This fork is maintained independently. No changes are sent upstream or
26
+ taken from it.
27
+
28
+ ## Status
29
+
30
+ Work in progress. Based on upstream v1.2.12; JSON-RPC, system
31
+ variables, programs, rooms, the hap-homematic import and multi-bridge
32
+ support are removed (see NOTICE). Discovery runs over XML-RPC
33
+ `listDevices` with a cache, mappings live in
34
+ `<storagePath>/homebridge-hap-homematic/devices.json`
35
+ ([docs/DEVICES.md](docs/DEVICES.md)), TLS and Basic auth on the XML-RPC
36
+ ports are supported. Each interface is supervised with ping/PONG and
37
+ re-subscribed after a CCU restart. Start values come from `getParamset`;
38
+ new services: irrigation (IrrigationSystem + Valves), doorbell
39
+ (HmIP-DSD-PCB); HmIP smoke detector via `SMOKE_DETECTOR_ALARM_STATUS`;
40
+ HmIP transmitter/receiver channel pairing. The custom UI maps channels
41
+ or whole devices (irrigation), edits service options and offers the
42
+ local IPv4 addresses as callback address. Planned:
43
+
44
+ - release pipeline, installation and acceptance on the real system
45
+
46
+ ## Requirements
47
+
48
+ - Node.js ≥ 24
49
+ - Homebridge ≥ 2.4.0
50
+ - CCU / OpenCCU with the XML-RPC ports reachable from the Homebridge host
51
+ (default 2001 for BidCos-RF, 2010 for HmIP-RF), and the plugin's event
52
+ server port (default 9875) reachable from the CCU
53
+
54
+ ## Install (local build)
55
+
56
+ `dist/` is not checked in. Build a package and install it on the
57
+ Homebridge host:
58
+
59
+ ```bash
60
+ npm ci
61
+ npm run build
62
+ npm pack # → homebridge-hap-homematic-<version>.tgz
63
+ # on the Homebridge host:
64
+ npm install -g ./homebridge-hap-homematic-<version>.tgz
65
+ ```
66
+
67
+ ## Development
68
+
69
+ ```bash
70
+ npm ci
71
+ npm run lint
72
+ npm run build
73
+ npm run coverage
74
+ ```
75
+
76
+ ## Releases
77
+
78
+ Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
79
+ (`feat:`, `fix:`, `chore(deps):` …). Every push to `main` builds and tests;
80
+ [semantic-release](https://github.com/semantic-release/semantic-release)
81
+ then tags `vX.Y.Z` and creates the GitHub release with notes
82
+ (`feat` → minor, `fix` / `chore(deps)` → patch, breaking change → major).
83
+ `package.json` keeps the placeholder `0.0.0-development`; the tag is the
84
+ version. Publishing to npm (trusted publishing, provenance) is a separate
85
+ job that needs approval in the `npm` environment and is switched off
86
+ until the plugin has passed acceptance (repository variable
87
+ `NPM_PUBLISH`).
88
+
89
+ ## Acknowledgements
90
+
91
+ Built on the work of [mattein](https://github.com/matthiaseinig)
92
+ (Homebridge-Homematic-HAP) and [thkl](https://github.com/thkl)
93
+ (hap-homematic, homebridge-homematic). See [NOTICE](NOTICE) for the full
94
+ attribution.
95
+
96
+ ## License
97
+
98
+ Apache-2.0, see [LICENSE](LICENSE) and [NOTICE](NOTICE).
@@ -0,0 +1,119 @@
1
+ {
2
+ "pluginAlias": "HapHomematic",
3
+ "pluginType": "platform",
4
+ "singular": true,
5
+ "strictValidation": false,
6
+ "customUi": true,
7
+ "customUiPath": "./homebridge-ui",
8
+ "headerDisplay": "**HomeMatic (BidCos-RF) / HomematicIP (HmIP-RF)** plugin for a CCU / OpenCCU, using XML-RPC only. Use the **custom UI** below to discover devices and map channels to HomeKit.",
9
+ "footerDisplay": "Hard fork of [Homebridge-Homematic-HAP](https://github.com/matthiaseinig/Homebridge-Homematic-HAP), which builds on [thkl/hap-homematic](https://github.com/thkl/hap-homematic) and [thkl/homebridge-homematic](https://github.com/thkl/homebridge-homematic). Apache-2.0.",
10
+ "schema": {
11
+ "type": "object",
12
+ "properties": {
13
+ "name": {
14
+ "title": "Platform name",
15
+ "type": "string",
16
+ "default": "HapHomematic",
17
+ "required": true
18
+ },
19
+ "ccuIp": {
20
+ "title": "CCU IP / hostname",
21
+ "type": "string",
22
+ "format": "hostname",
23
+ "required": true,
24
+ "placeholder": "192.168.1.10",
25
+ "description": "Address of your CCU / OpenCCU / RaspberryMatic."
26
+ },
27
+ "interfaces": {
28
+ "title": "CCU interfaces",
29
+ "type": "object",
30
+ "properties": {
31
+ "bidcosRf": {
32
+ "title": "BidCos-RF",
33
+ "type": "boolean",
34
+ "default": true
35
+ },
36
+ "hmIpRf": {
37
+ "title": "HmIP-RF",
38
+ "type": "boolean",
39
+ "default": true
40
+ }
41
+ }
42
+ },
43
+ "interfacePorts": {
44
+ "title": "XML-RPC port overrides",
45
+ "type": "object",
46
+ "description": "XML-RPC ports of the CCU interfaces. Defaults: BidCos-RF 2001, HmIP-RF 2010; with TLS 42001 / 42010.",
47
+ "properties": {
48
+ "BidCos-RF": {
49
+ "title": "BidCos-RF port",
50
+ "type": "integer",
51
+ "minimum": 1,
52
+ "maximum": 65535,
53
+ "placeholder": "2001"
54
+ },
55
+ "HmIP-RF": {
56
+ "title": "HmIP-RF port",
57
+ "type": "integer",
58
+ "minimum": 1,
59
+ "maximum": 65535,
60
+ "placeholder": "2010"
61
+ }
62
+ }
63
+ },
64
+ "useTls": {
65
+ "title": "Use TLS to talk to CCU",
66
+ "type": "boolean",
67
+ "default": false,
68
+ "description": "XML-RPC over HTTPS (ports 42001 / 42010). The CCU's self-signed certificate is accepted."
69
+ },
70
+ "rpcAuth": {
71
+ "title": "XML-RPC authentication",
72
+ "type": "object",
73
+ "description": "HTTP Basic auth on the XML-RPC ports, only if enabled on the CCU (Settings → Control Panel → Security → Authentication).",
74
+ "properties": {
75
+ "enabled": {
76
+ "title": "Use authentication",
77
+ "type": "boolean",
78
+ "default": false
79
+ },
80
+ "username": {
81
+ "title": "Username",
82
+ "type": "string"
83
+ },
84
+ "password": {
85
+ "title": "Password",
86
+ "type": "string",
87
+ "format": "password"
88
+ }
89
+ }
90
+ },
91
+ "eventServer": {
92
+ "title": "Local event server",
93
+ "type": "object",
94
+ "properties": {
95
+ "host": {
96
+ "title": "Bind address",
97
+ "type": "string",
98
+ "default": "0.0.0.0",
99
+ "description": "Local address the event server listens on. 0.0.0.0 = all interfaces."
100
+ },
101
+ "callbackHost": {
102
+ "title": "Callback address",
103
+ "type": "string",
104
+ "required": true,
105
+ "placeholder": "192.168.0.13",
106
+ "description": "IP or hostname under which the CCU reaches this Homebridge host. Required."
107
+ },
108
+ "port": {
109
+ "title": "Port",
110
+ "type": "integer",
111
+ "default": 9875,
112
+ "minimum": 1024,
113
+ "maximum": 65535
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Facade over the CCU adapters. Owns the lifecycle (connect / disconnect /
3
+ * reconnect), exposes high-level operations to the platform and services,
4
+ * and dispatches inbound events to registered listeners.
5
+ *
6
+ * XML-RPC only: one RpcClient per enabled interface (BidCos-RF → rfd,
7
+ * HmIP-RF → HMIPServer) for discovery (`listDevices`), reads and writes,
8
+ * plus the local EventServer for the CCU's push events. No JSON-RPC,
9
+ * no ReGa, no CCU login.
10
+ *
11
+ * Each interface has an InterfaceSupervisor (ping/PONG, re-subscribe
12
+ * after a CCU restart, backoff). The CcuClient feeds it every inbound
13
+ * callback and re-emits its events:
14
+ * 'interfaceState' (id, state, previous)
15
+ * 'subscribed' (id, reason) — after every successful init
16
+ *
17
+ * Exactly one CcuClient lives per HomematicPlatform instance.
18
+ */
19
+ import { EventEmitter } from 'node:events';
20
+ import { EventServer } from './EventServer.js';
21
+ import { type InterfaceState, type SupervisorTimings } from './InterfaceSupervisor.js';
22
+ import { type ParameterDescription, type RpcDeviceDescription } from './RpcClient.js';
23
+ import type { CcuDevice, CcuInterfaceId, ResolvedConfig } from '../types.js';
24
+ import type { PrefixedLogger } from '../util/logger.js';
25
+ export interface CcuClientOptions {
26
+ config: ResolvedConfig;
27
+ log: PrefixedLogger;
28
+ /** Override supervisor timings (tests). */
29
+ timings?: Partial<SupervisorTimings>;
30
+ }
31
+ type DatapointListener = (value: unknown) => void;
32
+ /** Paramset description lookup (Discovery's cache), see setDescriber(). */
33
+ export type Describer = (address: string) => Record<string, ParameterDescription> | undefined;
34
+ export interface InterfaceProbe {
35
+ interfaceId: CcuInterfaceId;
36
+ port: number;
37
+ ok: boolean;
38
+ /** Number of methods reported by `system.listMethods` (when ok). */
39
+ methods?: number;
40
+ error?: string;
41
+ }
42
+ export declare class CcuClient extends EventEmitter {
43
+ readonly eventServer: EventServer;
44
+ private readonly rpcClients;
45
+ private readonly datapointListeners;
46
+ private readonly config;
47
+ private readonly log;
48
+ private readonly supervisors;
49
+ /** callback id (`homebridge-hap-homematic:<interface>`) → supervisor */
50
+ private readonly byCallbackId;
51
+ private started;
52
+ private describer;
53
+ /** In-flight getParamset per channel, so handlers sharing a channel ask once. */
54
+ private readonly inflight;
55
+ /** address → interface map, filled by listDevices(). */
56
+ private readonly addressInterface;
57
+ constructor(opts: CcuClientOptions);
58
+ start(): Promise<void>;
59
+ stop(): Promise<void>;
60
+ /** Interfaces enabled in the config, in a fixed order. */
61
+ enabledInterfaces(): CcuInterfaceId[];
62
+ /**
63
+ * Raw XML-RPC `listDevices` per enabled interface. Failures are
64
+ * reported per interface instead of thrown, so callers can fall back
65
+ * to a cache for just that interface.
66
+ */
67
+ listRawDevices(): Promise<{
68
+ results: Map<CcuInterfaceId, RpcDeviceDescription[]>;
69
+ errors: Map<CcuInterfaceId, Error>;
70
+ }>;
71
+ /**
72
+ * All devices and their channels, via XML-RPC `listDevices` on every
73
+ * enabled interface (no cache; see Discovery for that). XML-RPC
74
+ * carries no names, so `name` is a placeholder of type and address.
75
+ * Interfaces that fail are logged and skipped; the call rejects only
76
+ * if every interface failed.
77
+ */
78
+ listDevices(): Promise<CcuDevice[]>;
79
+ /** Remember which interface each device / channel address belongs to. */
80
+ indexDevices(devices: CcuDevice[]): void;
81
+ /** Pin an address (device serial) to an interface, e.g. from devices.json. */
82
+ setInterfaceFor(address: string, intf: CcuInterfaceId): void;
83
+ /** `getParamsetDescription(address, 'VALUES')` on the channel's interface. */
84
+ getParamsetDescription(address: string): Promise<Record<string, ParameterDescription>>;
85
+ /** `system.listMethods` on every enabled interface (UI "Test connection"). */
86
+ probeInterfaces(): Promise<InterfaceProbe[]>;
87
+ /** Subscribe a callback to a `<serial>:<chan>.<datapoint>` address. */
88
+ registerListener(address: string, listener: DatapointListener): () => void;
89
+ /** True if any interface is currently CONNECTED. */
90
+ isLive(): boolean;
91
+ /** Supervisor state of one interface (undefined if not enabled). */
92
+ getInterfaceState(id: CcuInterfaceId): InterfaceState | undefined;
93
+ /** Paramset descriptions for typing (setValue) and the ACTION filter. */
94
+ setDescriber(fn: Describer): void;
95
+ /** Description of one datapoint, if the paramset cache has it. */
96
+ describe(address: string, datapoint: string): ParameterDescription | undefined;
97
+ /**
98
+ * Set a CCU datapoint via XML-RPC on the channel's interface, typed by
99
+ * the paramset description (plan 4.3): FLOAT as explicit double (the
100
+ * CCU rejects `1` as int for a FLOAT), INTEGER/ENUM rounded, BOOL and
101
+ * ACTION as boolean. Without a description the value is sent as is.
102
+ */
103
+ setValue(address: string, datapoint: string, value: unknown): Promise<void>;
104
+ /** Read a CCU datapoint via XML-RPC on the channel's interface. */
105
+ getValue(address: string, datapoint: string): Promise<unknown>;
106
+ /**
107
+ * Current values of a channel via `getParamset(VALUES)` (no radio
108
+ * traffic). Concurrent calls for the same channel share one request.
109
+ * `undefined` when the CCU answered with an error (e.g. BidCos device
110
+ * without power, plan 3.1 finding 1); `{}` for unreachable HmIP devices.
111
+ * ACTION datapoints (PRESS_*) are never returned (plan 4.2).
112
+ */
113
+ readValues(address: string): Promise<Record<string, unknown> | undefined>;
114
+ /** ACTION datapoints must never be applied as start values. */
115
+ isAction(address: string, datapoint: string): boolean;
116
+ /** Interface a channel / device address is routed to. */
117
+ interfaceOf(address: string): CcuInterfaceId;
118
+ private clientFor;
119
+ private portFor;
120
+ /** Every inbound callback is a sign of life for its interface. */
121
+ private handleActivity;
122
+ private handleEvent;
123
+ private interfaceForAddress;
124
+ private resolveCallbackHost;
125
+ }
126
+ /**
127
+ * Turn the flat `listDevices` answer (devices and channels mixed) into
128
+ * devices with their channels. Channel 0 (MAINTENANCE) is kept.
129
+ */
130
+ export declare function toDevices(raw: RpcDeviceDescription[], intf: CcuInterfaceId): CcuDevice[];
131
+ /** Shape a value for setValue by the datapoint's paramset TYPE. */
132
+ export declare function toTyped(type: string | undefined, value: unknown): unknown;
133
+ export {};