homebridge-ratgdo 0.2.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +7 -3
- package/config.schema.json +46 -14
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/ratgdo-device.d.ts +44 -0
- package/dist/ratgdo-device.js +447 -103
- package/dist/ratgdo-device.js.map +1 -1
- package/dist/ratgdo-mqtt.d.ts +19 -0
- package/dist/ratgdo-mqtt.js +155 -0
- package/dist/ratgdo-mqtt.js.map +1 -0
- package/dist/ratgdo-options.d.ts +27 -0
- package/dist/ratgdo-options.js +26 -21
- package/dist/ratgdo-options.js.map +1 -1
- package/dist/ratgdo-platform.d.ts +28 -0
- package/dist/ratgdo-platform.js +64 -30
- package/dist/ratgdo-platform.js.map +1 -1
- package/dist/ratgdo-types.d.ts +17 -0
- package/dist/ratgdo-types.js +14 -0
- package/dist/ratgdo-types.js.map +1 -0
- package/dist/settings.d.ts +8 -0
- package/dist/settings.js +14 -13
- package/dist/settings.js.map +1 -1
- package/homebridge-ui/public/index.html +113 -0
- package/homebridge-ui/public/lib/featureoptions.mjs +200 -0
- package/homebridge-ui/public/ratgdo-featureoptions.mjs +638 -0
- package/homebridge-ui/public/ui.mjs +144 -0
- package/homebridge-ui/server.js +58 -0
- package/package.json +13 -9
package/LICENSE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Internet Systems Consortium license
|
|
2
2
|
===================================
|
|
3
3
|
|
|
4
|
-
Copyright (c) `
|
|
4
|
+
Copyright (c) `2017-2024`, `HJD https://github.com/hjdhjd`
|
|
5
5
|
|
|
6
6
|
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
7
7
|
with or without fee is hereby granted, provided that the above copyright notice
|
package/README.md
CHANGED
|
@@ -19,14 +19,18 @@ In a nutshell, the aim of this plugin for things to *just work* with minimal req
|
|
|
19
19
|
|
|
20
20
|
What does *just work* mean in practice? It means that this plugin will discover all your Ratgdo devices without the need for additional configuration beyond telling the Ratgdo device about `homebridge-ratgdo`.
|
|
21
21
|
|
|
22
|
-
**I rely on this plugin every day and actively maintain and support it
|
|
22
|
+
**I rely on this plugin every day and actively maintain and support it.**
|
|
23
23
|
|
|
24
|
-
In the interest of the community seeking a solution outside of myQ, I'
|
|
24
|
+
In the interest of the community seeking a solution outside of myQ, I've developed a full-featured Homebridge plugin that enables the following features:
|
|
25
25
|
|
|
26
26
|
* Control of the garage door opener. This includes, for those that have always wanted the feature, the ability to close the garage door without the requisite safety warning and delay that Chamberlain and Liftmaster garage door openers emit when being controlled remotely.
|
|
27
27
|
* A motion sensor when it's available.
|
|
28
28
|
* Control of the light attached to the garage door opener, when available.
|
|
29
29
|
* Obstruction detection.
|
|
30
|
+
* Occupancy sensor support.
|
|
31
|
+
* Read-only garage door opener support.
|
|
32
|
+
* Automation switch support.
|
|
33
|
+
* A rich webUI for configuration.
|
|
30
34
|
|
|
31
35
|
## Getting Started
|
|
32
36
|
To get started with `homebridge-ratgdo`:
|
|
@@ -35,7 +39,7 @@ To get started with `homebridge-ratgdo`:
|
|
|
35
39
|
* [Carefully](#known-caveats) edit the MQTT server and port on your Ratgdo device to the IP address of your Homebridge server, and port 18830 (unless you've changed the default port in `homebridge-ratgdo`).
|
|
36
40
|
|
|
37
41
|
## Known Caveats
|
|
38
|
-
Ratgdo is a terrific solution that solves a problem for many stranded former myQ users and others. There are some quirks and caveats to note, however. As of Ratgdo firmware v2.
|
|
42
|
+
Ratgdo is a terrific solution that solves a problem for many stranded former myQ users and others. There are some quirks and caveats to note, however. As of Ratgdo firmware v2.57:
|
|
39
43
|
|
|
40
44
|
* Misconfiguring your MQTT server IP or port number in any way **will** lock up / brick the Ratgdo. The only fix for this I've discovered is to reflash the Ratgdo and don't misconfigure it the next time around.
|
|
41
45
|
* Ratgdo currently has no useful way to query it's state over MQTT. That means that on startup, the state of the garage door opener in Homebridge / HomeKit will be unknowable. Given that challenge, `homebridge-ratgdo` will assume the garage door opener is closed on startup. Once an action is taken, the state of the garage door opener will be accurately reflected in Homebridge / HomeKit. There is technically a *query* command available through the MQTT interface to Ratgdo, but all that currently does is to set the Ratgdo state information to an unknown state, awaiting the next state update from the garage door opener, rather than actually publish the current state, which is really what we need.
|
package/config.schema.json
CHANGED
|
@@ -2,21 +2,35 @@
|
|
|
2
2
|
"pluginAlias": "Ratgdo",
|
|
3
3
|
"pluginType": "platform",
|
|
4
4
|
"singular": true,
|
|
5
|
-
"customUi":
|
|
5
|
+
"customUi": true,
|
|
6
6
|
"headerDisplay": "[homebridge-ratgdo](https://github.com/hjdhjd/homebridge-ratgdo) provides HomeKit support to Chamberlain and Liftmaster garage door openers that use the Ratgdo hardware control board without using myQ. This version is a beta and should not be relied upon daily.",
|
|
7
7
|
"footerDisplay": "See the [homebridge-ratgdo developer page](https://github.com/hjdhjd/homebridge-ratgdo) for detailed documentation, including [feature options](https://github.com/hjdhjd/homebridge-ratgdo#feature-options). This version is a beta and should not be relied upon daily.",
|
|
8
8
|
"schema": {
|
|
9
9
|
"type": "object",
|
|
10
10
|
"properties": {
|
|
11
11
|
|
|
12
|
-
"
|
|
13
|
-
"title": "
|
|
14
|
-
"type": "
|
|
15
|
-
"placeholder": "e.g. 18830",
|
|
16
|
-
"minimum": 1024,
|
|
17
|
-
"maximum": 65535,
|
|
12
|
+
"debug": {
|
|
13
|
+
"title": "Debug Logging",
|
|
14
|
+
"type": "boolean",
|
|
18
15
|
"required": false,
|
|
19
|
-
"description": "
|
|
16
|
+
"description": "Logging verbosity for debugging. Default: false."
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
"mqttTopic": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"title": "MQTT Base Topic",
|
|
22
|
+
"required": false,
|
|
23
|
+
"placeholder": "e.g. ratgdo",
|
|
24
|
+
"description": "The base MQTT topic to publish to. Default: ratgdo."
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
"mqttUrl": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"title": "MQTT Broker URL",
|
|
30
|
+
"required": false,
|
|
31
|
+
"format": "uri",
|
|
32
|
+
"placeholder": "e.g. mqtt://1.2.3.4",
|
|
33
|
+
"description": "URL for the MQTT broker you'd like to publish event messages to. Default: None."
|
|
20
34
|
},
|
|
21
35
|
|
|
22
36
|
"name": {
|
|
@@ -40,13 +54,15 @@
|
|
|
40
54
|
}
|
|
41
55
|
},
|
|
42
56
|
|
|
43
|
-
"
|
|
44
|
-
"title": "
|
|
45
|
-
"type": "
|
|
57
|
+
"port": {
|
|
58
|
+
"title": "MQTT Broker Port",
|
|
59
|
+
"type": "number",
|
|
60
|
+
"placeholder": "e.g. 18830",
|
|
61
|
+
"minimum": 1024,
|
|
62
|
+
"maximum": 65535,
|
|
46
63
|
"required": false,
|
|
47
|
-
"description": "
|
|
64
|
+
"description": "Set the port to use for the builtin MQTT broker. Ensure you set the Ratgdo hardware control board to use the same MQTT server port. Default: 18830"
|
|
48
65
|
}
|
|
49
|
-
|
|
50
66
|
}
|
|
51
67
|
},
|
|
52
68
|
|
|
@@ -68,7 +84,7 @@
|
|
|
68
84
|
|
|
69
85
|
{
|
|
70
86
|
"type": "section",
|
|
71
|
-
"title": "Plugin Feature Options
|
|
87
|
+
"title": "Plugin Feature Options",
|
|
72
88
|
"expandable": true,
|
|
73
89
|
"expanded": false,
|
|
74
90
|
"items": [
|
|
@@ -86,6 +102,22 @@
|
|
|
86
102
|
]
|
|
87
103
|
},
|
|
88
104
|
|
|
105
|
+
{
|
|
106
|
+
"type": "section",
|
|
107
|
+
"title": "MQTT Settings (Optional)",
|
|
108
|
+
"expandable": true,
|
|
109
|
+
"expanded": false,
|
|
110
|
+
"items": [
|
|
111
|
+
{
|
|
112
|
+
"description": "MQTT support will only be enabled if an MQTT broker URL is specified below.",
|
|
113
|
+
"items": [
|
|
114
|
+
"mqttUrl",
|
|
115
|
+
"mqttTopic"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
|
|
89
121
|
{
|
|
90
122
|
"type": "section",
|
|
91
123
|
"title": "Advanced Settings (Optional)",
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* Copyright(C) 2017-2023, HJD (https://github.com/hjdhjd). All rights reserved.
|
|
1
|
+
/* Copyright(C) 2017-2024, HJD (https://github.com/hjdhjd). All rights reserved.
|
|
4
2
|
*
|
|
5
3
|
* index.ts: homebridge-ratgdo plugin registration.
|
|
6
4
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { PLATFORM_NAME, PLUGIN_NAME } from "./settings.js";
|
|
6
|
+
import { RatgdoPlatform } from "./ratgdo-platform.js";
|
|
9
7
|
// Register our platform with homebridge.
|
|
10
|
-
|
|
11
|
-
api.registerPlatform(
|
|
8
|
+
export default (api) => {
|
|
9
|
+
api.registerPlatform(PLUGIN_NAME, PLATFORM_NAME, RatgdoPlatform);
|
|
12
10
|
};
|
|
13
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,yCAAyC;AACzC,eAAe,CAAC,GAAQ,EAAQ,EAAE;IAEhC,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;AACnE,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PlatformAccessory } from "homebridge";
|
|
2
|
+
import { RatgdoDevice, RatgdoLogging } from "./ratgdo-types.js";
|
|
3
|
+
import { RatgdoPlatform } from "./ratgdo-platform.js";
|
|
4
|
+
export declare class RatgdoAccessory {
|
|
5
|
+
private readonly accessory;
|
|
6
|
+
private readonly api;
|
|
7
|
+
private readonly config;
|
|
8
|
+
readonly device: RatgdoDevice;
|
|
9
|
+
private doorOccupancyTimer;
|
|
10
|
+
private doorTimer;
|
|
11
|
+
private readonly hap;
|
|
12
|
+
private readonly hints;
|
|
13
|
+
readonly log: RatgdoLogging;
|
|
14
|
+
private motionOccupancyTimer;
|
|
15
|
+
private motionTimer;
|
|
16
|
+
private obstructionTimer;
|
|
17
|
+
private readonly platform;
|
|
18
|
+
private readonly status;
|
|
19
|
+
constructor(platform: RatgdoPlatform, accessory: PlatformAccessory, device: RatgdoDevice);
|
|
20
|
+
private configureDevice;
|
|
21
|
+
private configureHints;
|
|
22
|
+
private configureInfo;
|
|
23
|
+
private configureMqtt;
|
|
24
|
+
private configureGarageDoor;
|
|
25
|
+
private configureLight;
|
|
26
|
+
private configureMotionSensor;
|
|
27
|
+
private configureAutomationSwitch;
|
|
28
|
+
private configureDoorOpenOccupancySensor;
|
|
29
|
+
private configureMotionOccupancySensor;
|
|
30
|
+
private setDoorState;
|
|
31
|
+
updateState(event: string, payload: string): void;
|
|
32
|
+
private translateCurrentDoorState;
|
|
33
|
+
private doorCurrentStateBias;
|
|
34
|
+
private doorTargetStateBias;
|
|
35
|
+
private lockTargetStateBias;
|
|
36
|
+
private command;
|
|
37
|
+
private getFeatureFloat;
|
|
38
|
+
private getFeatureNumber;
|
|
39
|
+
private hasFeature;
|
|
40
|
+
private setServiceName;
|
|
41
|
+
private get name();
|
|
42
|
+
private get accessoryName();
|
|
43
|
+
private set accessoryName(value);
|
|
44
|
+
}
|