Skip to content

Commit 5d8d8b7

Browse files
committed
Updated device support
### UPDATED - Improved `README.md` grammar and wording. - If "advanced options" were specified in the configuration, the list of enabled options will print out on the screen. ### FIXED - "Unknown Device Type" is now excluded from the sensors list since it does not show a status. ### ADDED - Partial documentation for "PowerSeries/PremisePro" security panels.
1 parent 2efa519 commit 5d8d8b7

File tree

6 files changed

+36
-34
lines changed

6 files changed

+36
-34
lines changed

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The API relies on the ADT Pulse Web Portal (powered by Icontrol One, owned by IC
1414
To use this plugin, here are three simple steps you need to follow:
1515
1. Run `npm install homebridge-adt-pulse`.
1616
2. Configure this plugin using this [sample](#configuration) for guidance.
17-
3. Restart Homebridge and see magic happen!
17+
3. Restart Homebridge and see the magic happen!
1818

1919
Another option is to search for `adt-pulse` using Onzu's [Homebridge Config UI](https://github.com/oznu/homebridge-config-ui-x). Afterward, you can proceed to configure this plugin through the configuration UI available in the "Plugins" tab.
2020

@@ -49,7 +49,7 @@ Here is an example of how the `config.json` file for this plugin should be confi
4949
]
5050
}
5151
```
52-
Ensure that you customize the values of `subdomain`, `username`, `password`, `fingerprint`, and `sensors` to match your specific setup. If you encounter any queries regarding the configuration, refer to the details provided below this section.
52+
Ensure that you customize the values with the example structure shown above to match your specific setup. If you encounter any queries regarding the configuration, refer to the details provided below this section.
5353

5454
## Supported Devices
5555
While named "ADT Pulse for Homebridge," this Homebridge plugin exclusively accommodates only the sensors listed below. It is important to note that this plugin does not serve as a comprehensive substitute for the [official ADT Pulse app](https://www.adt.com/help/faq/adt-pulse/adt-pulse-mobile-app).
@@ -75,8 +75,8 @@ Due to implementation complexity and platform instability, all Z-Wave accessorie
7575
## Specifying the Portal Region
7676
ADT Pulse is available to consumers in either the United States or Canada. To specify your country, use the following settings:
7777

78-
- If you are a United States customer, set the `subdomain` value to `"portal"`.
79-
- If you are a Canada customer, set the `subdomain` value to `"portal-ca"`.
78+
- If you are a customer in the United States, set the `subdomain` value to `"portal"`.
79+
- If you are a customer in Canada, set the `subdomain` value to `"portal-ca"`.
8080

8181
Select the appropriate setting based on your country, as the ability to switch between countries is determined by the ADT region you are subscribed to.
8282

@@ -124,14 +124,14 @@ The options provided give you the flexibility to deactivate specific aspects of
124124
- Include the `"ignoreSensorProblemStatus"` value in the `options` array.
125125
- ⚠️ Enabling this option will prevent you from being able to silence a ringing alarm triggered by a "Sensor Problem" or "Sensor Problems" status.
126126

127-
If the `options` array is not empty, a warning will be displayed upon every startup for every enabled option, and this warning cannot be disabled.
127+
If the `options` array is not empty (e.g. `[]`), a warning will be displayed upon every startup, and this warning cannot be disabled.
128128

129129
## Specifying the Sensors
130130
In the past, this plugin would automatically detect sensors and dynamically manage their addition and removal based on its observations.
131131

132132
However, this approach posed challenges. If the plugin failed to detect sensors or encountered portal irregularities, it could unintentionally remove all sensors, resulting in an inadvertent reset.
133133

134-
While a setting was introduced (prior to `v3.0.0`) to prevent the removal of obsolete zones, over time, it felt more like a workaround than a solution.
134+
While a setting was introduced (before `v3.0.0`) to prevent the removal of obsolete zones, over time, it felt more like a workaround than a solution.
135135

136136
In this updated version of the plugin, I have implemented a new requirement that users must explicitly specify each sensor they wish to integrate into Homebridge.
137137

@@ -146,7 +146,7 @@ All sensors are now organized within an array of objects, with each object conta
146146
- __ADT Zone__ (`adtZone`)
147147
- Must match the zone shown under the "Zone" column in the "System" tab when logged into the portal.
148148

149-
If you do not find the supported type listed, please note that the plugin will notify me. There's no need to create a separate issue on GitHub, as I am actively working on adding support as soon as I gather sufficient information to determine the statuses displayed on the portal.
149+
If you do not find the supported type listed, please note that the plugin will notify me. Do not create a separate issue on GitHub. I am actively working on adding support as soon as I gather sufficient information to determine the statuses displayed on the portal.
150150

151151
Your patience is appreciated as I address and incorporate the necessary updates.
152152

@@ -159,13 +159,11 @@ If you are concerned about this, please read the instructions below to check the
159159
2. Tap the dotted circle (`...`) (located on the top right of the screen)
160160
3. View the sensors that require attention and resolve those issues
161161

162-
If you are using automation, __you acknowledge that this will happen__ and accept the risks for the system not completely arming the system.
162+
If you have set up automation, __you acknowledge that this will happen__ and accept the risks of the system not completely arming itself.
163163

164164
## Arm Night Support
165165
As for ADT Pulse systems, __Arm Night__ is only available for use through the panel itself. Although it is not visible on the Web Portal or the mobile app, you can still place your system in __Arm Night__ mode with this plugin.
166166

167-
__Note:__ A workaround has been implemented to address portal issues preventing the completion of the "Arm Night" action. If you encounter warnings related to this, you can safely disregard them.
168-
169167
## Debug Mode
170168
Previously, there was a setting to allow users to switch the plugin to debug mode. Over time, it became apparent that this setting made resolving issues excessively challenging.
171169

@@ -176,8 +174,8 @@ To improve this, debug mode is now activated __ONLY when debug mode is enabled o
176174
## API Test and REPL Playground Scripts
177175
If any unusual occurrences arise, utilize the provided `test-api` or `repl` commands within this plugin to troubleshoot potential issues.
178176

179-
- To confirm if the plugin is communicating with the portal correctly, use the command `npm run test-api`.
180-
- To access the playground (Read-eval-print loop mode), use the command `npm run repl`.
177+
- To confirm if the plugin is communicating with the portal correctly, use the `npm run test-api` command.
178+
- To access the playground (Read-eval-print loop mode), use the `npm run repl` command.
181179

182180
Ensure you are inside the `node_modules/homebridge-adt-pulse` directory when attempting to access these commands. The location of `node_modules` may vary based on the system you are using:
183181
- [Raspbian](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian#configuration-reference)
@@ -199,7 +197,7 @@ In contrast to typical contact sensors that convey open or closed status, the te
199197
- Abnormal temperatures are represented as __100°C__.
200198

201199
## Support for HOOBS
202-
Please note that HOOBS may use an outdated configuration UI. This issue that was reported by me, remains unresolved by the HOOBS team. For additional details, refer to this [GitHub issue](https://github.com/hoobs-org/HOOBS/issues/1873).
200+
Please note that HOOBS may use an outdated configuration UI. This issue that I reported, remains unresolved by the HOOBS team. For additional details, refer to this [GitHub issue](https://github.com/hoobs-org/HOOBS/issues/1873).
203201

204202
In the interim, HOOBS users should manually configure the plugin using the [sample configuration](#configuration) provided above. For those technically inclined, consider replacing the HOOBS software with [Homebridge](https://github.com/homebridge/homebridge/wiki).
205203

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "homebridge-adt-pulse",
33
"displayName": "Homebridge ADT Pulse",
4-
"version": "3.1.0",
4+
"version": "3.1.1",
55
"description": "Homebridge security system platform for ADT Pulse",
66
"main": "./build/index.js",
77
"exports": "./build/index.js",

src/lib/api.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ export class ADTPulse {
866866
*/
867867
await this.newInformationDispatcher('gateway-information', gatewayInformation);
868868

869+
// TODO Need a more permanent way and safer way to determine gateway model.
869870
// If the parsing function may be parsing data incorrectly.
870871
if (
871872
Object.keys(fetchedTableCells).length !== 10 // Lynx/QuickConnect Cellular-Only Gateway / Cellular Mode.
@@ -879,7 +880,7 @@ export class ADTPulse {
879880

880881
await this.newInformationDispatcher('debug-parser', {
881882
parserName: 'fetchTableCells()',
882-
parserReason: 'length does not match 11 or 18',
883+
parserReason: 'length does not match 10, 11, 17, and 18',
883884
parserResponse: fetchedTableCells,
884885
rawData: sessions.axiosSystemGateway.data,
885886
});
@@ -940,6 +941,9 @@ export class ADTPulse {
940941
}),
941942
);
942943

944+
// TODO Check for 500 Internal Server Error (add it to every API method).
945+
// TODO sessions.axiosSystemDeviceId1.status
946+
943947
// If the "ClientRequest" object does not exist in the Axios response.
944948
if (typeof sessions.axiosSystemDeviceId1?.request === 'undefined') {
945949
if (this.#internal.debug) {
@@ -1083,9 +1087,11 @@ export class ADTPulse {
10831087
*/
10841088
await this.newInformationDispatcher('panel-information', panelInformation);
10851089

1090+
// TODO Need a more permanent way and safer way to determine panel status.
10861091
// If the parsing function may be parsing data incorrectly.
10871092
if (
1088-
Object.keys(fetchedTableCells).length !== 4 // Impassa SCW9057.
1093+
Object.keys(fetchedTableCells).length !== 3 // PowerSeries/PremisePro.
1094+
&& Object.keys(fetchedTableCells).length !== 4 // Impassa SCW9057.
10891095
&& Object.keys(fetchedTableCells).length !== 5 // Safewatch Pro 3000/3000CN.
10901096
) {
10911097
if (this.#internal.debug) {
@@ -1094,7 +1100,7 @@ export class ADTPulse {
10941100

10951101
await this.newInformationDispatcher('debug-parser', {
10961102
parserName: 'fetchTableCells()',
1097-
parserReason: 'length does not match 4 or 5',
1103+
parserReason: 'length does not match 3, 4, and 5',
10981104
parserResponse: fetchedTableCells,
10991105
rawData: sessions.axiosSystemDeviceId1.data,
11001106
});
@@ -3168,7 +3174,7 @@ export class ADTPulse {
31683174

31693175
await this.newInformationDispatcher('debug-parser', {
31703176
parserName: 'parseDoSubmitHandlers()',
3171-
parserReason: 'length does not match 0 or 2',
3177+
parserReason: 'length does not match 0 and 2',
31723178
parserResponse: parsedDoSubmitHandlers,
31733179
rawData: response.data,
31743180
});

src/lib/platform.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,10 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
314314
this.#constants.intervalTimestamps.synchronize *= (1 / this.#config.speed);
315315
}
316316

317-
// If the config specifies that the plugin should disable the "Alarm Ringing" switch.
318-
if (this.#config.options.includes('disableAlarmRingingSwitch')) {
319-
this.#log.warn('Plugin accessory for "Alarm Ringing" is disabled. You will NOT be able to silence a ringing alarm when the system is in "Disarmed" mode.');
320-
}
321-
322-
// If the config specifies that the plugin should ignore "Sensor Problem" and "Sensor Problems" statuses.
323-
if (this.#config.options.includes('ignoreSensorProblemStatus')) {
324-
this.#log.warn('Plugin ignoring "Sensor Problem" and "Sensor Problems" statuses. You will not be able to silence a ringing alarm triggered by a "Sensor Problem" or "Sensor Problems" status.');
317+
// If the config specifies that the plugin should apply the advanced options.
318+
if (this.#config.options.length > 0) {
319+
this.#log.warn('Plugin will apply the advanced options saved in the configuration. You may see some loss in functionality.');
320+
stackTracer('config-content', this.#config.options);
325321
}
326322

327323
// Initialize the API instance.

src/lib/utility.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ export function parseSensorsTable(elements: ParseOrbSensorsTableElements): Parse
12061206
const cleanedZone = Number(clearWhitespace(zoneText));
12071207

12081208
// These devices are not supported because they do not display a status in the summary page.
1209-
if (['System/Supervisory'].includes(cleanedDeviceType)) {
1209+
if (['System/Supervisory', 'Unknown Device Type'].includes(cleanedDeviceType)) {
12101210
return;
12111211
}
12121212

@@ -1328,6 +1328,7 @@ export function stackTracer(type: StackTracerType, error: StackTracerError<Stack
13281328

13291329
switch (type) {
13301330
case 'api-response':
1331+
case 'config-content':
13311332
case 'detect-content':
13321333
case 'fake-ready-buttons':
13331334
case 'log-status-changes':

src/types/index.d.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,15 +1892,16 @@ export type SleepReturns = Promise<void>;
18921892
*
18931893
* @since 1.0.0
18941894
*/
1895-
export type StackTracerType = 'api-response' | 'detect-content' | 'fake-ready-buttons' | 'log-status-changes' | 'serialize-error' | 'zod-error';
1895+
export type StackTracerType = 'api-response' | 'config-content' | 'detect-content' | 'fake-ready-buttons' | 'log-status-changes' | 'serialize-error' | 'zod-error';
18961896

18971897
export type StackTracerError<Type extends StackTracerType> =
18981898
Type extends 'api-response' ? ApiResponseFail<any>
1899-
: Type extends 'detect-content' ? Record<string, unknown> | Record<string, unknown>[]
1900-
: Type extends 'fake-ready-buttons' ? { before: OrbSecurityButtons; after: OrbSecurityButtonBase & OrbSecurityButtonReady; }
1901-
: Type extends 'log-status-changes' ? { old: SensorInformation[]; new: SensorInformation[]; }
1902-
: Type extends 'serialize-error' ? ErrorObject
1903-
: Type extends 'zod-error' ? z.ZodIssue[]
1904-
: never;
1899+
: Type extends 'config-content' ? unknown
1900+
: Type extends 'detect-content' ? Record<string, unknown> | Record<string, unknown>[]
1901+
: Type extends 'fake-ready-buttons' ? { before: OrbSecurityButtons; after: OrbSecurityButtonBase & OrbSecurityButtonReady; }
1902+
: Type extends 'log-status-changes' ? { old: SensorInformation[]; new: SensorInformation[]; }
1903+
: Type extends 'serialize-error' ? ErrorObject
1904+
: Type extends 'zod-error' ? z.ZodIssue[]
1905+
: never;
19051906

19061907
export type StackTracerReturns = void;

0 commit comments

Comments
 (0)