homebridge-securitysystem 6.6.2-beta.2 → 7.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/README.md CHANGED
@@ -17,9 +17,9 @@ If you already have [Homebridge](https://github.com/homebridge/homebridge) insta
17
17
  ## Demo
18
18
 
19
19
  <div align="left">
20
- <img align="right" width="206" height="445" src="https://media4.giphy.com/media/wDhRHFfrLRDeC1sXG5/giphy.gif">
20
+ <img align="right" width="205" height="445" src="./.github/demo.jpg">
21
21
  <p>Want to know how it looks like? It's pretty customizable, you can configure it to show as many switches as you like.</p>
22
- <p>What you are seeing at your right is <b>the friendliest</b> configuration that you can start with, each <code>Siren</code> switch that you see can only trigger the security system if the mode is set on the security system. This allows you to create logic-less automations from the very Home app that comes already installed on iOS.</p>
22
+ <p>What you are seeing at your right is <b>the friendliest</b> configuration that you can start with, each <code>Trip</code> switch that you see can only trip the security system if the mode is set on the security system. This allows you to create logic-less automations from the very Home app that comes already installed on iOS.</p>
23
23
  <p>There are also <code>Mode</code> switches which let you run automations that interact with your accessories when a mode is changed or set modes bypassing HomeKit confirmation dialogs.</p>
24
24
  <p>A web server, webhooks or even shell commands are available to integrate the security system with other devices or services plus a plenty of more settings to make this plugin your own DIY security system.</p>
25
25
  <p>Homebridge / HOOBS UI is recommended to configure the plugin, for additional help please check the <a href="https://github.com/MiguelRipoll23/homebridge-securitysystem/wiki">Wiki</a> page.</p>
@@ -33,8 +33,8 @@ Here are some examples of automations that can be created:
33
33
 
34
34
  | Trigger | Actions |
35
35
  | ------------------------ | ----------------------------- |
36
- | Motion is Detected | Turn on `Siren Night` |
37
- | Door is Opened | Turn on `Siren Away` |
36
+ | Motion is Detected | Turn on `Trip Night` |
37
+ | Door is Opened | Turn on `Trip Away` |
38
38
  | NFC Tag is Detected (1) | Set Security system to `Home` |
39
39
  | Security System Triggers | Play Audio (2) |
40
40
 
@@ -42,9 +42,6 @@ Here are some examples of automations that can be created:
42
42
 
43
43
  (2) AirPlay 2 speaker and Apple Music subscription are required.
44
44
 
45
- > **Warning**
46
- > Use an NFC tag to arm/disarm the security system easily and securely without using the `Home` app.
47
-
48
45
  ## Contributions
49
46
 
50
47
  Pull requests are welcome.
@@ -80,49 +80,49 @@
80
80
  "placeholder": "/home/user/logs"
81
81
  },
82
82
  "home_arm_seconds": {
83
- "title": "Home Arming Seconds",
83
+ "title": "Home Arming Delay Seconds",
84
84
  "type": ["null", "integer"],
85
85
  "default": "null",
86
86
  "required": false,
87
87
  "minimum": 0
88
88
  },
89
89
  "night_arm_seconds": {
90
- "title": "Night Arming Seconds",
90
+ "title": "Night Arming Delay Seconds",
91
91
  "type": ["null", "integer"],
92
92
  "default": "null",
93
93
  "required": false,
94
94
  "minimum": 0
95
95
  },
96
96
  "away_arm_seconds": {
97
- "title": "Away Arming Seconds",
97
+ "title": "Away Arming Delay Seconds",
98
98
  "type": ["null", "integer"],
99
99
  "default": "null",
100
100
  "required": false,
101
101
  "minimum": 0
102
102
  },
103
103
  "home_trigger_seconds": {
104
- "title": "Home Trigger Seconds",
104
+ "title": "Home Trigger Delay Seconds",
105
105
  "type": ["null", "integer"],
106
106
  "default": "null",
107
107
  "required": false,
108
108
  "minimum": 0
109
109
  },
110
110
  "night_trigger_seconds": {
111
- "title": "Night Trigger Seconds",
111
+ "title": "Night Trigger Delay Seconds",
112
112
  "type": ["null", "integer"],
113
113
  "default": "null",
114
114
  "required": false,
115
115
  "minimum": 0
116
116
  },
117
117
  "away_trigger_seconds": {
118
- "title": "Away Trigger Seconds",
118
+ "title": "Away Trigger Delay Seconds",
119
119
  "type": ["null", "integer"],
120
120
  "default": "null",
121
121
  "required": false,
122
122
  "minimum": 0
123
123
  },
124
124
  "away_extended_trigger_seconds": {
125
- "title": "Away Extended Trigger Seconds",
125
+ "title": "Away Extended Delay Trigger Seconds",
126
126
  "type": ["null", "integer"],
127
127
  "default": "null",
128
128
  "required": false,
@@ -144,7 +144,7 @@
144
144
  },
145
145
  "double_knock": {
146
146
  "title": "Use Double-Knock",
147
- "description": "Needs the Siren switch to be turn on twice within a time window.",
147
+ "description": "Needs the Trip switch to be turn on twice within a time window.",
148
148
  "type": "boolean",
149
149
  "default": false,
150
150
  "required": false
@@ -211,36 +211,36 @@
211
211
  }
212
212
  },
213
213
  "tripped_sensor": {
214
- "title": "Show Siren Tripped Sensor",
215
- "description": "Adds a sensor that triggers multiple times when any of the siren switches have been turned on.",
214
+ "title": "Show Tripped Sensor",
215
+ "description": "Adds a sensor that triggers multiple times when any of the Trip switches have been turned on.",
216
216
  "type": "boolean",
217
217
  "default": false,
218
218
  "required": false
219
219
  },
