homebridge-loxone-proxy 2.0.0-beta.7 → 2.0.0-beta.9
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/ARCHITECTURE.md +26 -27
- package/README.md +50 -42
- package/package.json +1 -1
package/ARCHITECTURE.md
CHANGED
|
@@ -4,41 +4,40 @@ This plugin has one product boundary: Loxone <-> HomeKit. The architecture is op
|
|
|
4
4
|
|
|
5
5
|
## Layers
|
|
6
6
|
|
|
7
|
-
| Layer | Owns | Must not own |
|
|
8
|
-
| --- | --- | --- |
|
|
9
|
-
| `
|
|
10
|
-
|
|
|
11
|
-
| `
|
|
12
|
-
| `
|
|
13
|
-
|
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
|
|
|
17
|
-
| `
|
|
7
|
+
| Layer | Module(s) | Owns | Must not own |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| Platform | `LoxonePlatform`, `index.ts` | Homebridge lifecycle, the accessory cache list, the name registry, exposing HAP `Service`/`Characteristic`. | Loxone protocol details or item semantics. |
|
|
10
|
+
| Loxone transport | [`loxone-ts-client`](https://www.npmjs.com/package/loxone-ts-client) (external dependency) | All Miniserver communication: websocket, token auth, Structure File parsing, encrypted commands, state subscriptions, and the typed room/control model. | HomeKit concepts. |
|
|
11
|
+
| Binding coordinator | `LoxoneBindingCoordinator` | Connection orchestration, per-room control discovery, accessory planning, reconciliation (create/update/restore/remove), routing accessories to the main or a per-room bridge, room/type filtering, central-room handling. | HAP characteristic specifics — it delegates those. |
|
|
12
|
+
| Control routing | `ControlBinders` (`CONTROL_BINDERS`, `COMPOSITE_BINDERS`) | Mapping each Loxone control `type` to a `PlannedAccessory` (which HomeKit service(s) and which bindings). | Talking to the Miniserver. |
|
|
13
|
+
| Binding tables | `binding/tables/*Bindings.ts` | Declarative characteristic ⇄ state/command bindings per control family (lighting, covering, fan, sensor, thermostat, alarm, radio, switch, pushbutton, mood, contact, smoke). | Imperative service construction. |
|
|
14
|
+
| Binding engine | `BindingEngine.bindCharacteristics`, `CharacteristicBinding`, `ServiceResolver` | Applying a binding: wiring a HAP characteristic to a control's Loxone state (`handle.onState`) and command (`handle.send`). | Inventing command strings or reaching past the typed handle. |
|
|
15
|
+
| Complex binders | `binding/binders/*` | Imperative wiring for controls that are not a simple table: `intercom` (+ HKSV), `nfcCodeTouch`, `irrigation`, `color`. | Generic command/state rules where a table suffices. |
|
|
16
|
+
| Per-room publishing | `RoomBridgePublisher` | One HAP `Bridge` per room, deterministic pairing identity, and the manifest the config UI reads. | Loxone semantics. |
|
|
17
|
+
| Naming | `AccessoryNameRegistry` | Clean, unique, HAP-safe, UUID-stable accessory names. | — |
|
|
18
|
+
| Media | `homekit/hksv/*`, `homekit/services/*` | Camera streaming, HKSV recording + prebuffer, doorbell, motion, WebRTC talkback. | Generic command/state routing. |
|
|
18
19
|
|
|
19
20
|
## Command And State Rules
|
|
20
21
|
|
|
21
|
-
- Loxone
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- Item classes must not call `LoxoneHandler.sendCommand()` directly.
|
|
27
|
-
- HomeKit service classes must not call `LoxoneHandler` or `LoxoneTransport` directly.
|
|
22
|
+
- A control's HomeKit shape, its Loxone state UUIDs, and its commands live in the declarative binding tables (or in a binder, for complex controls).
|
|
23
|
+
- Bindings reach the Miniserver only through the typed `ControlHandle` from `loxone-ts-client`: read state via `handle.state(...)` / `handle.onState(...)`, send via `handle.send(...)`.
|
|
24
|
+
- The plugin has no hand-rolled command bus or state router; the library's typed handles own subscription and dispatch. Do not re-implement that layer.
|
|
25
|
+
- Binders and tables must not reach into the raw `loxone-ts-client` client/transport directly — go through the control handle.
|
|
26
|
+
- HomeKit service code must not talk to the transport directly.
|
|
28
27
|
|
|
29
28
|
## Transport Boundary
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
`loxone-ts-client` is a separately published, independently versioned npm package. It owns every Loxone protocol concern and exposes typed control handles, a room view, and Miniserver discovery. This plugin depends on it and adds only the HomeKit binding layer, which keeps the boundary clean:
|
|
32
31
|
|
|
33
32
|
- tests can run without a Miniserver;
|
|
34
|
-
-
|
|
35
|
-
- transport behavior can evolve in `loxone-ts-
|
|
33
|
+
- the binding coordinator stays independent of concrete protocol event shapes;
|
|
34
|
+
- transport behavior can evolve in `loxone-ts-client` without leaking into HomeKit mapping code.
|
|
36
35
|
|
|
37
|
-
## Intercom Boundary
|
|
36
|
+
## Intercom & Media Boundary
|
|
38
37
|
|
|
39
|
-
Intercom and IntercomV2 are intentionally
|
|
38
|
+
Intercom and IntercomV2 are intentionally a separate bounded context. They include HKSV, WebRTC signaling, prebuffering, talkback, camera streams, and Miniserver token use — flows that are not the same as normal command/state accessories. They live in `homekit/hksv/*` and `homekit/services/*`, wired up by `binding/binders/intercomBinder.ts`.
|
|
40
39
|
|
|
41
|
-
The command/state architecture
|
|
40
|
+
The command/state architecture still plans the regular Doorbell/Camera/MotionSensor accessory where useful, but the media and signaling code stays isolated from the generic binding tables and the `ControlHandle` command/state rules.
|
|
42
41
|
|
|
43
42
|
## Release Rules
|
|
44
43
|
|
|
@@ -50,12 +49,12 @@ Versioning is owned by semantic-release. Use conventional commits:
|
|
|
50
49
|
| `feat: ...` | minor |
|
|
51
50
|
| `refactor!: ...` plus `BREAKING CHANGE: ...` footer | major |
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
Example of a breaking footer:
|
|
54
53
|
|
|
55
54
|
```text
|
|
56
|
-
refactor!:
|
|
55
|
+
refactor!: rebuild on a declarative binding engine over loxone-ts-client
|
|
57
56
|
|
|
58
|
-
BREAKING CHANGE: requires Node.js
|
|
57
|
+
BREAKING CHANGE: requires Node.js 22 and replaces lxcommunicator with loxone-ts-client.
|
|
59
58
|
```
|
|
60
59
|
|
|
61
60
|
The `beta` branch publishes prereleases. The `master` branch publishes stable releases.
|
package/README.md
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit.
|
|
10
10
|
|
|
11
|
-
The plugin uses [
|
|
11
|
+
The plugin uses [`loxone-ts-client`](https://www.npmjs.com/package/loxone-ts-client) to set up and maintain the connection to a Loxone Miniserver.
|
|
12
12
|
It retrieves the Loxone [Structure-File](https://www.loxone.com/wp-content/uploads/datasheets/StructureFile.pdf) and maps supported controls to HomeKit accessories. The connection allows realtime two-way updates between Loxone and HomeKit.
|
|
13
13
|
|
|
14
14
|
# Requirements
|
|
15
15
|
|
|
16
16
|
| Requirement | Version |
|
|
17
17
|
| --- | --- |
|
|
18
|
-
| Node.js |
|
|
18
|
+
| Node.js | 22 or newer |
|
|
19
19
|
| Homebridge | 1.7.0 or newer, including Homebridge 2 beta |
|
|
20
20
|
|
|
21
21
|
# Architecture
|
|
@@ -24,7 +24,7 @@ This plugin is intentionally focused on one integration path: Loxone <-> HomeKit
|
|
|
24
24
|
|
|
25
25
|
| Layer | Responsibility |
|
|
26
26
|
| --- | --- |
|
|
27
|
-
| Loxone communication | Connects to the Miniserver through
|
|
27
|
+
| Loxone communication | Connects to the Miniserver through `loxone-ts-client`, loads the Structure File, subscribes to state updates, and sends commands. |
|
|
28
28
|
| Control mapping | Normalizes Loxone rooms, categories, controls, states, and command bindings into plugin-owned types. |
|
|
29
29
|
| Accessory planning | Converts each supported Loxone control into a declarative HomeKit accessory plan. |
|
|
30
30
|
| HomeKit reconciliation | Creates, updates, restores, and removes Homebridge platform accessories from those plans. |
|
|
@@ -32,22 +32,10 @@ This plugin is intentionally focused on one integration path: Loxone <-> HomeKit
|
|
|
32
32
|
|
|
33
33
|
Commands and states are kept separate on purpose. Item implementations describe what HomeKit should expose, which Loxone state UUIDs feed it, and which Loxone command should be executed for each HomeKit action. Runtime code then routes state updates and command execution through shared infrastructure instead of letting each item talk to the Miniserver directly.
|
|
34
34
|
|
|
35
|
-
The Loxone transport is also explicit.
|
|
35
|
+
The Loxone transport is also explicit. All Miniserver communication (websocket, token authentication, Structure File parsing, encrypted commands, state subscriptions) lives in the standalone [`loxone-ts-client`](https://www.npmjs.com/package/loxone-ts-client) package. This plugin depends on it and adds only the HomeKit binding layer on top, so the ownership boundary between "talking to Loxone" and "exposing it to HomeKit" stays clear.
|
|
36
36
|
|
|
37
37
|
The detailed architecture rules and release commit conventions are documented in [ARCHITECTURE.md](ARCHITECTURE.md).
|
|
38
38
|
|
|
39
|
-
# Breaking Changes
|
|
40
|
-
|
|
41
|
-
The refactor that migrates communication from `lxcommunicator` to `@rudyberends/loxone-ts-api` is intended for a breaking beta release. Existing Homebridge configuration values are kept where possible, but the runtime requirement is now Node.js 20 or newer.
|
|
42
|
-
|
|
43
|
-
Before publishing the beta:
|
|
44
|
-
|
|
45
|
-
- Bump the plugin with a breaking version number.
|
|
46
|
-
- Publish and verify `@rudyberends/loxone-ts-api` before publishing this plugin.
|
|
47
|
-
- Run `npm run lint`, `npm test`, and a real Homebridge smoke test against a Miniserver.
|
|
48
|
-
- Call out Node.js 20+ in the release notes.
|
|
49
|
-
- Tell beta users that Homebridge cached accessories may need review if names, rooms, or exposed controls changed.
|
|
50
|
-
|
|
51
39
|
# Mapped Items
|
|
52
40
|
The following list displays all supported itemtypes supported by this plugin.
|
|
53
41
|
|
|
@@ -83,49 +71,69 @@ For the plugin to recognize the items, the item needs to be visible in the user
|
|
|
83
71
|
<img width="408" alt="useinuserinterface" src="https://github.com/rudyberends/homebridge-loxone-proxy/assets/75836217/b422015b-4a5d-411e-b98c-42ef86cf8d58">
|
|
84
72
|
|
|
85
73
|
# Configuration
|
|
86
|
-
Configuration of the plugin can be done using the Homebridge UI without having to manually edit the Homebridge config.json file.
|
|
87
74
|
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
The plugin ships a **custom configuration UI** for the Homebridge UI — there is no need to edit `config.json` by hand. Open the plugin settings in Homebridge and you get a tabbed interface:
|
|
76
|
+
|
|
77
|
+
- **Connection** — Miniserver host, port, credentials and TLS. The plugin can auto-discover Miniservers on your network, so you can pick one instead of typing the IP.
|
|
78
|
+
- **Room filter** — per-room control over what is exposed and how (see [Per-room bridges](#per-room-bridges)).
|
|
79
|
+
- **Control types** — exclude whole item types from being mapped.
|
|
80
|
+
- **Options** — general behaviour (mood switches, ventilation override, …).
|
|
81
|
+
- **Mappings** — aliases for items that need manual mapping.
|
|
82
|
+
- **HomeKit Secure Video** — enable HKSV and two-way audio.
|
|
83
|
+
|
|
84
|
+
## Connection
|
|
85
|
+
At a minimum the plugin needs these to connect to the Miniserver:
|
|
90
86
|
|
|
91
87
|
| Parameter | Note |
|
|
92
88
|
| --- | --- |
|
|
93
|
-
| `host` | IP of your
|
|
94
|
-
| `port` |
|
|
95
|
-
| `username` |
|
|
96
|
-
| `password` |
|
|
97
|
-
| `TLS` |
|
|
89
|
+
| `host` | IP/hostname of your Loxone Miniserver (without `http://`) |
|
|
90
|
+
| `port` | Miniserver port (default: 80) |
|
|
91
|
+
| `username` | Loxone username |
|
|
92
|
+
| `password` | Loxone password |
|
|
93
|
+
| `TLS` | Use a secure (TLS) connection |
|
|
94
|
+
|
|
95
|
+
If you create a dedicated Loxone user for the plugin, you can filter items by only granting that user rights to the items you want to expose to HomeKit.
|
|
96
|
+
|
|
97
|
+
## Control types (exclusions)
|
|
98
|
+
To stop whole item types from being mapped, exclude them on the **Control types** tab (stored as the `Exclusions` list). Matching is case-sensitive; the item type names are listed in the [Mapped Items](#mapped-items) table.
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
## Room filter & per-room bridges
|
|
101
|
+
The **Room filter** tab lists every Loxone room and lets you choose, per room:
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
- **Expose** — whether the room's controls are mapped to HomeKit at all.
|
|
104
|
+
- **Own bridge** — publish that room as its own HomeKit bridge (see below).
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
When enabled, all LightControllerV2 moods are mapped to a homekit switch. All Switches from the same LightController will be grouped together. In homeKit this works as a radio switch, so only one switch (mood) can be active at the same time. Mixing moods is not possible.
|
|
106
|
+
Central functions (Loxone's *central* room type, e.g. "Woning"/"Home") are always kept on the main bridge — they aren't a physical room. The legacy `roomfilter` inclusion/exclusion list is still honored for older configs.
|
|
106
107
|
|
|
107
|
-
###
|
|
108
|
-
|
|
108
|
+
### Per-room bridges
|
|
109
|
+
HomeKit's biggest quirk with a single bridge is that **all** of that bridge's accessories land in whichever HomeKit room you assign the bridge to — Loxone's room layout is lost. To fix that, you can give a room its **own HomeKit bridge** straight from this plugin (no separate child-bridge process is needed). Each room bridge:
|
|
109
110
|
|
|
110
|
-
|
|
111
|
+
- Is named after the room (e.g. "Woonkamer").
|
|
112
|
+
- Has its own pairing code, shown inline in the Room filter tab.
|
|
113
|
+
- Keeps its pairing across restarts (its identity is derived from the room name).
|
|
111
114
|
|
|
112
|
-
|
|
115
|
+
**Pairing workflow** — this is what makes the room assignment stick: in the Home app, first open the **target room**, then tap **Add Accessory → More options…**, pick the room's bridge and enter the code shown in the UI. HomeKit drops the freshly-paired accessories into the room you had open.
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
## Mood switches
|
|
118
|
+
When enabled (Options tab), all LightControllerV2 moods are mapped to HomeKit switches, grouped per LightController. In HomeKit this behaves like a radio group: only one mood can be active at a time, and mixing moods is not possible.
|
|
116
119
|
|
|
117
|
-
## Manual mapping
|
|
118
|
-
Some items cannot be
|
|
120
|
+
## Manual mapping (aliases)
|
|
121
|
+
Some items cannot be classified automatically and need a naming convention. For example, give all Brightness sensors the convention `MH0'XX'` in Loxone Config
|
|
119
122
|
|
|
120
123
|
<img width="408" alt="mapping2" src="https://github.com/rudyberends/homebridge-loxone-proxy/assets/75836217/4fd61eaf-4080-41aa-bdc0-363b5ca0fcb1">
|
|
121
124
|
|
|
122
|
-
and
|
|
125
|
+
and set the alias `MH0` on the **Mappings** tab; every InfoOnlyAnalog item whose name starts with `MH0` is then exposed as a LightSensor.
|
|
126
|
+
|
|
127
|
+
<img width="748" alt="alias example" src="https://github.com/rudyberends/homebridge-loxone-proxy/assets/75836217/4ed2ce2b-4003-41bb-930c-f9eee7df517a">
|
|
128
|
+
|
|
129
|
+
Items that require an alias are listed in the [Mapped Items](#mapped-items) table.
|
|
123
130
|
|
|
124
|
-
|
|
131
|
+
**NOTE:** When the "description" field is set in Loxone Config, that field is exposed to the plugin instead of the "name" field. For the mapping to work, the description field must be empty or contain the correct convention.
|
|
125
132
|
|
|
126
|
-
|
|
133
|
+
# HomeKit Secure Video & Intercom
|
|
134
|
+
Loxone `Intercom` and `IntercomV2` controls are exposed as a Doorbell + Camera (and, for IntercomV2, a motion sensor). Enable **HomeKit Secure Video** on the HKSV tab (`enableHKSV`) to add motion/doorbell-triggered recording with a rolling prebuffer, so the seconds *before* an event are captured too. Recordings follow the resolution, frame rate and bitrate HomeKit negotiates.
|
|
127
135
|
|
|
128
|
-
**
|
|
136
|
+
**Two-way audio (experimental).** Enable *Two-Way Audio* under Advanced. Loxone Intercom V2 uses automatic WebRTC talkback, so no extra configuration is needed. For non-Loxone cameras you can supply FFmpeg return-audio output args (`TwoWayAudioOutputArgs`) using the `{camera_host}`, `{stream_url}`, `{audio_host}`, `{audio_user}` and `{audio_pass}` placeholders.
|
|
129
137
|
|
|
130
138
|
# Limitations
|
|
131
|
-
Apple does not allow more than 150
|
|
139
|
+
Apple does not allow more than 150 accessories per bridge. This plugin will not map more than 150 items on a single bridge, but if you have other plugins active you might still hit the limit. Ways to stay under it: split rooms onto their [own bridges](#per-room-bridges), run this plugin as a child bridge, or use a dedicated Loxone user and only expose the items you actually want in HomeKit.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"displayName": "Homebridge Loxone Proxy",
|
|
4
4
|
"name": "homebridge-loxone-proxy",
|
|
5
|
-
"version": "2.0.0-beta.
|
|
5
|
+
"version": "2.0.0-beta.9",
|
|
6
6
|
"description": "Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit.",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"repository": {
|