@camstack/addon-provider-velux 0.2.147 → 0.2.149

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 CHANGED
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.149] - 2026-10-29
11
+
12
+ ### Changed
13
+
14
+ - Velux KLF-200 now connects for real: windows, shutters, blinds and awnings are covers whose state is pushed by the gateway, a roof window's rain sensor is a leak sensor, and a dropped session reconnects by itself (see the addon README for the gateway's two-connection limit)
15
+
16
+ ## [0.2.148] - 2026-10-27
17
+
18
+ ### Changed
19
+
20
+ - Rebuilt against updated dependencies.
21
+
22
+ ## [0.2.147] - 2026-10-27
23
+
10
24
  ### Added
11
25
 
12
- - Package README and changelog, included in the published files list.
26
+ - Velux Provider: Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt).
27
+ - Provides the addon Velux.
package/README.md CHANGED
@@ -1,18 +1,116 @@
1
- # @camstack/addon-provider-velux
1
+ # Velux Provider
2
2
 
3
- Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt)
3
+ Velux KLF-200 device-provider addon for CamStack. The gateway's windows, roller shutters, blinds and
4
+ awnings become `cover` devices (positional, no tilt), and a roof window's built-in rain sensor becomes a
5
+ `flood` sensor. State is pushed by the gateway, not polled.
4
6
 
5
- ## What it does
7
+ <!-- readme:generated:start (derived from the manifest; edit outside this block) -->
6
8
 
7
- - **Velux** (`provider-velux`): Adopt a Velux KLF-200 gateway over the local network and its windows / roller shutters (positional cover)
8
- - Node placement: `hub-only`.
9
+ Package `@camstack/addon-provider-velux` on npm.
10
+
11
+ ## What it provides
12
+
13
+ - **Velux** (`provider-velux`): Adopt a Velux KLF-200 gateway over the local network and its windows / roller shutters (positional cover). Category: providers.
9
14
  - Capabilities: `device-provider`.
10
15
 