220
220
  "tripped_sensor_seconds": {
221
- "title": "Siren Tripped Seconds",
221
+ "title": "Tripped Sensor Seconds",
222
222
  "type": "integer",
223
223
  "default": 5,
224
224
  "required": false,
225
225
  "minimum": 0
226
226
  },
227
227
  "siren_sensor": {
228
- "title": "Show Siren Triggered Sensor",
228
+ "title": "Show Triggered Sensor",
229
229
  "description": "Adds a sensor that triggers multiple times when the security system has been triggered.",
230
230
  "type": "boolean",
231
231
  "default": false,
232
232
  "required": false
233
233
  },
234
234
  "siren_sensor_seconds": {
235
- "title": "Siren Triggered Seconds",
235
+ "title": "Triggered Sensor Seconds",
236
236
  "type": "integer",
237
237
  "default": 5,
238
238
  "required": false,
239
239
  "minimum": 0
240
240
  },
241
241
  "reset_sensor": {
242
- "title": "Show Siren Reset Sensor",
243
- "description": "Adds a sensor that triggers when the security system has reset after triggering.",
242
+ "title": "Show Triggered Reset Sensor",
243
+ "description": "Adds a sensor that triggers when the security system has reset after being triggered.",
244
244
  "type": "boolean",
245
245
  "default": false,
246
246
  "required": false
@@ -295,21 +295,21 @@
295
295
  "required": false
296
296
  },
297
297
  "siren_switch": {
298
- "title": "Show Siren Switch",
299
- "description": "Adds a global switch that will trigger the security system.",
298
+ "title": "Show Trip Switch",
299
+ "description": "Adds a global switch that will trip the security system.",
300
300
  "type": "boolean",
301
301
  "default": false,
302
302
  "required": false
303
303
  },
304
304
  "siren_override_switch": {
305
- "title": "Show Siren Override Switch",
305
+ "title": "Show Trip Override Switch",
306
306
  "description": "Adds a special switch that will trigger the security system bypassing the conditions set.",
307
307
  "type": "boolean",
308
308
  "default": false,
309
309
  "required": false
310
310
  },
