homebridge-texecom-full 4.4.1-beta.0 → 4.4.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +261 -231
- package/config.schema.json +254 -218
- package/index.js +90 -2
- package/package.json +1 -1
- package/util/logutil.js +33 -33
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This change log documents all release versions of homebridge-texecom
|
|
4
4
|
|
|
5
|
+
### 4.4.1-beta.2 (2026-11-08)
|
|
6
|
+
|
|
7
|
+
- **FEATURE** - `zone_alarm` raises the alarm in HomeKit as soon as a zone under an armed area goes active, even during the entry delay, as releases before 4.4.1 did. For panels that do not report their own alarm, which since 4.4.1-beta.0 meant an alarm during the entry delay never reached HomeKit. Off by default.
|
|
8
|
+
|
|
9
|
+
### 4.4.1-beta.1 (2026-10-22)
|
|
10
|
+
|
|
11
|
+
- **FEATURE** - `target_states` chooses which arm modes the Home app offers, e.g. `["away", "off"]` for a household that only arms fully, which also lets "Hey Siri, turn on the alarm" go straight to Away (#30). Set it for every area, or on an area or combined area for that one alone. Off is always offered. An arm in a mode that is not offered, at the keypad say, shows as Away, or as the armed mode that is offered.
|
|
12
|
+
|
|
5
13
|
### 4.4.1-beta.0 (2026-10-22)
|
|
6
14
|
|
|
7
15
|
- **FIX** - Panel messages were lost over IP when more than one arrived together. Each read from the network was taken as a single message, so anything after the first was dropped, and a lost keypad disarm left HomeKit thinking the area was armed and raising false alarms. The network connection is now split into lines, as the serial connection already was.
|
package/README.md
CHANGED
|
@@ -1,232 +1,262 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/homebridge-texecom-full)
|
|
2
|
-
[](https://www.npmjs.com/package/homebridge-texecom-full)
|
|
3
|
-
[](https://www.npmjs.com/package/homebridge-texecom-full)
|
|
4
|
-
[](https://github.com/K1LL3R234/homebridge-texecom)
|
|
5
|
-
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
6
|
-
# homebridge-texecom-full
|
|
7
|
-
|
|
8
|
-
A plugin for [Homebridge](https://github.com/nfarina/homebridge) that creates HomeKit motion, contact, smoke, or carbon monoxide sensors for alarm zones from a Texecom Premier intruder alarm via a serial connection or COM-IP module.
|
|
9
|
-
|
|
10
|
-
You can receive notifications, which can be set to work only when you're away from home:
|
|
11
|
-
|
|
12
|
-

|
|
13
|
-
|
|
14
|
-
Another great use is to use the alarm's motion sensors to switch lights on automatically:
|
|
15
|
-
|
|
16
|
-

|
|
17
|
-
|
|
18
|
-
You can also set automations to happen when you arm the alarm and when the alarm goes off.
|
|
19
|
-
|
|
20
|
-
**IMPORTANT** - To use this plugin you will require a Texecom alarm system and a PC-COM, COM-IP or USB-COM serial interface. If using the PC-COM or USB-COM, you must also have nothing already utilising COM1 on the alarm panel, or be able to move existing modules connected to COM1 to a different COM port on the alarm panel. The support for IP is new and is intended for use with the COM-IP -- we don't know if it works with the SmartCom, so let us know if you get it working.
|
|
21
|
-
|
|
22
|
-
## Configuration
|
|
23
|
-
|
|
24
|
-
Texecom zones must be configured individually in the Homebridge config.json file with the appropriate zone number from Texecom. Configuring areas is optional, but is required if you want to see if the alarm if set or have automations or notifications when the alarm is armed, disarmed or triggered. You probably have many zones and only one area.
|
|
25
|
-
|
|
26
|
-
Example:
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
"platforms": [
|
|
30
|
-
{
|
|
31
|
-
"platform": "Texecom",
|
|
32
|
-
"serial_device": "/dev/ttyUSB0",
|
|
33
|
-
"baud_rate": 19200,
|
|
34
|
-
"udl": "1234",
|
|
35
|
-
"zones": [
|
|
36
|
-
{
|
|
37
|
-
"name": "Living Room",
|
|
38
|
-
"zone_number": "7",
|
|
39
|
-
"zone_type": "motion",
|
|
40
|
-
"dwell": 1000
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"name": "Front Door",
|
|
44
|
-
"zone_number": "15",
|
|
45
|
-
"zone_type": "contact",
|
|
46
|
-
"dwell": 1000
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "Back Yard",
|
|
50
|
-
"zone_number": "19",
|
|
51
|
-
"zone_type": "motion",
|
|
52
|
-
"dwell": 1000
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"areas": [
|
|
56
|
-
{
|
|
57
|
-
"name": "Inside",
|
|
58
|
-
"area_number": "1",
|
|
59
|
-
"area_type": "securitysystem",
|
|
60
|
-
"dwell": 0,
|
|
61
|
-
"zones":[7,15]
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "Outside",
|
|
65
|
-
"area_number": "2",
|
|
66
|
-
"area_type": "securitysystem",
|
|
67
|
-
"dwell": 0,
|
|
68
|
-
"zones":[19]
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Global Configuration
|
|
77
|
-
|
|
78
|
-
For serial connections:
|
|
79
|
-
|
|
80
|
-
| Key | Default | Description |
|
|
81
|
-
| --- | --- | --- |
|
|
82
|
-
| `serial_device` | N/A | The serial device on which to connect to Texecom |
|
|
83
|
-
| `baud_rate` | N/A | The baud rate configured in Texecom (Usually 19200) |
|
|
84
|
-
| `zones` | N/A | The individual configuration for each zone in Texecom |
|
|
85
|
-
|
|
86
|
-
For IP connections:
|
|
87
|
-
|
|
88
|
-
| Key | Default | Description |
|
|
89
|
-
| --- | --- | --- |
|
|
90
|
-
| `ip_address` | N/A | The IP address of the COM-IP Texecom module |
|
|
91
|
-
| `ip_port` | 10001 | The TCP port of the COM-IP Texecom module |
|
|
92
|
-
|
|
93
|
-
For UDL
|
|
94
|
-
|
|
95
|
-
| Key | Default | Description |
|
|
96
|
-
| --- | --- | --- |
|
|
97
|
-
| `udl` | N/A | The UDL code on the panel to be able to arm and disarm alarm, e.g. `"1234"`. Give it in quotes if it starts with a 0. |
|
|
98
|
-
|
|
99
|
-
For arm state reporting
|
|
100
|
-
|
|
101
|
-
When an area is armed the panel reports the area and the user number, but not whether it was a full arm or a part arm. These settings say how to read that.
|
|
102
|
-
|
|
103
|
-
| Key | Default | Description |
|
|
104
|
-
| --- | --- | --- |
|
|
105
|
-
| `remote_users` | `[]` | User numbers that arm using a remote or keyfob, e.g. `[17]`. An arm by one of these users is always reported to HomeKit as Away. |
|
|
106
|
-
| `app_users` | `[]` | User numbers the panel reports when an area is armed from this plugin, e.g. `[25, 254]`. |
|
|
107
|
-
| `default_arm_state` | `"away"` | What to report for an arm by any other user, at a keypad for example. One of `away`, `night` or `stay`. |
|
|
108
|
-
|
|
109
|
-
When the arm was started from HomeKit the plugin already knows what was asked for and reports that, whatever the user number. These settings only come into play for an arm that started somewhere else.
|
|
110
|
-
|
|
111
|
-
###
|
|
112
|
-
|
|
113
|
-
The
|
|
114
|
-
|
|
115
|
-
| Key | Default | Description |
|
|
116
|
-
| --- | --- | --- |
|
|
117
|
-
| `
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
1
|
+
[](https://www.npmjs.com/package/homebridge-texecom-full)
|
|
2
|
+
[](https://www.npmjs.com/package/homebridge-texecom-full)
|
|
3
|
+
[](https://www.npmjs.com/package/homebridge-texecom-full)
|
|
4
|
+
[](https://github.com/K1LL3R234/homebridge-texecom)
|
|
5
|
+
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
6
|
+
# homebridge-texecom-full
|
|
7
|
+
|
|
8
|
+
A plugin for [Homebridge](https://github.com/nfarina/homebridge) that creates HomeKit motion, contact, smoke, or carbon monoxide sensors for alarm zones from a Texecom Premier intruder alarm via a serial connection or COM-IP module.
|
|
9
|
+
|
|
10
|
+
You can receive notifications, which can be set to work only when you're away from home:
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
Another great use is to use the alarm's motion sensors to switch lights on automatically:
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
You can also set automations to happen when you arm the alarm and when the alarm goes off.
|
|
19
|
+
|
|
20
|
+
**IMPORTANT** - To use this plugin you will require a Texecom alarm system and a PC-COM, COM-IP or USB-COM serial interface. If using the PC-COM or USB-COM, you must also have nothing already utilising COM1 on the alarm panel, or be able to move existing modules connected to COM1 to a different COM port on the alarm panel. The support for IP is new and is intended for use with the COM-IP -- we don't know if it works with the SmartCom, so let us know if you get it working.
|
|
21
|
+
|
|
22
|
+
## Configuration
|
|
23
|
+
|
|
24
|
+
Texecom zones must be configured individually in the Homebridge config.json file with the appropriate zone number from Texecom. Configuring areas is optional, but is required if you want to see if the alarm if set or have automations or notifications when the alarm is armed, disarmed or triggered. You probably have many zones and only one area.
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
"platforms": [
|
|
30
|
+
{
|
|
31
|
+
"platform": "Texecom",
|
|
32
|
+
"serial_device": "/dev/ttyUSB0",
|
|
33
|
+
"baud_rate": 19200,
|
|
34
|
+
"udl": "1234",
|
|
35
|
+
"zones": [
|
|
36
|
+
{
|
|
37
|
+
"name": "Living Room",
|
|
38
|
+
"zone_number": "7",
|
|
39
|
+
"zone_type": "motion",
|
|
40
|
+
"dwell": 1000
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Front Door",
|
|
44
|
+
"zone_number": "15",
|
|
45
|
+
"zone_type": "contact",
|
|
46
|
+
"dwell": 1000
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "Back Yard",
|
|
50
|
+
"zone_number": "19",
|
|
51
|
+
"zone_type": "motion",
|
|
52
|
+
"dwell": 1000
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"areas": [
|
|
56
|
+
{
|
|
57
|
+
"name": "Inside",
|
|
58
|
+
"area_number": "1",
|
|
59
|
+
"area_type": "securitysystem",
|
|
60
|
+
"dwell": 0,
|
|
61
|
+
"zones":[7,15]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "Outside",
|
|
65
|
+
"area_number": "2",
|
|
66
|
+
"area_type": "securitysystem",
|
|
67
|
+
"dwell": 0,
|
|
68
|
+
"zones":[19]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Global Configuration
|
|
77
|
+
|
|
78
|
+
For serial connections:
|
|
79
|
+
|
|
80
|
+
| Key | Default | Description |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| `serial_device` | N/A | The serial device on which to connect to Texecom |
|
|
83
|
+
| `baud_rate` | N/A | The baud rate configured in Texecom (Usually 19200) |
|
|
84
|
+
| `zones` | N/A | The individual configuration for each zone in Texecom |
|
|
85
|
+
|
|
86
|
+
For IP connections:
|
|
87
|
+
|
|
88
|
+
| Key | Default | Description |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| `ip_address` | N/A | The IP address of the COM-IP Texecom module |
|
|
91
|
+
| `ip_port` | 10001 | The TCP port of the COM-IP Texecom module |
|
|
92
|
+
|
|
93
|
+
For UDL
|
|
94
|
+
|
|
95
|
+
| Key | Default | Description |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `udl` | N/A | The UDL code on the panel to be able to arm and disarm alarm, e.g. `"1234"`. Give it in quotes if it starts with a 0. |
|
|
98
|
+
|
|
99
|
+
For arm state reporting
|
|
100
|
+
|
|
101
|
+
When an area is armed the panel reports the area and the user number, but not whether it was a full arm or a part arm. These settings say how to read that.
|
|
102
|
+
|
|
103
|
+
| Key | Default | Description |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| `remote_users` | `[]` | User numbers that arm using a remote or keyfob, e.g. `[17]`. An arm by one of these users is always reported to HomeKit as Away. |
|
|
106
|
+
| `app_users` | `[]` | User numbers the panel reports when an area is armed from this plugin, e.g. `[25, 254]`. |
|
|
107
|
+
| `default_arm_state` | `"away"` | What to report for an arm by any other user, at a keypad for example. One of `away`, `night` or `stay`. |
|
|
108
|
+
|
|
109
|
+
When the arm was started from HomeKit the plugin already knows what was asked for and reports that, whatever the user number. These settings only come into play for an arm that started somewhere else.
|
|
110
|
+
|
|
111
|
+
### Home App Arm Modes
|
|
112
|
+
|
|
113
|
+
The Home app offers Home, Away, Night and Off for every area. A household that only ever arms fully can offer just Away and Off, which also lets "Hey Siri, turn on the alarm" go straight to Away.
|
|
114
|
+
|
|
115
|
+
| Key | Default | Description |
|
|
116
|
+
| --- | --- | --- |
|
|
117
|
+
| `target_states` | All of them | The modes to offer, from `away`, `home`, `night` and `off`. Off is always offered. Set it at the top level for every area, or on an area or combined area for that one alone. |
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
"target_states": ["away", "off"]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Night and Home both send the panel a part arm, so offering only the modes your panel is set up for avoids arming in a way you did not mean. An area armed in a mode that is not offered, at the keypad say, shows in the Home app as Away, or as the armed mode that is offered if Away is not.
|
|
124
|
+
|
|
125
|
+
If the Home app still shows the old buttons after a change, close and reopen it. Some versions of iOS hold on to them for an accessory they already know.
|
|
126
|
+
|
|
127
|
+
### Zone Alarms
|
|
128
|
+
|
|
129
|
+
A zone listed under an armed area's `zones` raises the alarm in HomeKit when it goes active. During the panel's entry delay, walking in to disarm, it is left to the panel, which reports a real alarm itself once the delay runs out. Some panels never send that report, so the alarm never reaches HomeKit.
|
|
130
|
+
|
|
131
|
+
| Key | Default | Description |
|
|
132
|
+
| --- | --- | --- |
|
|
133
|
+
| `zone_alarm` | `false` | Raise the alarm as soon as a zone under an armed area goes active, entry delay or not, as releases before 4.4.1 did. |
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
"zone_alarm": true
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The trade-off is an alarm in HomeKit every time you walk in through the entry route before disarming. Only the zones listed under the area count.
|
|
140
|
+
|
|
141
|
+
### Panel Clock
|
|
142
|
+
|
|
143
|
+
The panel keeps its own clock, and nothing corrects it once it drifts apart from an engineer at the keypad. This checks it against the clock on the machine running Homebridge and sets it when the two have come apart.
|
|
144
|
+
|
|
145
|
+
| Key | Default | Description |
|
|
146
|
+
| --- | --- | --- |
|
|
147
|
+
| `time_sync_interval` | 0 | How often to check the panel clock, in hours. `1` checks every hour, `24` once a day, `744` once every 31 days, and anything in between works. `0` turns it off and leaves the panel clock alone. |
|
|
148
|
+
| `time_zone` | This machine's | The time zone the panel keeps its clock in, e.g. `Europe/London`. Only needed when the machine running Homebridge is not set to the panel's time zone, which is usual in Docker. |
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
"time_sync_interval": 24
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
It is off unless you set it. A UDL is needed, the same one arming uses, because the panel asks to be logged into before it will give up its clock or take a new time.
|
|
155
|
+
|
|
156
|
+
The panel is checked shortly after Homebridge connects to it as well as on the interval, so a panel that lost its clock in a power cut is put right without waiting for the next check. A difference of a minute is left alone: the panel only counts whole minutes, so a check landing either side of a minute boundary can look a minute out when it is really in step. Anything beyond that is set. The panel carries a two digit year, so it is read as being in this century.
|
|
157
|
+
|
|
158
|
+
Homebridge in Docker runs on UTC unless `TZ` is set, while the panel keeps local time. Set `time_zone` in that case. Without it, a panel that looks a whole number of hours out from a machine on UTC is left alone with a warning, rather than being set an hour wrong every summer.
|
|
159
|
+
|
|
160
|
+
Once a day is plenty for a panel that keeps reasonable time. Checking every hour is there for a panel that drifts badly, and costs two short commands each time.
|
|
161
|
+
|
|
162
|
+
### Upgrading from 4.3.0
|
|
163
|
+
|
|
164
|
+
**Only relevant if you ran 4.3.0.** Skip this if you came from 4.2.8 or earlier, or are installing fresh.
|
|
165
|
+
|
|
166
|
+
4.3.0 published every zone and area as a standalone accessory that had to be added to the Home app by hand. From 4.3.1 they are bridged again, which is how it worked up to 4.2.8 and means they appear on their own.
|
|
167
|
+
|
|
168
|
+
The catch is that HomeKit treats a standalone accessory and a bridged one as different accessories, so any scene, button or automation built on the ones 4.3.0 published stops working when they move back onto the bridge. Nothing the plugin does can carry that across.
|
|
169
|
+
|
|
170
|
+
If you set all that up under 4.3.0 and would rather keep it:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
"external_accessories": true
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
That republishes them exactly as 4.3.0 did, with the same identities, so everything keeps working untouched. The trade-off is that they stay outside the bridge, so a zone added later still has to be paired by hand.
|
|
177
|
+
|
|
178
|
+
Leaving it off, or leaving it out entirely, gives bridged accessories.
|
|
179
|
+
### Combined Areas
|
|
180
|
+
|
|
181
|
+
A combined area is a single accessory that arms or disarms several areas at once. The panel addresses areas as a bitmask, so all of them are armed with one command rather than several in a row.
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
"area_groups": [
|
|
185
|
+
{
|
|
186
|
+
"name": "Everything",
|
|
187
|
+
"areas": [1, 2, 3, 4, 5],
|
|
188
|
+
"dwell": 0
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "House and Garage",
|
|
192
|
+
"areas": [1, 2],
|
|
193
|
+
"dwell": 0
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
| Key | Default | Description |
|
|
199
|
+
| --- | --- | --- |
|
|
200
|
+
| `name` | N/A | The name of the combined area as it will appear in HomeKit |
|
|
201
|
+
| `areas` | N/A | The area numbers to arm and disarm together. The panel supports areas 1 to 8 |
|
|
202
|
+
| `dwell` | 0 | The amount of time in ms before a cleared state is applied |
|
|
203
|
+
|
|
204
|
+
The areas can also still be listed under `areas` and keep their own accessories, and an area may belong to more than one combined area.
|
|
205
|
+
|
|
206
|
+
A combined area shows as armed only once every one of its areas is armed, so it never reports the house as set while part of it is still open. Until they are all armed HomeKit shows it arming. An alarm in any one of its areas shows through immediately.
|
|
207
|
+
|
|
208
|
+
### Per-zone Configuration
|
|
209
|
+
|
|
210
|
+
This plugin is a platform plugin so you must configure each zone from your Texecom intruder alarm into your config individually.
|
|
211
|
+
|
|
212
|
+
| Key | Default | Description |
|
|
213
|
+
| --- | --- | --- |
|
|
214
|
+
| `name` | N/A | The name of the area as it will appear in HomeKit, e.g. 'Texecom Alarm'. |
|
|
215
|
+
| `zone_number` | N/A | The zone number from Texecom |
|
|
216
|
+
| `zone_type` | `"motion"` | The type of zone; motion, contact, smoke, or carbonmonoxide |
|
|
217
|
+
| `dwell` | 0 | The amount of time in ms that a zone stays active after zone activation is cleared by Texecom |
|
|
218
|
+
|
|
219
|
+
### Per-area Configuration
|
|
220
|
+
|
|
221
|
+
| Key | Default | Description |
|
|
222
|
+
| --- | --- | --- |
|
|
223
|
+
| `name` | N/A | The name of the sensor as it will appear in HomeKit. |
|
|
224
|
+
| `area_number` | N/A | The area number from Texecom, usually 1. |
|
|
225
|
+
| `area_type` | `"securitysystem"` | The type of area; only securitysystem is supported, and an area is always one. |
|
|
226
|
+
| `dwell` | 0 | |
|
|
227
|
+
| `zones` | N/A | Add all the zone numbers to the area to be able to trigger alarm and the corresponding area |
|
|
228
|
+
|
|
229
|
+
## Configuring Texecom
|
|
230
|
+
|
|
231
|
+
Ensure your intruder alarm is fully configured and operational, connect a USB-Com or PC-Com cable to COM1 on the panel PCB and then connect to the computer running Homebridge.
|
|
232
|
+
|
|
233
|
+
To configure your COM1 port for the Crestron protocol:
|
|
234
|
+
|
|
235
|
+
1. Enter your engineer code
|
|
236
|
+
2. Scroll until you find "UDL/Digi Options"
|
|
237
|
+
3. Press 8 to jump to "Com Port Setup"
|
|
238
|
+
4. Scroll to "Com Port 1"
|
|
239
|
+
5. Press "No" to edit the port
|
|
240
|
+
6. Press 8 to jump to "Crestron System"
|
|
241
|
+
7. Press "Yes" to confirm and save.
|
|
242
|
+
8. Scroll until you find UDL.
|
|
243
|
+
9. Press "Yes" to go into it.
|
|
244
|
+
10. Press "No" to edit and change it to disired UDL code.
|
|
245
|
+
11. Press "Yes" to confirm and save.
|
|
246
|
+
|
|
247
|
+
Press "Menu" repeatedly to exit the engineer menu.
|
|
248
|
+
|
|
249
|
+
**Make sure you program your UDL code in the panel too.**
|
|
250
|
+
|
|
251
|
+
If connecting to a COM-IP, set up the COM-IP as usual and ensure it is working. Then change the configuration for the port the COM-IP is connected to to Crestron as detailed above. This allows the panel to configure the IP address into the module, then changing to Crestron will allow the panel to input/output the correct commands.
|
|
252
|
+
|
|
253
|
+
## Future features
|
|
254
|
+
|
|
255
|
+
Alarm systems are complicated and have a lot of features, not all them are suitable for integrating to HomeKit but many of them can be integrated.
|
|
256
|
+
|
|
257
|
+
* **Panic buttons** - Investigate the possibility of integrating the medical, panic, and fire buttons into HomeKit as buttons/switches to manually trigger those alerts.
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
## Config Schema
|
|
261
|
+
|
|
232
262
|
If someone can make the config.schema.json interface pretty and improve on it it will be appreciated.
|
package/config.schema.json
CHANGED
|
@@ -1,219 +1,255 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Texecom",
|
|
3
|
-
"pluginAlias": "Texecom",
|
|
4
|
-
"pluginType": "platform",
|
|
5
|
-
"headerDisplay": "Homebridge plugin for Texecom Premier Elite alarm panels.",
|
|
6
|
-
"singular": true,
|
|
7
|
-
"schema": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"properties": {
|
|
10
|
-
"name": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"title": "Name",
|
|
13
|
-
"required": true,
|
|
14
|
-
"default": "Texecom",
|
|
15
|
-
"description": "You shouldn't need to change this."
|
|
16
|
-
},
|
|
17
|
-
"ip_address": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"format": "ipv4",
|
|
20
|
-
"title": "IP Address"
|
|
21
|
-
},
|
|
22
|
-
"ip_port": {
|
|
23
|
-
"type": "integer",
|
|
24
|
-
"default": 10001,
|
|
25
|
-
"title": "IP Port"
|
|
26
|
-
},
|
|
27
|
-
"serial_device": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"example": "/dev/ttyUSB0",
|
|
30
|
-
"title": "Serial Device"
|
|
31
|
-
},
|
|
32
|
-
"baud_rate": {
|
|
33
|
-
"type": "integer",
|
|
34
|
-
"enum": [
|
|
35
|
-
9600,
|
|
36
|
-
19200,
|
|
37
|
-
38400,
|
|
38
|
-
57600,
|
|
39
|
-
115200
|
|
40
|
-
],
|
|
41
|
-
"title": "Baud Rate"
|
|
42
|
-
},
|
|
43
|
-
"udl": {
|
|
44
|
-
"type": "string",
|
|
45
|
-
"pattern": "^[0-9]{4,8}$",
|
|
46
|
-
"title": "UDL",
|
|
47
|
-
"description": "The UDL code on the panel. Needed to arm and disarm from HomeKit, and for the panel clock sync."
|
|
48
|
-
},
|
|
49
|
-
"time_sync_interval": {
|
|
50
|
-
"type": "integer",
|
|
51
|
-
"default": 0,
|
|
52
|
-
"minimum": 0,
|
|
53
|
-
"title": "Panel Clock Sync (hours)",
|
|
54
|
-
"description": "How often to check the panel clock against the clock on this machine, in hours, and set it if it has drifted. 1 checks every hour, 24 once a day, 744 once every 31 days. 0 turns it off and leaves the panel clock alone. Needs a UDL."
|
|
55
|
-
},
|
|
56
|
-
"time_zone": {
|
|
57
|
-
"type": "string",
|
|
58
|
-
"title": "Panel Time Zone",
|
|
59
|
-
"placeholder": "Europe/London",
|
|
60
|
-
"description": "The time zone the panel keeps its clock in. Only needed when the machine running Homebridge is set to a different one, which is usual in Docker. Leave empty to use this machine's."
|
|
61
|
-
},
|
|
62
|
-
"remote_users": {
|
|
63
|
-
"type": "array",
|
|
64
|
-
"title": "Remote / Keyfob Users",
|
|
65
|
-
"description": "Panel user numbers that arm using a remote or keyfob. An arm by one of these users is always shown as Away in HomeKit.",
|
|
66
|
-
"items": {
|
|
67
|
-
"type": "integer",
|
|
68
|
-
"title": "User Number"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"app_users": {
|
|
72
|
-
"type": "array",
|
|
73
|
-
"title": "App Users",
|
|
74
|
-
"description": "Panel user numbers the panel reports when an area is armed from this plugin. An arm by one of these users is shown as whatever was asked for in HomeKit.",
|
|
75
|
-
"items": {
|
|
76
|
-
"type": "integer",
|
|
77
|
-
"title": "User Number"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"default_arm_state": {
|
|
81
|
-
"type": "string",
|
|
82
|
-
"title": "Default Arm State",
|
|
83
|
-
"default": "away",
|
|
84
|
-
"description": "What to show in HomeKit when an area is armed by any other user, at a keypad for example. The panel does not report whether an arm was full or part, so this is a best guess.",
|
|
85
|
-
"enum": [
|
|
86
|
-
"away",
|
|
87
|
-
"night",
|
|
88
|
-
"stay"
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
"
|
|
92
|
-
"type": "array",
|
|
93
|
-
"title": "
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
"title": "
|
|
154
|
-
},
|
|
155
|
-
"
|
|
156
|
-
"type": "
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
1
|
+
{
|
|
2
|
+
"title": "Texecom",
|
|
3
|
+
"pluginAlias": "Texecom",
|
|
4
|
+
"pluginType": "platform",
|
|
5
|
+
"headerDisplay": "Homebridge plugin for Texecom Premier Elite alarm panels.",
|
|
6
|
+
"singular": true,
|
|
7
|
+
"schema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"title": "Name",
|
|
13
|
+
"required": true,
|
|
14
|
+
"default": "Texecom",
|
|
15
|
+
"description": "You shouldn't need to change this."
|
|
16
|
+
},
|
|
17
|
+
"ip_address": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "ipv4",
|
|
20
|
+
"title": "IP Address"
|
|
21
|
+
},
|
|
22
|
+
"ip_port": {
|
|
23
|
+
"type": "integer",
|
|
24
|
+
"default": 10001,
|
|
25
|
+
"title": "IP Port"
|
|
26
|
+
},
|
|
27
|
+
"serial_device": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"example": "/dev/ttyUSB0",
|
|
30
|
+
"title": "Serial Device"
|
|
31
|
+
},
|
|
32
|
+
"baud_rate": {
|
|
33
|
+
"type": "integer",
|
|
34
|
+
"enum": [
|
|
35
|
+
9600,
|
|
36
|
+
19200,
|
|
37
|
+
38400,
|
|
38
|
+
57600,
|
|
39
|
+
115200
|
|
40
|
+
],
|
|
41
|
+
"title": "Baud Rate"
|
|
42
|
+
},
|
|
43
|
+
"udl": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"pattern": "^[0-9]{4,8}$",
|
|
46
|
+
"title": "UDL",
|
|
47
|
+
"description": "The UDL code on the panel. Needed to arm and disarm from HomeKit, and for the panel clock sync."
|
|
48
|
+
},
|
|
49
|
+
"time_sync_interval": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"default": 0,
|
|
52
|
+
"minimum": 0,
|
|
53
|
+
"title": "Panel Clock Sync (hours)",
|
|
54
|
+
"description": "How often to check the panel clock against the clock on this machine, in hours, and set it if it has drifted. 1 checks every hour, 24 once a day, 744 once every 31 days. 0 turns it off and leaves the panel clock alone. Needs a UDL."
|
|
55
|
+
},
|
|
56
|
+
"time_zone": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"title": "Panel Time Zone",
|
|
59
|
+
"placeholder": "Europe/London",
|
|
60
|
+
"description": "The time zone the panel keeps its clock in. Only needed when the machine running Homebridge is set to a different one, which is usual in Docker. Leave empty to use this machine's."
|
|
61
|
+
},
|
|
62
|
+
"remote_users": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"title": "Remote / Keyfob Users",
|
|
65
|
+
"description": "Panel user numbers that arm using a remote or keyfob. An arm by one of these users is always shown as Away in HomeKit.",
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "integer",
|
|
68
|
+
"title": "User Number"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"app_users": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"title": "App Users",
|
|
74
|
+
"description": "Panel user numbers the panel reports when an area is armed from this plugin. An arm by one of these users is shown as whatever was asked for in HomeKit.",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "integer",
|
|
77
|
+
"title": "User Number"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"default_arm_state": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"title": "Default Arm State",
|
|
83
|
+
"default": "away",
|
|
84
|
+
"description": "What to show in HomeKit when an area is armed by any other user, at a keypad for example. The panel does not report whether an arm was full or part, so this is a best guess.",
|
|
85
|
+
"enum": [
|
|
86
|
+
"away",
|
|
87
|
+
"night",
|
|
88
|
+
"stay"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"target_states": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"title": "Home App Arm Modes",
|
|
94
|
+
"description": "The modes offered in the Home app for every area, e.g. away and off for a house that only ever uses a full arm. Off is always offered. Leave empty to offer them all.",
|
|
95
|
+
"uniqueItems": true,
|
|
96
|
+
"items": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"enum": ["away", "home", "night", "off"]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"zone_alarm": {
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"title": "Alarm When A Zone Triggers",
|
|
104
|
+
"default": false,
|
|
105
|
+
"description": "Raise the alarm in HomeKit as soon as a zone listed under an armed area goes active, even during the entry delay, as releases before 4.4.1 did. Turn this on if your panel does not report its own alarms. Expect an alarm notification when you walk in to disarm."
|
|
106
|
+
},
|
|
107
|
+
"zones": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"title": "Zones",
|
|
110
|
+
"items": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"properties": {
|
|
113
|
+
"name": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"title": "Zone Name"
|
|
116
|
+
},
|
|
117
|
+
"zone_number": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"title": "Zone Number"
|
|
120
|
+
},
|
|
121
|
+
"zone_type": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"enum": [
|
|
124
|
+
"contact",
|
|
125
|
+
"motion",
|
|
126
|
+
"smoke",
|
|
127
|
+
"carbonmonoxide"
|
|
128
|
+
],
|
|
129
|
+
"title": "Zone Type"
|
|
130
|
+
},
|
|
131
|
+
"dwell": {
|
|
132
|
+
"type": "integer",
|
|
133
|
+
"minimum": 0,
|
|
134
|
+
"title": "Dwell Time"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"required": [
|
|
138
|
+
"name",
|
|
139
|
+
"zone_number",
|
|
140
|
+
"zone_type",
|
|
141
|
+
"dwell"
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"areas": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"title": "Areas",
|
|
148
|
+
"items": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"name": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"title": "Area Name"
|
|
154
|
+
},
|
|
155
|
+
"area_number": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"title": "Area Number"
|
|
158
|
+
},
|
|
159
|
+
"area_type": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"enum": [
|
|
162
|
+
"securitysystem"
|
|
163
|
+
],
|
|
164
|
+
"title": "Area Type"
|
|
165
|
+
},
|
|
166
|
+
"dwell": {
|
|
167
|
+
"type": "integer",
|
|
168
|
+
"minimum": 0,
|
|
169
|
+
"title": "Dwell Time"
|
|
170
|
+
},
|
|
171
|
+
"zones": {
|
|
172
|
+
"type": "array",
|
|
173
|
+
"items": {
|
|
174
|
+
"type": "integer"
|
|
175
|
+
},
|
|
176
|
+
"title": "Zones under Area"
|
|
177
|
+
},
|
|
178
|
+
"target_states": {
|
|
179
|
+
"type": "array",
|
|
180
|
+
"title": "Home App Arm Modes",
|
|
181
|
+
"description": "The modes offered in the Home app for this one, if different from the setting above. Off is always offered.",
|
|
182
|
+
"uniqueItems": true,
|
|
183
|
+
"items": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"enum": ["away", "home", "night", "off"]
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"required": [
|
|
190
|
+
"name",
|
|
191
|
+
"area_number",
|
|
192
|
+
"area_type",
|
|
193
|
+
"dwell"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"external_accessories": {
|
|
198
|
+
"type": "boolean",
|
|
199
|
+
"title": "Keep 4.3.0 External Accessories",
|
|
200
|
+
"default": false,
|
|
201
|
+
"description": "Only for installs that ran 4.3.0. That release published every zone and area outside the bridge, so they had to be added to the Home app by hand. Turn this on to keep publishing them that way, with the same identities, so the scenes, buttons and automations built on them keep working. Leave it off otherwise."
|
|
202
|
+
},
|
|
203
|
+
"area_groups": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"title": "Combined Areas",
|
|
206
|
+
"description": "One accessory that arms or disarms several areas together. The panel takes them all in a single command.",
|
|
207
|
+
"items": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"properties": {
|
|
210
|
+
"name": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"title": "Name"
|
|
213
|
+
},
|
|
214
|
+
"areas": {
|
|
215
|
+
"type": "array",
|
|
216
|
+
"title": "Areas",
|
|
217
|
+
"description": "The area numbers to arm and disarm together, for example 1 and 2.",
|
|
218
|
+
"items": {
|
|
219
|
+
"type": "integer",
|
|
220
|
+
"minimum": 1,
|
|
221
|
+
"maximum": 8,
|
|
222
|
+
"title": "Area Number"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"dwell": {
|
|
226
|
+
"type": "integer",
|
|
227
|
+
"minimum": 0,
|
|
228
|
+
"title": "Dwell Time"
|
|
229
|
+
},
|
|
230
|
+
"target_states": {
|
|
231
|
+
"type": "array",
|
|
232
|
+
"title": "Home App Arm Modes",
|
|
233
|
+
"description": "The modes offered in the Home app for this one, if different from the setting above. Off is always offered.",
|
|
234
|
+
"uniqueItems": true,
|
|
235
|
+
"items": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"enum": ["away", "home", "night", "off"]
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"required": [
|
|
242
|
+
"name",
|
|
243
|
+
"areas"
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"debug":{
|
|
248
|
+
"type":"boolean",
|
|
249
|
+
"title":"Debug",
|
|
250
|
+
"default":false
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"required": true
|
|
254
|
+
}
|
|
219
255
|
}
|
package/index.js
CHANGED
|
@@ -70,6 +70,16 @@ class TexecomPlatform {
|
|
|
70
70
|
this.app_users = parseUserList(config["app_users"]);
|
|
71
71
|
this.default_arm_state = String(config["default_arm_state"] || "away").toLowerCase();
|
|
72
72
|
|
|
73
|
+
// The arm modes offered in the Home app, for every area that does not
|
|
74
|
+
// set its own. Unset offers them all.
|
|
75
|
+
this.target_states = config["target_states"];
|
|
76
|
+
|
|
77
|
+
// Zones going active during the entry delay are normally left to the
|
|
78
|
+
// panel, which reports a real alarm itself. Not every panel does, so
|
|
79
|
+
// this raises the alarm in HomeKit as soon as a zone under an armed
|
|
80
|
+
// area goes active, entry delay or not, as releases before 4.4.1 did.
|
|
81
|
+
this.zone_alarm = config["zone_alarm"] === true;
|
|
82
|
+
|
|
73
83
|
// How often to check the panel clock against this machine's, in hours.
|
|
74
84
|
// 0 leaves the panel clock alone.
|
|
75
85
|
this.time_sync_interval = parseSyncInterval(config["time_sync_interval"]);
|
|
@@ -326,7 +336,7 @@ class TexecomPlatform {
|
|
|
326
336
|
if (!areaAccessories[a].zones.includes(pad(updated_zone, 3)) || !is_armed(area_number)) {
|
|
327
337
|
continue;
|
|
328
338
|
}
|
|
329
|
-
if (areas_in_entry.has(Number(area_number))) {
|
|
339
|
+
if (!platform.zone_alarm && areas_in_entry.has(Number(area_number))) {
|
|
330
340
|
platform.log.debug(`Zone ${updated_zone} active during the entry delay for area ${area_number}, leaving it to the panel`);
|
|
331
341
|
continue;
|
|
332
342
|
}
|
|
@@ -722,6 +732,54 @@ function currentToTargetState(Characteristic, currentState) {
|
|
|
722
732
|
}
|
|
723
733
|
}
|
|
724
734
|
|
|
735
|
+
// The arm modes to offer in the Home app, as SecuritySystemTargetState values,
|
|
736
|
+
// from names such as ["away", "off"]. Off is always offered. Unset, or nothing
|
|
737
|
+
// usable, offers every mode.
|
|
738
|
+
const TARGET_STATE_NAMES = {
|
|
739
|
+
away: "AWAY_ARM",
|
|
740
|
+
home: "STAY_ARM",
|
|
741
|
+
stay: "STAY_ARM",
|
|
742
|
+
night: "NIGHT_ARM",
|
|
743
|
+
off: "DISARM",
|
|
744
|
+
disarm: "DISARM"
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
function parseTargetStates(Characteristic, value, log, name) {
|
|
748
|
+
const Target = Characteristic.SecuritySystemTargetState;
|
|
749
|
+
const all = [Target.STAY_ARM, Target.AWAY_ARM, Target.NIGHT_ARM, Target.DISARM];
|
|
750
|
+
|
|
751
|
+
if (value === null || value === undefined || value === "") {
|
|
752
|
+
return all;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
const names = Array.isArray(value) ? value : String(value).split(",");
|
|
756
|
+
const offered = new Set([Target.DISARM]);
|
|
757
|
+
names.forEach(n => {
|
|
758
|
+
const key = TARGET_STATE_NAMES[String(n).trim().toLowerCase()];
|
|
759
|
+
if (key) {
|
|
760
|
+
offered.add(Target[key]);
|
|
761
|
+
} else {
|
|
762
|
+
log.error(`${name}: unknown arm mode "${n}" in target_states, use away, home, night or off`);
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
if (offered.size === 1) {
|
|
767
|
+
log.error(`${name}: target_states offers no way to arm, offering every mode instead`);
|
|
768
|
+
return all;
|
|
769
|
+
}
|
|
770
|
+
return all.filter(v => offered.has(v));
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// The armed mode to show for an arm in a mode that is not offered: away if it
|
|
774
|
+
// is there, otherwise the first armed mode that is.
|
|
775
|
+
function offeredArmState(Characteristic, offered) {
|
|
776
|
+
const Target = Characteristic.SecuritySystemTargetState;
|
|
777
|
+
if (offered.includes(Target.AWAY_ARM)) {
|
|
778
|
+
return Target.AWAY_ARM;
|
|
779
|
+
}
|
|
780
|
+
return offered.find(v => v !== Target.DISARM);
|
|
781
|
+
}
|
|
782
|
+
|
|
725
783
|
function parseUserList(value) {
|
|
726
784
|
if (value === null || value === undefined || value === "") {
|
|
727
785
|
return [];
|
|
@@ -754,6 +812,9 @@ function TexecomAccessory(log, config, hap, kind) {
|
|
|
754
812
|
// The state an area was in when Homebridge last stopped, if it is known.
|
|
755
813
|
this.restored_state = null;
|
|
756
814
|
|
|
815
|
+
// The arm modes this area offers in the Home app, if it sets its own.
|
|
816
|
+
this.target_states = config["target_states"];
|
|
817
|
+
|
|
757
818
|
if (this.kind === "group") {
|
|
758
819
|
// A combined area is addressed as several area numbers at once.
|
|
759
820
|
this.area_numbers = (config["areas"] || []).map(Number).filter(n => !Number.isNaN(n));
|
|
@@ -886,7 +947,29 @@ TexecomAccessory.prototype = {
|
|
|
886
947
|
break;
|
|
887
948
|
|
|
888
949
|
case "securitysystem":
|
|
950
|
+
// Only the arm modes asked for are offered in the Home app.
|
|
951
|
+
// Off is always there, an alarm that cannot be turned off from
|
|
952
|
+
// HomeKit is no use to anyone.
|
|
953
|
+
const offered = parseTargetStates(Characteristic,
|
|
954
|
+
this.target_states != null ? this.target_states : (platform && platform.target_states),
|
|
955
|
+
me.log, me.name);
|
|
956
|
+
// Off first, so the value it holds is in the new list. The real
|
|
957
|
+
// state follows once it is known, below.
|
|
958
|
+
service.getCharacteristic(Characteristic.SecuritySystemTargetState)
|
|
959
|
+
.updateValue(Characteristic.SecuritySystemTargetState.DISARM)
|
|
960
|
+
.setProps({ validValues: offered });
|
|
961
|
+
|
|
889
962
|
changeAction = function (newState) {
|
|
963
|
+
// An arm in a mode the Home app does not offer, from the
|
|
964
|
+
// keypad say, is shown as the armed mode it does offer.
|
|
965
|
+
// HomeKit will not take a target state outside the list.
|
|
966
|
+
const asked = currentToTargetState(Characteristic, newState);
|
|
967
|
+
if (asked != null && !offered.includes(asked)) {
|
|
968
|
+
const shown = offeredArmState(Characteristic, offered);
|
|
969
|
+
me.log.debug(`${me.name} armed in a mode the Home app does not offer, showing it as ${shown}`);
|
|
970
|
+
newState = targetToCurrentState(Characteristic, shown);
|
|
971
|
+
}
|
|
972
|
+
|
|
890
973
|
const targetState = currentToTargetState(Characteristic, newState);
|
|
891
974
|
|
|
892
975
|
// updateValue, never setValue: setValue would fire the set
|
|
@@ -927,7 +1010,12 @@ TexecomAccessory.prototype = {
|
|
|
927
1010
|
return new Promise((resolve, reject) => {
|
|
928
1011
|
// platform reference is injected above
|
|
929
1012
|
const platform = me._platform;
|
|
930
|
-
if (
|
|
1013
|
+
if (!offered.includes(value)) {
|
|
1014
|
+
me.log.error(`${me.name}: arm mode ${value} is not one target_states offers, ignoring it`);
|
|
1015
|
+
reject(hap.HapStatusError
|
|
1016
|
+
? new hap.HapStatusError(hap.HAPStatus.INVALID_VALUE_IN_REQUEST)
|
|
1017
|
+
: new Error("Arm mode not offered"));
|
|
1018
|
+
} else if (platform && platform.udl != null) {
|
|
931
1019
|
areaTargetSecurityStateSet(platform, area, service, value,
|
|
932
1020
|
(err) => err ? reject(failure()) : resolve());
|
|
933
1021
|
} else {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"displayName": "Homebridge Texecom",
|
|
3
3
|
"name": "homebridge-texecom-full",
|
|
4
4
|
"description": "A plugin for homebridge to integrate Texecom Premier Elite alarm systems into HomeKit",
|
|
5
|
-
"version": "4.4.1-beta.
|
|
5
|
+
"version": "4.4.1-beta.2",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Chris Posthumus",
|
|
8
8
|
"email": "chris.posthumus@gmail.com"
|
package/util/logutil.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
// A thin layer over the Homebridge logger, which already stamps the time and
|
|
2
|
-
// the platform name on every line. Errors and warnings are always shown, debug
|
|
3
|
-
// lines only when the plugin's own debug option is on, in which case they are
|
|
4
|
-
// written as ordinary lines so they show without running Homebridge in debug.
|
|
5
|
-
class LogUtil {
|
|
6
|
-
constructor(isDebug = false, prefix = '', log) {
|
|
7
|
-
this.isDebug = isDebug;
|
|
8
|
-
this.prefix = prefix;
|
|
9
|
-
this.hbLog = log;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
log(...args) {
|
|
13
|
-
this.hbLog.info(...args);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
warn(...args) {
|
|
17
|
-
this.hbLog.warn(...args);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
error(...args) {
|
|
21
|
-
this.hbLog.error(...args);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
debug(...args) {
|
|
25
|
-
if (this.isDebug) {
|
|
26
|
-
this.hbLog.info(...args);
|
|
27
|
-
} else {
|
|
28
|
-
this.hbLog.debug(...args);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = LogUtil;
|
|
1
|
+
// A thin layer over the Homebridge logger, which already stamps the time and
|
|
2
|
+
// the platform name on every line. Errors and warnings are always shown, debug
|
|
3
|
+
// lines only when the plugin's own debug option is on, in which case they are
|
|
4
|
+
// written as ordinary lines so they show without running Homebridge in debug.
|
|
5
|
+
class LogUtil {
|
|
6
|
+
constructor(isDebug = false, prefix = '', log) {
|
|
7
|
+
this.isDebug = isDebug;
|
|
8
|
+
this.prefix = prefix;
|
|
9
|
+
this.hbLog = log;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
log(...args) {
|
|
13
|
+
this.hbLog.info(...args);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
warn(...args) {
|
|
17
|
+
this.hbLog.warn(...args);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
error(...args) {
|
|
21
|
+
this.hbLog.error(...args);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
debug(...args) {
|
|
25
|
+
if (this.isDebug) {
|
|
26
|
+
this.hbLog.info(...args);
|
|
27
|
+
} else {
|
|
28
|
+
this.hbLog.debug(...args);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = LogUtil;
|