11
- ## Settings
16
+ ## Configuration
17
+
18
+ Edit these from System, Addons, this addon, Settings (a device's own settings are on its device page). A password field is stored in the keychain.
19
+
20
+ **Connection**
12
21
 
13
- Settings this addon exposes are edited from System → Addons → this addon → Settings when they apply to the whole cluster, and from the device page when they belong to one device. A password field is stored in the keychain.
22
+ - Gateway: Name
23
+ - Connection: Gateway host / IP, Password
14
24
 
15
25
  ## Requirements
16
26
 
17
- - A CamStack hub. An agent is used only when the placement above allows it.
27
+ - Placement: hub-only.
28
+ - A CamStack hub. An agent is used only where the placement above allows it.
29
+
30
+ ## Documentation
31
+
32
+ - [docs/architecture/device-model.md](https://github.com/camstack/server/blob/main/docs/architecture/device-model.md)
33
+
34
+ See [CHANGELOG.md](./CHANGELOG.md) for what changed in each version.
35
+
36
+ <!-- readme:generated:end -->
37
+
38
+ ## Pairing the gateway
39
+
40
+ 1. **Free a connection slot first.** The KLF-200 accepts only a few simultaneous API sessions (see below). If
41
+ Home Assistant's VELUX integration is connected to the same gateway, that is fine for one session each, but
42
+ if anything else (a phone app session, ioBroker, a second hub) is also connected, close it before adding the
43
+ gateway here.
44
+ 2. In CamStack: Devices, add a device, choose **Velux**, enter a name, the gateway **host / IP** and the gateway
45
+ **password**.
46
+ 3. The password is the **WiFi / web password printed on the back of the unit**, not the WiFi network password of
47
+ your router. It is stored in the CamStack keychain; it is never put in an environment variable, a command
48
+ line or a log line.
49
+ 4. Open the new gateway device, then its discovery panel. Every window, shutter, blind and awning appears; adopt
50
+ the ones you want. A window with a rain sensor offers a second candidate, "<name> rain".
51
+
52
+ You do **not** have to disable Home Assistant's integration: one session from each of two clients fits inside the
53
+ gateway's limit. Do disable it (or reload it) if the gateway starts refusing logins, and see the limit below.
54
+
55
+ ## The connection limit
56
+
57
+ The KLF-200 API specification (v3.18) allows **two simultaneous API sessions** over its TLS socket on port
58
+ **51200**; a third login is refused until one closes. Separately the gateway **closes a session that is idle for
59
+ 15 minutes**.
60
+
61
+ What this addon does about it:
62
+
63
+ - It opens **exactly one** socket per gateway and never a second one (not for commands, not for the rain
64
+ readings). Command, notification and rain traffic share that one session.
65
+ - It sends a state request every **10 minutes** so the idle timer never fires.
66
+ - It enables the gateway's *house status monitor*, so every change (also one made with a remote control) is
67
+ **pushed**; there is no polling loop.
68
+ - When a session ends (the gateway reset it, the network dropped, the password was changed) the reason is logged
69
+ at warning level with the gateway device id, the covers show offline, and a **fresh** session is opened with
70
+ exponential backoff: 2 s, 4 s, 8 s ... capped at 5 minutes. A refused password waits the full 5 minutes
71
+ before the next try, so a wrong password does not hammer the unit.
72
+
73
+ So with Home Assistant connected (1 session) and CamStack (1 session) the gateway is full. A third client
74
+ (for example a phone app on the same network, or a second CamStack hub) will be refused.
75
+
76
+ ## Certificate
77
+
78
+ The gateway presents the same self-signed certificate on every unit, and that shared certificate **expired on
79
+ 2026-07-12**. The `klf-200-api` library (8.x) accepts only that exact case: the connection is accepted when the
80
+ sole defect is "certificate has expired" **and** the peer's fingerprint equals the pinned VELUX one. Any other
81
+ certificate, expired or not, is rejected. There is no `rejectUnauthorized: false` in this addon.
82
+
83
+ ## Cover mapping
84
+
85
+ | KLF-200 actuator | CamStack | Notes |
86
+ | --- | --- | --- |
87
+ | window opener | `cover` (class `window`) | position 0 = closed, 100 = open |
88
+ | roller shutter, swinging shutter, dual shutter | `cover` (`shutter`) | a dual shutter is one cover here |
89
+ | awning, horizontal awning | `cover` (`awning`) | |
90
+ | venetian / external venetian / louvre blind, curtain track | `cover` (`blind`) | no tilt |
91
+ | garage / rolling door opener | `cover` (`garage`) | |
92
+ | gate opener | `cover` (`gate`) | |
93
+ | window opener with rain sensor | extra `flood` sensor ("<name> rain") | role: leak sensor |
94
+ | lights, locks, switches, heating | not exposed | |
95
+
96
+ The wire position runs 0x0000 .. 0xC800 where **0 is fully open**, for every actuator type; CamStack's cover is
97
+ 0 = closed .. 100 = open, so `open% = round(100 * (1 - raw / 0xC800))`. A raw value above 0xC800 is a protocol
98
+ marker (target, current, ignore), reported as an unknown position and shown as `stopped`, never `closed`.
99
+ `stop` is sent as the stop marker 0xD200.
100
+
101
+ A cover is identified by the actuator's **serial number**, not by its node id (a node id is only an index that
102
+ the gateway can reuse after a node is removed). A node that reports no serial falls back to its node id.
103
+
104
+ ## Rain
105
+
106
+ A window with the integrated rain sensor reports rain as an **opening limitation** (a minimum of 89 % or more).
107
+ The gateway does not push limitation changes, so the addon re-reads it every 5 minutes and each time the window
108
+ stops moving. An unreadable value keeps the previous level.
109
+
110
+ ## Known limits
18
111
 
112
+ - Tilt is not supported (the KLF-200 has no tilt in its cover model).
113
+ - Scenes, groups and the gateway reboot button are not exposed.
114
+ - A dual roller shutter is exposed as one cover (it is two entities in Home Assistant).
115
+ - The vendor library still prints a few lines to `console` itself (a login error text, an expired-certificate
116
+ warning). Those messages never contain the password.