311
311
  "siren_mode_switches": {
312
- "title": "Show Siren Mode Switches",
312
+ "title": "Show Trip Mode Switches",
313
313
  "description": "Adds switches that will trigger the security system when their mode is set.",
314
314
  "type": "boolean",
315
315
  "default": true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-securitysystem",
3
3
  "displayName": "Homebridge Security System",
4
- "version": "6.6.2-beta.2",
4
+ "version": "7.0.0-beta.1",
5
5
  "description": "Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
package/src/index.js CHANGED
@@ -57,8 +57,8 @@ function SecuritySystem(log, config) {
57
57
  this.doubleKnockTimeout = null;
58
58
  this.resetTimeout = null;
59
59
 
60
- this.sirenTrippedInterval = null;
61
- this.sirenTriggeredInterval = null;
60
+ this.trippedMotionSensorInterval = null;
61
+ this.triggeredMotionSensorInterval = null;
62
62
 
63
63
  // File logger
64
64
  if (options.isValueSet(options.logDirectory)) {
@@ -156,47 +156,47 @@ function SecuritySystem(log, config) {
156
156
  .getCharacteristic(Characteristic.SecuritySystemCurrentState)
157
157
  .on("get", this.getCurrentState.bind(this));
158
158
 
159
- // Siren switches
160
- this.sirenSwitchService = new Service.Switch("Siren", "siren-switch");
159
+ // Trip switches
160
+ this.tripSwitchService = new Service.Switch("Trip", "siren-switch");
161
161
 
162
- this.sirenSwitchService
162
+ this.tripSwitchService
163
163
  .getCharacteristic(Characteristic.On)
164
- .on("get", this.getSirenSwitch.bind(this))
165
- .on("set", this.setSirenSwitch.bind(this));
164
+ .on("get", this.getTripSwitch.bind(this))
165
+ .on("set", this.setTripSwitch.bind(this));
166
166
 
167
- this.sirenOverrideSwitchService = new Service.Switch(
168
- "Siren Override",
167
+ this.tripOverrideSwitchService = new Service.Switch(
168
+ "Trip Override",
169
169
  "BdW9ce0mUYatqiRqEjT4iA"
170
170
  );
171
171
 
172
- this.sirenOverrideSwitchService
172
+ this.tripOverrideSwitchService
173
173
  .getCharacteristic(Characteristic.On)
174
- .on("get", this.getSirenOverrideSwitch.bind(this))
175
- .on("set", this.setSirenOverrideSwitch.bind(this));
174
+ .on("get", this.getTripOverrideSwitch.bind(this))
175
+ .on("set", this.setTripOverrideSwitch.bind(this));
176
176
 
177
- this.sirenHomeSwitchService = new Service.Switch("Siren Home", "siren-home");
177
+ this.tripHomeSwitchService = new Service.Switch("Trip Home", "siren-home");
178
178
 
179
- this.sirenHomeSwitchService
179
+ this.tripHomeSwitchService
180
180
  .getCharacteristic(Characteristic.On)
181
- .on("get", this.getSirenHomeSwitch.bind(this))
182
- .on("set", this.setSirenHomeSwitch.bind(this));
181
+ .on("get", this.getTripHomeSwitch.bind(this))
182
+ .on("set", this.setTripHomeSwitch.bind(this));
183
183
 
184
- this.sirenAwaySwitchService = new Service.Switch("Siren Away", "siren-away");
184
+ this.tripAwaySwitchService = new Service.Switch("Trip Away", "siren-away");
185
185
 
186
- this.sirenAwaySwitchService
186
+ this.tripAwaySwitchService
187
187
  .getCharacteristic(Characteristic.On)
188
- .on("get", this.getSirenAwaySwitch.bind(this))
189
- .on("set", this.setSirenAwaySwitch.bind(this));
188
+ .on("get", this.getTripAwaySwitch.bind(this))
189
+ .on("set", this.setTripAwaySwitch.bind(this));
190
190
 
191
- this.sirenNightSwitchService = new Service.Switch(
192
- "Siren Night",
191
+ this.tripNightSwitchService = new Service.Switch(
192
+ "Trip Night",
193
193
  "siren-night"
194
194
  );
195
195
 
196
- this.sirenNightSwitchService
196
+ this.tripNightSwitchService
197
197
  .getCharacteristic(Characteristic.On)
198
- .on("get", this.getSirenNightSwitch.bind(this))
199
- .on("set", this.setSirenNightSwitch.bind(this));
198
+ .on("get", this.getTripNightSwitch.bind(this))
199
+ .on("set", this.setTripNightSwitch.bind(this));
200
200
 
201
201
  // Arming lock switches
202
202
  this.armingLockSwitchService = new Service.Switch(
@@ -298,33 +298,33 @@ function SecuritySystem(log, config) {
298
298
 
299
299
  this.audioSwitchService.getCharacteristic(Characteristic.On).value = true;
300
300
 
301
- // Siren sensors
302
- this.sirenTrippedMotionSensorService = new Service.MotionSensor(
303
- "Siren Tripped",
301
+ // Tripped / Triggered sensors
302
+ this.trippedMotionSensorService = new Service.MotionSensor(
303
+ "Tripped",
304
304
  "siren-tripped"
305
305
  );
306
306
 
307
- this.sirenTrippedMotionSensorService
307
+ this.trippedMotionSensorService
308
308
  .getCharacteristic(Characteristic.MotionDetected)
309
- .on("get", this.getSirenTrippedMotionDetected.bind(this));
309
+ .on("get", this.getTrippedMotionDetected.bind(this));
310
310
 
311
- this.sirenTriggeredMotionSensorService = new Service.MotionSensor(
312
- "Siren Triggered",
311
+ this.triggeredMotionSensorService = new Service.MotionSensor(
312
+ "Triggered",
313
313
  "siren-triggered"
314
314
  );
315
315
 
316
- this.sirenTriggeredMotionSensorService
316
+ this.triggeredMotionSensorService
317
317
  .getCharacteristic(Characteristic.MotionDetected)
318
- .on("get", this.getSirenTriggeredMotionDetected.bind(this));
318
+ .on("get", this.getTriggeredMotionDetected.bind(this));
319
319
 
320
- this.sirenResetMotionSensorService = new Service.MotionSensor(
321
- "Siren Reset",
320
+ this.triggeredResetMotionSensorService = new Service.MotionSensor(
321
+ "Triggered Reset",
322
322
  "reset-event"
323
323
  );
324
324
 
325
- this.sirenResetMotionSensorService
325
+ this.triggeredResetMotionSensorService
326
326
  .getCharacteristic(Characteristic.MotionDetected)
327
- .on("get", this.getSirenResetMotionDetected.bind(this));
327
+ .on("get", this.getTriggeredResetMotionDetected.bind(this));
328
328
 
329
329
  // Accessory information
330
330
  this.accessoryInformationService = new Service.AccessoryInformation();
@@ -357,16 +357,16 @@ function SecuritySystem(log, config) {
357
357
  // Services list
358
358
  this.services = [this.service, this.accessoryInformationService];
359
359
 
360
- if (options.trippedSensor) {
361
- this.services.push(this.sirenTrippedMotionSensorService);
360
+ if (options.trippedMotionSensor) {
361
+ this.services.push(this.trippedMotionSensorService);
362
362
  }
363
363
 
364
- if (options.sirenSensor) {
365
- this.services.push(this.sirenTriggeredMotionSensorService);
364
+ if (options.triggeredMotionSensor) {
365
+ this.services.push(this.triggeredMotionSensorService);
366
366
  }
367
367
 
368
368
  if (options.resetSensor) {
369
- this.services.push(this.sirenResetMotionSensorService);
369
+ this.services.push(this.triggeredResetMotionSensorService);
370
370
  }
371
371
 
372
372
  if (options.armingLockSwitch) {
@@ -379,12 +379,12 @@ function SecuritySystem(log, config) {
379
379
  this.services.push(this.armingLockNightSwitchService);
380
380
  }
381
381
 
382
- if (options.sirenSwitch) {
383
- this.services.push(this.sirenSwitchService);
382
+ if (options.tripSwitch) {
383
+ this.services.push(this.tripSwitchService);
384
384
  }
385
385
 
386
- if (options.sirenOverrideSwitch) {
387
- this.services.push(this.sirenOverrideSwitchService);
386
+ if (options.tripOverrideSwitch) {
387
+ this.services.push(this.tripOverrideSwitchService);
388
388
  }
389
389
 
390
390
  if (
@@ -396,8 +396,8 @@ function SecuritySystem(log, config) {
396
396
  this.services.push(this.modeHomeSwitchService);
397
397
  }
398
398
 
399
- if (options.sirenModeSwitches) {
400
- this.services.push(this.sirenHomeSwitchService);
399
+ if (options.tripModeSwitches) {
400
+ this.services.push(this.tripHomeSwitchService);
401
401
  }
402
402
  }
403
403
 
@@ -410,8 +410,8 @@ function SecuritySystem(log, config) {
410
410
  this.services.push(this.modeAwaySwitchService);
411
411
  }
412
412
 
413
- if (options.sirenModeSwitches) {
414
- this.services.push(this.sirenAwaySwitchService);
413
+ if (options.tripModeSwitches) {
414
+ this.services.push(this.tripAwaySwitchService);
415
415
  }
416
416
  }
417
417
 
@@ -424,8 +424,8 @@ function SecuritySystem(log, config) {
424
424
  this.services.push(this.modeNightSwitchService);
425
425
  }
426
426
 
427
- if (options.sirenModeSwitches) {
428
- this.services.push(this.sirenNightSwitchService);
427
+ if (options.tripModeSwitches) {
428
+ this.services.push(this.tripNightSwitchService);
429
429
  }
430
430
  }
431
431
 
@@ -664,10 +664,10 @@ SecuritySystem.prototype.setCurrentState = function (state, origin) {
664
664
  this.sendWebhookEvent("current", state, origin);
665
665
 
666
666
  if (state === Characteristic.SecuritySystemCurrentState.ALARM_TRIGGERED) {
667
- // Update siren triggered sensor
668
- this.sirenTriggeredInterval = setInterval(() => {
669
- this.updateSirenTriggeredMotionDetected();
670
- }, options.sirenSensorSeconds * 1000);
667
+ // Update triggered motion sensor
668
+ this.triggeredMotionSensorInterval = setInterval(() => {
669
+ this.updateTriggeredMotionDetected();
670
+ }, options.triggeredMotionSensorSeconds * 1000);
671
671
 
672
672
  // Automatically arm the security system
673
673
  // when time runs out
@@ -675,14 +675,14 @@ SecuritySystem.prototype.setCurrentState = function (state, origin) {
675
675
  this.resetTimeout = null;
676
676
  this.log.info("Reset (Finished)");
677
677
 
678
- // Update reset sensor
679
- this.sirenResetMotionSensorService.updateCharacteristic(
678
+ // Update triggered reset motion sensor
679
+ this.triggeredResetMotionSensorService.updateCharacteristic(
680
680
  Characteristic.MotionDetected,
681
681
  true
682
682
  );
683
683
 
684
684
  setTimeout(() => {
685
- this.sirenResetMotionSensorService.updateCharacteristic(
685
+ this.triggeredResetMotionSensorService.updateCharacteristic(
686
686
  Characteristic.MotionDetected,
687
687
  false
688
688
  );
@@ -736,20 +736,20 @@ SecuritySystem.prototype.resetTimers = function () {
736
736
  this.log.debug("Arming timeout (Cleared)");
737
737
  }
738
738
 
739
- // Clear siren triggered sensor
740
- if (this.sirenTriggeredInterval !== null) {
741
- clearInterval(this.sirenTriggeredInterval);
739
+ // Clear triggered motion sensor
740
+ if (this.triggeredMotionSensorInterval !== null) {
741
+ clearInterval(this.triggeredMotionSensorInterval);
742
742
 
743
- this.sirenTriggeredInterval = null;
744
- this.log.debug("Siren triggered interval (Cleared)");
743
+ this.triggeredMotionSensorInterval = null;
744
+ this.log.debug("Triggered interval (Cleared)");
745
745
  }
746
746
 
747
- // Clear siren tripped sensor
748
- if (this.sirenTrippedInterval !== null) {
749
- clearInterval(this.sirenTrippedInterval);
747
+ // Clear tripped sensor
748
+ if (this.trippedMotionSensorInterval !== null) {
749
+ clearInterval(this.trippedMotionSensorInterval);
750
750
 
751
- this.sirenTrippedInterval = null;
752
- this.log.debug("Siren tripped interval (Cleared)");
751
+ this.trippedMotionSensorInterval = null;
752
+ this.log.debug("Tripped interval (Cleared)");
753
753
  }
754
754
 
755
755
  // Clear double-knock timeout
@@ -790,15 +790,15 @@ SecuritySystem.prototype.handleStateUpdate = function (alarmTriggered) {
790
790
  return;
791
791
  }
792
792
 
793
- const sirenOnCharacteristic = this.sirenSwitchService.getCharacteristic(
793
+ const trippedOnCharacteristic = this.tripSwitchService.getCharacteristic(
794
794
  Characteristic.On
795
795
  );
796
796
 
797
- if (sirenOnCharacteristic.value) {
798
- this.updateSiren(false, originTypes.INTERNAL, true, null);
797
+ if (trippedOnCharacteristic.value) {
798
+ this.updateTripSwitch(false, originTypes.INTERNAL, true, null);
799
799
  }
800
800
 
801
- this.resetSirenSwitches();
801
+ this.resetTripSwitches();
802
802
  };
803
803
 
804
804
  SecuritySystem.prototype.updateTargetState = function (
@@ -958,7 +958,7 @@ SecuritySystem.prototype.setTargetState = function (value, callback) {
958
958
  this.updateTargetState(value, originTypes.REGULAR_SWITCH, true, callback);
959
959
  };
960
960
 
961
- SecuritySystem.prototype.updateSiren = function (
961
+ SecuritySystem.prototype.updateTripSwitch = function (
962
962
  value,
963
963
  origin,
964
964
  stateChanged,
@@ -981,7 +981,7 @@ SecuritySystem.prototype.updateSiren = function (
981
981
  const isNotSpecialSwitch = origin !== originTypes.SPECIAL_SWITCH;
982
982
 
983
983
  if (isCurrentStateDisarmed && isNotOverridingOff && isNotSpecialSwitch) {
984
- this.log.warn("Siren Switch (Not armed)");
984
+ this.log.warn("Trip Switch (Not armed)");
985
985
 
986
986
  if (callback !== null) {
987
987
  callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
@@ -992,7 +992,7 @@ SecuritySystem.prototype.updateSiren = function (
992
992
 
993
993
  // Check if arming
994
994
  if (this.isArming) {
995
- this.log.warn("Siren Switch (Still arming)");
995
+ this.log.warn("Trip Switch (Still arming)");
996
996
 
997
997
  if (callback !== null) {
998
998
  callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
@@ -1017,7 +1017,7 @@ SecuritySystem.prototype.updateSiren = function (
1017
1017
  isFirstKnock &&
1018
1018
  isSpecialSwitch === false
1019
1019
  ) {
1020
- this.log.warn("Siren Switch (Knock)");
1020
+ this.log.warn("Trip Switch (Knock)");
1021
1021
  this.isKnocked = true;
1022
1022
 
1023
1023
  // Custom mode seconds
@@ -1044,7 +1044,7 @@ SecuritySystem.prototype.updateSiren = function (
1044
1044
  this.doubleKnockTimeout = null;
1045
1045
  this.isKnocked = false;
1046
1046
 
1047
- this.log.info("Siren Switch (Reset)");
1047
+ this.log.info("Trip Switch (Reset)");
1048
1048
  }, doubleKnockSeconds * 1000);
1049
1049
 
1050
1050
  if (callback !== null) {
@@ -1065,13 +1065,13 @@ SecuritySystem.prototype.updateSiren = function (
1065
1065
  }
1066
1066
 
1067
1067
  if (origin === originTypes.INTERNAL || origin === originTypes.EXTERNAL) {
1068
- this.sirenSwitchService.updateCharacteristic(Characteristic.On, value);
1068
+ this.tripSwitchService.updateCharacteristic(Characteristic.On, value);
1069
1069
  }
1070
1070
 
1071
1071
  if (value) {
1072
1072
  // Already triggered
1073
1073
  if (isCurrentStateAlarmTriggered) {
1074
- this.log.warn("Siren Switch (Already triggered)");
1074
+ this.log.warn("Trip Switch (Already triggered)");
1075
1075
 
1076
1076
  if (callback !== null) {
1077
1077
  callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
@@ -1082,7 +1082,7 @@ SecuritySystem.prototype.updateSiren = function (
1082
1082
 
1083
1083
  // Already about to trigger
1084
1084
  if (this.triggerTimeout !== null) {
1085
- this.log.warn("Siren Switch (Already on)");
1085
+ this.log.warn("Trip Switch (Already on)");
1086
1086
 
1087
1087
  if (callback !== null) {
1088
1088
  callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
@@ -1091,15 +1091,15 @@ SecuritySystem.prototype.updateSiren = function (
1091
1091
  return false;
1092
1092
  }
1093
1093
 
1094
- this.log.info("Siren Switch (On)");
1094
+ this.log.info("Trip Switch (On)");
1095
1095
 
1096
- // Update siren tripped sensor
1097
- if (options.trippedSensor) {
1098
- this.updateSirenTrippedMotionDetected();
1096
+ // Update tripped motion sensor
1097
+ if (options.trippedMotionSensor) {
1098
+ this.updateTrippedMotionDetected();
1099
1099
 
1100
- this.sirenTrippedInterval = setInterval(() => {
1101
- this.updateSirenTrippedMotionDetected();
1102
- }, options.trippedSensorSeconds * 1000);
1100
+ this.trippedMotionSensorInterval = setInterval(() => {
1101
+ this.updateTrippedMotionDetected();
1102
+ }, options.trippedMotionSensorSeconds * 1000);
1103
1103
  }
1104
1104
 
1105
1105
  const isCurrentStateHome =
@@ -1160,7 +1160,7 @@ SecuritySystem.prototype.updateSiren = function (
1160
1160
  this.sendWebhookEvent("current", "warning", origin);
1161
1161
  } else {
1162
1162
  // Off
1163
- this.log.info("Siren Switch (Off)");
1163
+ this.log.info("Trip Switch (Off)");
1164
1164
  this.stopAudio();
1165
1165
 
1166
1166
  if (isCurrentStateAlarmTriggered) {
@@ -1176,9 +1176,9 @@ SecuritySystem.prototype.updateSiren = function (
1176
1176
  this.resetTimers();
1177
1177
  }
1178
1178
 
1179
- // Update siren tripped sensor
1179
+ // Update tripped motion sensor
1180
1180
  if (options.trippedSensor) {
1181
- this.sirenTrippedMotionSensorService.updateCharacteristic(
1181
+ this.trippedMotionSensorService.updateCharacteristic(
1182
1182
  Characteristic.MotionDetected,
1183
1183
  false
1184
1184
  );
@@ -1194,8 +1194,8 @@ SecuritySystem.prototype.updateSiren = function (
1194
1194
  return true;
1195
1195
  };
1196
1196
 
1197
- SecuritySystem.prototype.setSiren = function (value, callback) {
1198
- this.updateSiren(value, originTypes.REGULAR_SWITCH, false, callback);
1197
+ SecuritySystem.prototype.setTrip = function (value, callback) {
1198
+ this.updateTripSwitch(value, originTypes.REGULAR_SWITCH, false, callback);
1199
1199
  };
1200
1200
 
1201
1201
  // Server
@@ -1264,9 +1264,9 @@ SecuritySystem.prototype.sendCodeInvalidError = function (req, res) {
1264
1264
  res.status(403).json(response);
1265
1265
  };
1266
1266
 
1267
- SecuritySystem.prototype.sendResultResponse = function (res, sucess) {
1267
+ SecuritySystem.prototype.sendResultResponse = function (res, success) {
1268
1268
  const response = {
1269
- error: sucess ? false : true,
1269
+ error: success ? false : true,
1270
1270
  };
1271
1271
 
1272
1272
  res.json(response);
@@ -1297,8 +1297,8 @@ SecuritySystem.prototype.startServer = async function () {
1297
1297
  arming: this.isArming,
1298
1298
  current_mode: this.state2Mode(this.currentState),
1299
1299
  target_mode: this.state2Mode(this.targetState),
1300
- sensor_triggered: this.triggerTimeout !== null,
1301
- arming_lock: this.isArmingLocked("global"),
1300
+ tripped: this.triggerTimeout !== null,
1301
+ arming_locked: this.isArmingLocked("global"),
1302
1302
  };
1303
1303
 
1304
1304
  res.json(response);
@@ -1313,7 +1313,7 @@ SecuritySystem.prototype.startServer = async function () {
1313
1313
 
1314
1314
  if (this.getDelayParameter(req)) {
1315
1315
  // Delay
1316
- result = this.updateSiren(true, originTypes.EXTERNAL, false, null);
1316
+ result = this.updateTripSwitch(true, originTypes.EXTERNAL, false, null);
1317
1317
  } else {
1318
1318
  const isCurrentStateDisarmed =
1319
1319
  this.currentState ===
@@ -1736,58 +1736,58 @@ SecuritySystem.prototype.sendWebhookEvent = function (type, state, origin) {
1736
1736
  });
1737
1737
  };
1738
1738
 
1739
- // Siren switches
1740
- SecuritySystem.prototype.getSirenSwitch = function (callback) {
1741
- const value = this.sirenSwitchService.getCharacteristic(
1739
+ // Trip switches
1740
+ SecuritySystem.prototype.getTripSwitch = function (callback) {
1741
+ const value = this.tripSwitchService.getCharacteristic(
1742
1742
  Characteristic.On
1743
1743
  ).value;
1744
1744
  callback(null, value);
1745
1745
  };
1746
1746
 
1747
- SecuritySystem.prototype.setSirenSwitch = function (value, callback) {
1748
- this.updateSiren(value, originTypes.REGULAR_SWITCH, false, callback);
1747
+ SecuritySystem.prototype.setTripSwitch = function (value, callback) {
1748
+ this.updateTripSwitch(value, originTypes.REGULAR_SWITCH, false, callback);
1749
1749
  };
1750
1750
 
1751
- SecuritySystem.prototype.getSirenOverrideSwitch = function (callback) {
1752
- const value = this.sirenOverrideSwitchService.getCharacteristic(
1751
+ SecuritySystem.prototype.getTripOverrideSwitch = function (callback) {
1752
+ const value = this.tripOverrideSwitchService.getCharacteristic(
1753
1753
  Characteristic.On
1754
1754
  ).value;
1755
1755
  callback(null, value);
1756
1756
  };
1757
1757
 
1758
- SecuritySystem.prototype.setSirenOverrideSwitch = function (value, callback) {
1759
- this.updateSiren(value, originTypes.SPECIAL_SWITCH, false, callback);
1758
+ SecuritySystem.prototype.setTripOverrideSwitch = function (value, callback) {
1759
+ this.updateTripSwitch(value, originTypes.SPECIAL_SWITCH, false, callback);
1760
1760
  };
1761
1761
 
1762
- SecuritySystem.prototype.resetSirenSwitches = function () {
1763
- const sirenHomeOnCharacteristic =
1764
- this.sirenHomeSwitchService.getCharacteristic(Characteristic.On);
1765
- const sirenAwayOnCharacteristic =
1766
- this.sirenAwaySwitchService.getCharacteristic(Characteristic.On);
1767
- const sirenNightOnCharacteristic =
1768
- this.sirenNightSwitchService.getCharacteristic(Characteristic.On);
1762
+ SecuritySystem.prototype.resetTripSwitches = function () {
1763
+ const tripHomeOnCharacteristic =
1764
+ this.tripHomeSwitchService.getCharacteristic(Characteristic.On);
1765
+ const tripAwayOnCharacteristic =
1766
+ this.tripAwaySwitchService.getCharacteristic(Characteristic.On);
1767
+ const tripNightOnCharacteristic =
1768
+ this.tripNightSwitchService.getCharacteristic(Characteristic.On);
1769
1769
 
1770
- const sirenOverrideOnCharacteristic =
1771
- this.sirenOverrideSwitchService.getCharacteristic(Characteristic.On);
1770
+ const tripOverrideOnCharacteristic =
1771
+ this.tripOverrideSwitchService.getCharacteristic(Characteristic.On);
1772
1772
 
1773
- if (sirenHomeOnCharacteristic.value) {
1774
- sirenHomeOnCharacteristic.updateValue(false);
1775
- this.log.debug("Siren Home Switch (Off)");
1773
+ if (tripHomeOnCharacteristic.value) {
1774
+ tripHomeOnCharacteristic.updateValue(false);
1775
+ this.log.debug("Trip Home Switch (Off)");
1776
1776
  }
1777
1777
 
1778
- if (sirenAwayOnCharacteristic.value) {
1779
- sirenAwayOnCharacteristic.updateValue(false);
1780
- this.log.debug("Siren Away Switch (Off)");
1778
+ if (tripAwayOnCharacteristic.value) {
1779
+ tripAwayOnCharacteristic.updateValue(false);
1780
+ this.log.debug("Trip Away Switch (Off)");
1781
1781
  }
1782
1782
 
1783
- if (sirenNightOnCharacteristic.value) {
1784
- sirenNightOnCharacteristic.updateValue(false);
1785
- this.log.debug("Siren Night Switch (Off)");
1783
+ if (tripNightOnCharacteristic.value) {
1784
+ tripNightOnCharacteristic.updateValue(false);
1785
+ this.log.debug("Trip Night Switch (Off)");
1786
1786
  }
1787
1787
 
1788
- if (sirenOverrideOnCharacteristic.value) {
1789
- sirenOverrideOnCharacteristic.updateValue(false);
1790
- this.log.debug("Siren Override Switch (Off)");
1788
+ if (tripOverrideOnCharacteristic.value) {
1789
+ tripOverrideOnCharacteristic.updateValue(false);
1790
+ this.log.debug("Trip Override Switch (Off)");
1791
1791
  }
1792
1792
  };
1793
1793
 
@@ -1805,25 +1805,25 @@ SecuritySystem.prototype.triggerIfModeSet = function (
1805
1805
  this.currentState === switchRequiredState ||
1806
1806
  (this.targetState === switchRequiredState && isCurrentStateAlarmTriggered)
1807
1807
  ) {
1808
- this.updateSiren(value, originTypes.REGULAR_SWITCH, false, callback);
1808
+ this.updateTripSwitch(value, originTypes.REGULAR_SWITCH, false, callback);
1809
1809
  } else {
1810
- this.log.debug("Siren (Mode switch not set)");
1810
+ this.log.debug("Trip (Mode not set)");
1811
1811
  callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
1812
1812
  }
1813
1813
  } else {
1814
- this.updateSiren(value, originTypes.REGULAR_SWITCH, false, callback);
1814
+ this.updateTripSwitch(value, originTypes.REGULAR_SWITCH, false, callback);
1815
1815
  }
1816
1816
  };
1817
1817
 
1818
- SecuritySystem.prototype.getSirenHomeSwitch = function (callback) {
1819
- const value = this.sirenHomeSwitchService.getCharacteristic(
1818
+ SecuritySystem.prototype.getTripHomeSwitch = function (callback) {
1819
+ const value = this.tripHomeSwitchService.getCharacteristic(
1820
1820
  Characteristic.On
1821
1821
  ).value;
1822
1822
  callback(null, value);
1823
1823
  };
1824
1824
 
1825
- SecuritySystem.prototype.setSirenHomeSwitch = function (value, callback) {
1826
- this.log.debug("Siren Home Switch (On)");
1825
+ SecuritySystem.prototype.setTripHomeSwitch = function (value, callback) {
1826
+ this.log.debug("Trip Home Switch (On)");
1827
1827
  this.triggerIfModeSet(
1828
1828
  Characteristic.SecuritySystemCurrentState.STAY_ARM,
1829
1829
  value,
@@ -1831,15 +1831,15 @@ SecuritySystem.prototype.setSirenHomeSwitch = function (value, callback) {
1831
1831
  );
1832
1832
  };
1833
1833
 
1834
- SecuritySystem.prototype.getSirenAwaySwitch = function (callback) {
1835
- const value = this.sirenAwaySwitchService.getCharacteristic(
1834
+ SecuritySystem.prototype.getTripAwaySwitch = function (callback) {
1835
+ const value = this.tripAwaySwitchService.getCharacteristic(
1836
1836
  Characteristic.On
1837
1837
  ).value;
1838
1838
  callback(null, value);
1839
1839
  };
1840
1840
 
1841
- SecuritySystem.prototype.setSirenAwaySwitch = function (value, callback) {
1842
- this.log.debug("Siren Away Switch (On)");
1841
+ SecuritySystem.prototype.setTripAwaySwitch = function (value, callback) {
1842
+ this.log.debug("Trip Away Switch (On)");
1843
1843
  this.triggerIfModeSet(
1844
1844
  Characteristic.SecuritySystemCurrentState.AWAY_ARM,
1845
1845
  value,
@@ -1847,15 +1847,15 @@ SecuritySystem.prototype.setSirenAwaySwitch = function (value, callback) {
1847
1847
  );
1848
1848
  };
1849
1849
 
1850
- SecuritySystem.prototype.getSirenNightSwitch = function (callback) {
1851
- const value = this.sirenNightSwitchService.getCharacteristic(
1850
+ SecuritySystem.prototype.getTripNightSwitch = function (callback) {
1851
+ const value = this.tripNightSwitchService.getCharacteristic(
1852
1852
  Characteristic.On
1853
1853
  ).value;
1854
1854
  callback(null, value);
1855
1855
  };
1856
1856
 
1857
- SecuritySystem.prototype.setSirenNightSwitch = function (value, callback) {
1858
- this.log.debug("Siren Night Switch (On)");
1857
+ SecuritySystem.prototype.setTripNightSwitch = function (value, callback) {
1858
+ this.log.debug("Trip Night Switch (On)");
1859
1859
  this.triggerIfModeSet(
1860
1860
  Characteristic.SecuritySystemCurrentState.NIGHT_ARM,
1861
1861
  value,
@@ -2248,53 +2248,53 @@ SecuritySystem.prototype.setAudioSwitch = function (value, callback) {
2248
2248
  callback(null);
2249
2249
  };
2250
2250
 
2251
- // Siren Tripped Motion Sensor
2252
- SecuritySystem.prototype.getSirenTrippedMotionDetected = function (callback) {
2253
- const value = this.sirenTrippedMotionSensorService.getCharacteristic(
2251
+ // Tripped Motion Sensor
2252
+ SecuritySystem.prototype.getTrippedMotionDetected = function (callback) {
2253
+ const value = this.trippedMotionSensorService.getCharacteristic(
2254
2254
  Characteristic.MotionDetected
2255
2255
  ).value;
2256
2256
  callback(null, value);
2257
2257
  };
2258
2258
 
2259
- SecuritySystem.prototype.updateSirenTrippedMotionDetected = function () {
2260
- this.sirenTrippedMotionSensorService.updateCharacteristic(
2259
+ SecuritySystem.prototype.updateTrippedMotionDetected = function () {
2260
+ this.trippedMotionSensorService.updateCharacteristic(
2261
2261
  Characteristic.MotionDetected,
2262
2262
  true
2263
2263
  );
2264
2264
 
2265
2265
  setTimeout(() => {
2266
- this.sirenTrippedMotionSensorService.updateCharacteristic(
2266
+ this.trippedMotionSensorService.updateCharacteristic(
2267
2267
  Characteristic.MotionDetected,
2268
2268
  false
2269
2269
  );
2270
2270
  }, 750);
2271
2271
  };
2272
2272
 
2273
- // Siren Triggered Motion Sensor
2274
- SecuritySystem.prototype.getSirenTriggeredMotionDetected = function (callback) {
2275
- const value = this.sirenTriggeredMotionSensorService.getCharacteristic(
2273
+ // Triggered Motion Sensor
2274
+ SecuritySystem.prototype.getTriggeredMotionDetected = function (callback) {
2275
+ const value = this.triggeredMotionSensorService.getCharacteristic(
2276
2276
  Characteristic.MotionDetected
2277
2277
  ).value;
2278
2278
  callback(null, value);
2279
2279
  };
2280
2280
 
2281
- SecuritySystem.prototype.updateSirenTriggeredMotionDetected = function () {
2282
- this.sirenTriggeredMotionSensorService.updateCharacteristic(
2281
+ SecuritySystem.prototype.updateTriggeredMotionDetected = function () {
2282
+ this.triggeredMotionSensorService.updateCharacteristic(
2283
2283
  Characteristic.MotionDetected,
2284
2284
  true
2285
2285
  );
2286
2286
 
2287
2287
  setTimeout(() => {
2288
- this.sirenTriggeredMotionSensorService.updateCharacteristic(
2288
+ this.triggeredMotionSensorService.updateCharacteristic(
2289
2289
  Characteristic.MotionDetected,
2290
2290
  false
2291
2291
  );
2292
2292
  }, 750);
2293
2293
  };
2294
2294
 
2295
- // Siren Reset Motion Sensor
2296
- SecuritySystem.prototype.getSirenResetMotionDetected = function (callback) {
2297
- const value = this.sirenResetMotionSensorService.getCharacteristic(
2295
+ // Triggered Reset Motion Sensor
2296
+ SecuritySystem.prototype.getTriggeredResetMotionDetected = function (callback) {
2297
+ const value = this.triggeredResetMotionSensorService.getCharacteristic(
2298
2298
  Characteristic.MotionDetected
2299
2299
  ).value;
2300
2300
  callback(null, value);
@@ -32,20 +32,20 @@ const options = {
32
32
  options.armingLockSwitch = config.arming_lock_switch;
33
33
  options.armingLockSwitches = config.arming_lock_switches;
34
34
 
35
- // Siren switches
36
- options.sirenSwitch = config.siren_switch;
37
- options.sirenOverrideSwitch = config.siren_override_switch;
38
- options.sirenModeSwitches = config.siren_mode_switches;
35
+ // Trip switches
36
+ options.tripSwitch = config.siren_switch;
37
+ options.tripOverrideSwitch = config.siren_override_switch;
38
+ options.tripModeSwitches = config.siren_mode_switches;
39
39
 
40
- // Tripped sensor
41
- options.trippedSensor = config.tripped_sensor;
42
- options.trippedSensorSeconds = config.tripped_sensor_seconds;
40
+ // Tripped motion sensor
41
+ options.trippedMotionSensor = config.tripped_sensor;
42
+ options.trippedMotionSensorSeconds = config.tripped_sensor_seconds;
43
43
 
44
- // Siren sensor
45
- options.sirenSensor = config.siren_sensor;
46
- options.sirenSensorSeconds = config.siren_sensor_seconds;
44
+ // Triggered motion sensor
45
+ options.triggeredMotionSensor = config.siren_sensor;
46
+ options.triggeredMotionSensorSeconds = config.siren_sensor_seconds;
47
47
 
48
- // Reset sensor
48
+ // Reset motion sensor
49
49
  options.resetSensor = config.reset_sensor;
50
50
 
51
51
  // Mode switches
@@ -194,13 +194,13 @@ const options = {
194
194
  options.trippedSensorSeconds = 5;
195
195
  }
196
196
 
197
- // Siren sensor
198
- if (options.isValueSet(options.sirenSensor) === false) {
199
- options.sirenSensor = false;
197
+ // Tripped sensor
198
+ if (options.isValueSet(options.trippedMotionSensor) === false) {
199
+ options.trippedMotionSensor = false;
200
200
  }
201
201
 
202
- if (options.isValueSet(options.sirenSensorSeconds) === false) {
203
- options.sirenSensorSeconds = 5;
202
+ if (options.isValueSet(options.triggeredMotionSensorSeconds) === false) {
203
+ options.triggeredMotionSensorSeconds = 5;
204
204
  }
205
205
 
206
206
  // Arming lock switch
@@ -208,17 +208,17 @@ const options = {
208
208
  options.armingLockSwitch = false;
209
209
  }
210
210
 
211
- // Siren switches
212
- if (options.isValueSet(options.sirenSwitch) === false) {
213
- options.sirenSwitch = false;
211
+ // Trip switches
212
+ if (options.isValueSet(options.tripSwitch) === false) {
213
+ options.tripSwitch = false;
214
214
  }
215
215
 
216
- if (options.isValueSet(options.sirenOverrideSwitch) === false) {
217
- options.sirenOverrideSwitch = false;
216
+ if (options.isValueSet(options.tripOverrideSwitch) === false) {
217
+ options.tripOverrideSwitch = false;
218
218
  }
219
219
 
220
- if (options.isValueSet(options.sirenModeSwitches) === false) {
221
- options.sirenModeSwitches = true;
220
+ if (options.isValueSet(options.tripModeSwitches) === false) {
221
+ options.tripModeSwitches = true;
222
222
  }
223
223
 
224
224
  // Reset sensor