@tplnet/homebridge-tahoma 2.3.2 → 2.3.5

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
@@ -1,3 +1,15 @@
1
+ ## 2.3.5 (2026-11-12)
2
+
3
+ * Fix: accessory and service names are made HomeKit compatible (must start and end with a letter or number), e.g. "Büro kl." → "Büro kl", "IO (6649146)" → "IO 6649146". Removes the HAP-NodeJS "invalid 'Name' characteristic" warnings; cached accessories are renamed once (log: "Rename accessory …"). Names in the TaHoma app are not changed
4
+ * Display name in the Homebridge UI: "Homebridge Somfy TaHoma (tplnet)"
5
+
6
+ ## 2.3.3 (2026-11-12)
7
+
8
+ * Fix: a discovery retry after a partial failure no longer builds already mapped accessories twice (duplicate state listeners)
9
+ * Config schema/README: `pollingPeriod` defaults 5 s (local) / 60 s (cloud), minimum 1 s for the local API
10
+ * README: migration from `homebridge-tahoma` – never install both plugins at the same time (Homebridge would remove the cached accessories)
11
+ * Works with `@tplnet/overkiz-client` 1.3.0 (faster local polling, polling back-off capped, mDNS fixes)
12
+
1
13
  ## 2.3.2 (2026-11-12)
2
14
 
3
15
  * Security: removed dependency `moment` (GHSA-4p3w-j4w9-5jqw); the `lowSpeed` time slot is computed with `Date` (same behaviour, verified against the old implementation)
package/README.md CHANGED
@@ -1,204 +1,224 @@
1
- > **Fork notice:** This is a maintained fork of [dubocr/homebridge-tahoma](https://github.com/dubocr/homebridge-tahoma), published as `@tplnet/homebridge-tahoma`.
2
- > It uses the forked API client [`@tplnet/overkiz-client`](https://github.com/tplnet/overkiz-client).
3
- > The platform name stays `Tahoma`, so existing `config.json` entries and cached accessories keep working.
1
+ # Homebridge Somfy TaHoma (tplnet)
4
2
 
5
- # Overkiz (Somfy) - Homebridge-TaHoma
3
+ [![npm](https://img.shields.io/npm/v/@tplnet/homebridge-tahoma)](https://www.npmjs.com/package/@tplnet/homebridge-tahoma)
4
+ [![CI](https://github.com/tplnet/homebridge-tahoma/actions/workflows/ci.yml/badge.svg)](https://github.com/tplnet/homebridge-tahoma/actions/workflows/ci.yml)
5
+ [![License](https://img.shields.io/npm/l/@tplnet/homebridge-tahoma)](LICENSE)
6
6
 
7
- Homebridge plugin supporting Overkiz based platforms :
7
+ Package: [`@tplnet/homebridge-tahoma`](https://www.npmjs.com/package/@tplnet/homebridge-tahoma)
8
8
 
9
- | Service code | Vendor | Product compatibility |
10
- |---------------------------|---------------------------|-------------------------------------------------------------------|
11
- | `local` | Somfy local API | TaHoma, TaHoma Switch ([configure local API](#configure-local-api)) |
12
- | `somfy_europe` | Somfy Europe | TaHoma, TaHoma Switch, Connexoon IO, Kit de connectivité Orange |
13
- | `somfy_australia` | Somfy Australia | Connexoon RTS and other products in Australia |
14
- | `somfy_north_america` | Somfy North America | TaHoma and other product in North America |
15
- | `cozytouch` | Atlantic, Thermor, Sauter | Cozytouch |
16
- | `flexom` | Bouygues | Flexom |
17
- | `hi_kumo` | Hitachi | Hi hi_kumo |
18
- | `rexel` | Rexel | Energeasy connectivité |
9
+ Control your **Somfy TaHoma** devices – roller shutters, blinds, awnings, gates, garage doors, lights, heating, alarms, sensors – with **Apple Home** and Siri, through [Homebridge](https://homebridge.io).
19
10
 
11
+ Works with all **Overkiz** based platforms: Somfy TaHoma / TaHoma Switch / Connexoon, Atlantic / Thermor / Sauter **Cozytouch**, Hitachi Hi Kumo, Flexom and Rexel Energeasy – via the **local API** of your TaHoma gateway or via the manufacturer's cloud.
20
12
 
21
- # Installation
13
+ > This is a maintained fork of [dubocr/homebridge-tahoma](https://github.com/dubocr/homebridge-tahoma) by Romain Duboc, using the forked API client [`@tplnet/overkiz-client`](https://github.com/tplnet/overkiz-client).
14
+ > It is a **drop-in replacement**: the platform name stays `Tahoma`, so your configuration and HomeKit accessories are kept – see [Migrating](#migrating-from-homebridge-tahoma).
15
+ > Changes compared to the original: [CHANGELOG.md](CHANGELOG.md).
22
16
 
23
- 1. Install homebridge using: `npm install -g homebridge`
24
- 2. Install this plugin using: `npm install -g @tplnet/homebridge-tahoma` (or search for `@tplnet/homebridge-tahoma` in the Homebridge UI)
25
- 3. Update your configuration file. See bellow for a sample.
17
+ ## Contents
26
18
 
27
- # Configuration
19
+ - [Requirements](#requirements)
20
+ - [Installation](#installation)
21
+ - [Migrating from homebridge-tahoma](#migrating-from-homebridge-tahoma)
22
+ - [Configuration](#configuration)
23
+ - [Local API (recommended)](#local-api-recommended)
24
+ - [Device specific configuration](#device-specific-configuration)
25
+ - [Supported devices](#supported-devices)
26
+ - [Troubleshooting](#troubleshooting)
27
+ - [Contributing](#contributing)
28
+ - [Releasing (maintainers)](#releasing-maintainers)
29
+ - [License and credits](#license-and-credits)
28
30
 
29
- Minimal configuration sample:
31
+ ## Requirements
32
+
33
+ - Homebridge 1.8 or 2.x (tested with Homebridge 2.5)
34
+ - Node.js 22, 24 or 26
35
+ - One of the supported services:
36
+
37
+ | `service` | Vendor | Products |
38
+ |---|---|---|
39
+ | `local` | Somfy local API | TaHoma, TaHoma Switch – [set up the local API](#local-api-recommended) |
40
+ | `somfy_europe` | Somfy Europe | TaHoma, TaHoma Switch, Connexoon IO, Orange connectivity kit |
41
+ | `somfy_australia` | Somfy Australia | Connexoon RTS and other products in Australia |
42
+ | `somfy_north_america` | Somfy North America | TaHoma and other products in North America |
43
+ | `cozytouch` | Atlantic, Thermor, Sauter | Cozytouch |
44
+ | `flexom` | Bouygues | Flexom |
45
+ | `hi_kumo` | Hitachi | Hi Kumo |
46
+ | `rexel` | Rexel | Energeasy Connect |
47
+
48
+ ## Installation
49
+
50
+ **Homebridge UI (recommended):** open *Plugins*, search for `@tplnet/homebridge-tahoma`, install it and fill in the settings form.
51
+
52
+ **Command line:**
53
+
54
+ ```sh
55
+ npm install -g @tplnet/homebridge-tahoma
30
56
  ```
31
- {
32
- "bridge": {
33
- ...
34
- },
35
57
 
36
- "description": "...",
58
+ Then add the platform to your `config.json` (see [Configuration](#configuration)) and restart Homebridge.
59
+
60
+ ## Migrating from homebridge-tahoma
61
+
62
+ > **Important:** never have both plugins installed at the same time. Homebridge only hands the cached accessories over to the new plugin if exactly one plugin provides the `Tahoma` platform. With both installed it removes them as orphaned – and HomeKit loses the rooms, scenes and automations of these accessories.
37
63
 
38
- "accessories": [],
64
+ 1. Back up Homebridge (Homebridge UI → *Settings* → *Backup*).
65
+ 2. **First** uninstall `homebridge-tahoma`, **then** install `@tplnet/homebridge-tahoma`.
66
+ 3. Keep your existing `Tahoma` platform block in `config.json` unchanged (same `service`, same credentials – switching between cloud and local API changes the device identifiers).
67
+ 4. Restart Homebridge. For each accessory the log shows *"it seems like the plugin name changed from 'homebridge-tahoma' to '@tplnet/homebridge-tahoma'"* – the accessories have been taken over.
39
68
 
40
- "platforms":[
41
- {
42
- "platform": "Tahoma",
43
- "name": "My TaHoma Box",
69
+ ## Configuration
44
70
 
45
- "service": "somfy_europe",
46
- "user": "user@me.com",
47
- "password": "MyPassw0rd",
48
- }
49
- ]
71
+ ### Local API (recommended)
72
+
73
+ ```json
74
+ {
75
+ "platforms": [
76
+ {
77
+ "platform": "Tahoma",
78
+ "name": "TaHoma",
79
+ "service": "local",
80
+ "user": "2001-1234-5678",
81
+ "password": "YOUR-LOCAL-API-TOKEN"
82
+ }
83
+ ]
50
84
  }
51
85
  ```
52
86
 
53
- Configuration parameters:
54
-
55
- | Parameter | Type | Default | Note |
56
- |---------------------------|---------------|-------------------|-----------------------------------------------|
57
- | `service` | String | 'somfy_europe' | optional, service name (see above) |
58
- | `user` | String | null | mandatory, your service account username (or [gateway PIN / IP address](#configure-local-api)) |
59
- | `password` | String | null | mandatory, your service account password (or [API token](#configure-local-api)) |
60
- | `pollingPeriod` | Integer | 30 | optional, bridge polling period in seconds |
61
- | `refreshPeriod` | Integer | 1440 (cloud) / 30 (local) | optional, device states refresh period in minutes, `0` disables it. The Somfy cloud allows only one state refresh per day and session; lower values cause `429 QUOTA_EXCEEDED` errors |
62
- | `tlsInsecure` | Boolean | false | optional, local API only: disable the gateway certificate check (by default verified against the [Overkiz root CA](https://ca.overkiz.com/overkiz-root-ca-2048.crt)) |
63
- | `exclude` | String[] | [] | optional, protocol, ui, widget or device name to exclude |
64
- | `exposeScenarios` | Boolean | false | optional, expose scenarios as HomeKit switches. Could also specify a list of string corresponding to scenarios names to expose |
65
- | `devicesConfig` | Object[] | [] | optional list of device specific configuration (see below) |
87
+ `user` is the gateway PIN (or its IPv4 address), `password` the token from the TaHoma app – see [Local API](#local-api-recommended).
66
88
 
67
- ### Configure Local API
68
- Local API service is available on TaHoma and TaHoma switch gateways.
89
+ ### Cloud
69
90
 
70
- **WARNING: Switching to local API will break your HomeKit configuration (automations) as local API device identifiers actually differs.**
91
+ ```json
92
+ {
93
+ "platforms": [
94
+ {
95
+ "platform": "Tahoma",
96
+ "name": "TaHoma",
97
+ "service": "somfy_europe",
98
+ "user": "user@example.com",
99
+ "password": "MyPassw0rd"
100
+ }
101
+ ]
102
+ }
103
+ ```
71
104
 
72
- #### Newer approach
73
- The current way to active the developer mode on your gateway is to described in the official-looking developer GitHub [Somfy-Developer/Somfy-TaHoma-Developer-Mode](https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode):
105
+ ### All options
74
106
 
75
- 1. Open the TaHoma By Somfy application on your device.
76
- 2. Navigate to the Configure the installation > Access the parameters of your TaHoma box in the application.
77
- 3. Activate Developer Mode by tapping 7 times on the PIN of your gateway (like 2001-1234-5678) in a fast pace.
78
- 4. The app will show you a dialog with T&Cs and once confirmed, you'll be offered a screen to generate the token.
79
- 5. Configure the plugin service to Local API: `"service":"local"` with PIN of your gateway as `user` and the generated token as `password`.
107
+ | Option | Type | Default | Description |
108
+ |---|---|---|---|
109
+ | `service` | string | `somfy_europe` | Service, see [Requirements](#requirements) |
110
+ | `user` | string | – | **Required.** Local: gateway PIN or IPv4 address. Cloud: account e-mail |
111
+ | `password` | string | – | **Required.** Local: API token. Cloud: account password |
112
+ | `pollingPeriod` | number (s) | `5` local / `60` cloud | How often changes made elsewhere (remote, TaHoma app) are fetched. Cloud: at least 10 |
113
+ | `refreshPeriod` | number (min) | `30` local / `1440` cloud | Periodic full state refresh, needed for RTS devices and physical remotes that do not report their state. `0` disables it. The Somfy cloud allows only one refresh per day – lower values cause `429 QUOTA_EXCEEDED` |
114
+ | `tlsInsecure` | boolean | `false` | Local API only: skip the gateway certificate check (by default verified against the [Overkiz root CA](https://ca.overkiz.com/overkiz-root-ca-2048.crt)). Use only if the connection fails with a certificate error |
115
+ | `exclude` | string[] | `[]` | Devices to hide: device name, widget, UI class or protocol (e.g. `"rts"`, `"Main door"`, `"PositionableHorizontalAwning"`) |
116
+ | `exposeScenarios` | boolean / string[] | `false` | Cloud only: expose TaHoma scenarios as HomeKit switches; `true` for all or a list of scenario names |
117
+ | `devicesConfig` | object[] | `[]` | Per-device settings, see [below](#device-specific-configuration) |
118
+ | `debug` | boolean | `false` | Verbose log output |
80
119
 
81
- Note you do not need to use the online API credentials service anymore as you'll be given the token right away in the app.
120
+ ## Local API (recommended)
82
121
 
83
- #### Older approach
84
- *Please note the Activate developer mode button in My Account appears to be not available anymore as of 08/2026 and the developer.somfy.com domain does not exist either.*
122
+ The local API talks directly to your gateway in your home network: no cloud account in Homebridge, no internet dependency, no rate limits and state changes within seconds.
85
123
 
86
- To use Local API you will have to:
87
- 1. Activate `developer mode` ([www.somfy.com](https://www.somfy.com) > My Account > Activate developer mode)
88
- 2. Generate API credentials at [https://dev.duboc.pro/homebridge-tahoma](https://dev.duboc.pro/homebridge-tahoma)
89
- 3. Configure the plugin service to Local API: `"service":"local"`
124
+ **Supported:** TaHoma and TaHoma Switch. **Not supported:** the 1st generation square TaHoma box and the Connectivity Kit.
90
125
 
91
- When using Local API service, please fill `user` with your gateway PIN number or IPv4 address and `password` with the token generated at [step 2](https://dev.duboc.pro/homebridge-tahoma)
126
+ 1. Open the **TaHoma by Somfy** app.
127
+ 2. Go to *Configure the installation* → *Access the parameters* of your gateway.
128
+ 3. Tap the gateway PIN (e.g. `2001-1234-5678`) **7 times** quickly to enable *Developer Mode*.
129
+ 4. Accept the terms and **generate a token**. Copy it right away – it is only shown once.
130
+ 5. Configure the plugin with `"service": "local"`, the PIN as `user` and the token as `password`.
92
131
 
93
- For more information, browse [https://developer.somfy.com/developer-mode](https://developer.somfy.com/developer-mode)
132
+ The gateway is found in your network by its PIN (mDNS). If Homebridge runs in another network or VLAN, use the gateway's IP address as `user` (preferably with a fixed DHCP lease).
94
133
 
134
+ > **Note:** cloud and local API use different device identifiers. Switching an existing setup from cloud to local makes HomeKit see all accessories as new ones – rooms and automations have to be set up again.
95
135
 
136
+ More information: [Somfy TaHoma Developer Mode](https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode).
96
137
 
97
- # Specific device configuration
138
+ ## Device specific configuration
98
139
 
99
- This option allows you to apply a specific configuation to device or group of device.
100
- One configuration is composed of a `key` attribute containing device name, widget, uiClass, protocol or unique identifier and as many parameter depending of device type.
140
+ `devicesConfig` applies settings to a single device or a group of devices. Each entry has a `key` – a device name, widget, UI class, protocol or unique identifier – and the settings for that device type:
101
141
 
102
- ```
103
- {
104
- "key": "Bedroom door",
105
- "param1": "value1"
106
- ...
107
- }
142
+ ```json
143
+ "devicesConfig": [
144
+ { "key": "Bedroom blind", "blindMode": true },
145
+ { "key": "UpDownRollerShutter", "defaultPosition": 50 },
146
+ { "key": "GarageDoor", "reverse": true },
147
+ { "key": "Alarm", "stayZones": "A,C" }
148
+ ]
108
149
  ```
109
150
 
110
- | Alarm parameters | Type | Default | Note |
111
- |-------------------|-----------|---------------|-----------------------|
112
- | `stayZones` | String | 'A' | optional, active zones (A,B,C) in 'Stay' mode |
113
- | `nightZones` | String | 'B' | optional, active zones (A,B,C) in 'Night' mode |
114
- | `occupancySensor` | Boolean | false | optional, add an occupancy widget linked to the alarm |
115
-
116
- | WindowCovering parameters | Type | Default | Note |
117
- |---------------------------|-----------|---------------|---------------|
118
- | `defaultPosition` | Integer | 0 | optional, final position for UpDown rollershutter after any command |
119
- | `reverse` | Boolean | false | optional, reverse up/down in case of bad mounting |
120
- | `lowSpeed` | Boolean / String | false | optional, use low speed for roller shutter supporting it. If string, specify slot time with format "HH:MM-HH:MM". Low speed will be enabled between them. |
121
- | `blindMode` | String | null | optional, change main slider action to orientation. By default, both closure and orientation will be set. When setting ``blindMode: true`` the blinds work in the following way: Opening the blinds or setting them to 100% will fully open them. Closing the blinds or setting them to 0% will fully close them. Setting the blinds to a value between 1% and 99% will first close the blinds and then adjust thier horizontal tilt in a way that 99% means fully horizonal = more light, and 1% means nearly closed = less light. |
122
- | `blindsOnRollerShutter` | Boolean | false | optional, when blinds are installed on roller shutter motors allow slats to stay horizontal (opened) at intermediate position |
123
- | `movementDuration` | Integer | 0 | optional, duration of a full shutter movement from 'open' to 'close' in seconds. Will be used to approximate shutter intermediate position. (0 = disable feature) |
124
-
125
- | GarageDoorOpener parameters | Type | Default | Note |
126
- |-------------------------------|---------------|---------------|-------------------|
127
- | `cyclic` | Boolean | false | optional, restore closed state after `cycleDuration` seconds for stateless devices with cyclic behaviour |
128
- | `cycleDuration` | Integer | false | optional, cycle duration (in seconds) for cyclic mode (default: 5 sec) |
129
- | `reverse` | Boolean | false | optional, reverse up/down in case of bad mounting |
130
- | `pedestrianDuration` | Integer | 0 | optional, duration for pedestrian position for RTS gates |
131
-
132
- | HeatingSystem parameters | Type | Default | Note |
133
- |-------------------------------|---------------|---------------|-------------------|
134
- | `derogationDuration` | Integer | 1 | optional, duration (in hours) for derogation orders |
135
- | `comfort` | Integer | 19 | optional, comfort temperature used as display for heaters controled by pilot wire |
136
- | `eco` | Integer | 17 | optional, comfort temperature used as display for heaters controled by pilot wire |
137
-
138
-
139
- Full configuration example:
140
- ```
141
- {
142
- "bridge": {
143
- ...
144
- },
145
-
146
- "description": "...",
147
-
148
- "accessories": [],
149
-
150
- "platforms":[
151
- {
152
- "platform": "Tahoma",
153
- "name": "My Tahoma Bridge",
154
-
155
- "user": "user@me.com",
156
- "password": "MyPassw0rd",
157
- "service": "somfy_europe",
158
- "exclude": ["hue", "rts", "Main door", "Main door", "PositionableHorizontalAwning"],
159
-
160
- "devicesConfig": [
161
- {
162
- "key": "Alarm",
163
- "stayZones": "A,C"
164
- },
165
- {
166
- "key": "Bedroom blind",
167
- "blindMode": true
168
- },
169
- {
170
- "key": "GarageDoor",
171
- "reverse": true
172
- },
173
- {
174
- "key": "UpDownRollerShutter",
175
- "defaultPosition": 50
176
- }
177
- ]
178
- }
179
- ]
180
- }
181
- ```
151
+ ### Roller shutters, blinds, awnings (WindowCovering)
182
152
 
183
- # Contribute
153
+ | Setting | Type | Default | Description |
154
+ |---|---|---|---|
155
+ | `defaultPosition` | number | `0` | Final position shown for up/down-only (stateless) shutters after a command |
156
+ | `reverse` | boolean | `false` | Swap up and down (e.g. after a wrong installation) |
157
+ | `lowSpeed` | boolean / string | `false` | Use the low (silent) speed on shutters that support it. As string `"HH:MM-HH:MM"`, low speed is used only in that time slot (may span midnight, e.g. `"22:00-07:00"`) |
158
+ | `blindMode` | boolean | `false` | Main slider controls the slats: 100 % fully opens, 0 % fully closes, 1–99 % closes the blind and tilts the slats (99 % = horizontal, most light; 1 % = nearly closed) |
159
+ | `blindsOnRollerShutter` | boolean | `false` | Blinds mounted on roller shutter motors: keep the slats horizontal (open) at intermediate positions |
160
+ | `movementDuration` | number (s) | `0` | Duration of a full movement from open to closed; used to estimate intermediate positions (`0` = off) |
184
161
 
185
- You are welcome to contribute to this plugin development by opening an issue in case of unexpected behaviour or unsupported device.
162
+ ### Garage doors and gates (GarageDoorOpener)
186
163
 
187
- I do not expect any reward concerning this plugin, however, some users ask me for a [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=L4X489MG7FUCN) button as sign of contribution. Feel free to use it.
164
+ | Setting | Type | Default | Description |
165
+ |---|---|---|---|
166
+ | `cyclic` | boolean | `false` | For stateless devices that close by themselves: show *closed* again after `cycleDuration` |
167
+ | `cycleDuration` | number (s) | `5` | Cycle duration for `cyclic` |
168
+ | `reverse` | boolean | `false` | Swap open and close |
169
+ | `pedestrianDuration` | number (s) | `0` | Duration of the pedestrian opening for RTS gates |
188
170
 
171
+ ### Alarm
189
172
 
190
- # Migrating from `homebridge-tahoma`
173
+ | Setting | Type | Default | Description |
174
+ |---|---|---|---|
175
+ | `stayZones` | string | `A` | Zones (A, B, C) armed in *Stay* mode |
176
+ | `nightZones` | string | `B` | Zones (A, B, C) armed in *Night* mode |
177
+ | `occupancySensor` | boolean | `false` | Add an occupancy sensor linked to the alarm |
191
178
 
192
- 1. Back up Homebridge (Homebridge UI → Settings → Backup).
193
- 2. Uninstall `homebridge-tahoma`, then install `@tplnet/homebridge-tahoma`. Keep the existing `Tahoma` platform block in `config.json`.
194
- 3. Restart Homebridge. Cached accessories registered by the old plugin are taken over because the platform name is unchanged.
179
+ ### Heating
195
180
 
196
- # Releasing (maintainers)
181
+ | Setting | Type | Default | Description |
182
+ |---|---|---|---|
183
+ | `derogationDuration` | number (h) | `1` | Duration of temporary (derogation) orders |
184
+ | `comfort` | number (°C) | `19` | Comfort temperature shown for pilot wire heaters |
185
+ | `eco` | number (°C) | `17` | Eco temperature shown for pilot wire heaters |
197
186
 
198
- ```
199
- npm version patch # or minor / major – bumps package.json and creates tag vX.Y.Z
187
+ ## Supported devices
188
+
189
+ Roller shutters, exterior and interior venetian blinds, adjustable slats, awnings, pergolas, screens, curtains, swinging shutters, windows and window handles, garage doors and gates, door locks, lights and on/off switches, sirens and alarms, heating systems (Atlantic, Somfy thermostat, EvoHome, Hitachi), water heaters, ventilation, and sensors for temperature, humidity, light, air quality, smoke, water, rain, contact, occupancy and electricity consumption.
190
+
191
+ A device type that is not supported shows up in the log as *"… not supported"*. Please [open an issue](https://github.com/tplnet/homebridge-tahoma/issues) with that log line and the device's widget name.
192
+
193
+ ## Troubleshooting
194
+
195
+ | Problem | What to do |
196
+ |---|---|
197
+ | `No gateway found on your network` | Check that Developer Mode is enabled and that Homebridge is in the same network as the gateway. Otherwise use the gateway's IP address as `user` |
198
+ | Certificate error with the local API | Set `"tlsInsecure": true` and please open an issue with the error message |
199
+ | `401` with the local API | The token was revoked or mistyped – generate a new one in the TaHoma app |
200
+ | `429 QUOTA_EXCEEDED` (cloud) | Increase `refreshPeriod` (default 1440) or set it to `0` – or switch to the [local API](#local-api-recommended) |
201
+ | Changes made with a remote are not shown | RTS devices cannot report their state; keep `refreshPeriod` enabled |
202
+ | Accessories disappeared after installing this plugin | Both plugins were installed at the same time – restore your backup and follow [Migrating](#migrating-from-homebridge-tahoma) |
203
+
204
+ For a detailed log, set `"debug": true` and restart Homebridge.
205
+
206
+ ## Contributing
207
+
208
+ Bug reports, device support requests and pull requests are welcome: <https://github.com/tplnet/homebridge-tahoma/issues>.
209
+ Please include the Homebridge log (with `"debug": true`) and the device's UI class and widget name shown in the log at startup.
210
+
211
+ ## Releasing (maintainers)
212
+
213
+ ```sh
214
+ npm version patch # or minor / major – bumps package.json and creates the annotated tag vX.Y.Z
200
215
  git push --follow-tags
201
216
  ```
217
+
202
218
  The `Publish to npm` workflow **stages** the version on npm via Trusted Publishing (stage-only permission) and creates a GitHub release.
203
- The version becomes public only after approval with 2FA/passkey: npmjs.com > package > Staged Packages, or `npm stage approve <stage-id>`
219
+ The version becomes public only after approval with 2FA/passkey: npmjs.com → package → *Staged Packages*, or `npm stage approve <stage-id>`
204
220
  (the id is shown in the workflow run summary and by `npm stage list <package>`).
221
+
222
+ ## License and credits
223
+
224
+ [Apache License 2.0](LICENSE). Original work © Romain Duboc and contributors – thank you for creating and maintaining this plugin for years. Modifications © 2026 tplnet, see [NOTICE](NOTICE).
@@ -82,9 +82,9 @@
82
82
  "pollingPeriod": {
83
83
  "title": "Polling period",
84
84
  "type": "number",
85
- "minimum": 10,
86
- "placeholder": 60,
87
- "description": "Period (in seconds) for fetching device changes made from other controller (with TaHoma app for eg.)"
85
+ "minimum": 1,
86
+ "placeholder": 5,
87
+ "description": "Period (in seconds) for fetching device changes made from other controller (with TaHoma app for eg.). Default: 5 for the local API, 60 for cloud services (cloud: at least 10)"
88
88
  },
89
89
  "refreshPeriod": {
90
90
  "title": "Refresh period",
package/dist/Mapper.js CHANGED
@@ -2,6 +2,7 @@ import { Characteristics, Services } from './Platform.js';
2
2
  import { HAPStatus } from 'homebridge';
3
3
  import { Action, ExecutionState } from 'overkiz-client';
4
4
  import { GREY } from './colors.js';
5
+ import { hapName } from './hapName.js';
5
6
  export default class Mapper {
6
7
  platform;
7
8
  accessory;
@@ -44,6 +45,7 @@ export default class Mapper {
44
45
  const services = this.registerServices();
45
46
  const info = this.accessory.getService(Services.AccessoryInformation);
46
47
  if (info) {
48
+ info.setCharacteristic(Characteristics.Name, hapName(this.device.label));
47
49
  info.setCharacteristic(Characteristics.Manufacturer, this.device.manufacturer);
48
50
  info.setCharacteristic(Characteristics.Model, this.device.model);
49
51
  info.setCharacteristic(Characteristics.SerialNumber, this.device.address.substring(0, 64));
@@ -77,7 +79,7 @@ export default class Mapper {
77
79
  }
78
80
  registerService(type, subtype) {
79
81
  let service;
80
- const name = subtype ? this.translate(subtype) : this.device.label;
82
+ const name = hapName(subtype ? this.translate(subtype) : this.device.label);
81
83
  if (subtype) {
82
84
  service = this.accessory.getServiceById(type, subtype) || this.accessory.addService(type, name, subtype);
83
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Mapper.js","sourceRoot":"","sources":["../src/Mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAuB,SAAS,EAAsC,MAAM,YAAY,CAAC;AAChG,OAAO,EAA0B,MAAM,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,OAAO,OAAgB,MAAM;IAmBT;IACA;IACA;IApBf,MAAM,CAAU,eAAe,GAA0B;QAC7D,cAAc,CAAC,SAA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AI,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACvF,CAAC;IAED,KAAK,CAAC,eAAe;QACjB,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC"}
@@ -19,6 +19,7 @@ export declare class Platform implements DynamicPlatformPlugin {
19
19
  private translations;
20
20
  private executionPromise;
21
21
  private retryDelay;
22
+ private readonly mapped;
22
23
  constructor(log: Logger, config: PlatformConfig, api: API);
23
24
  /**
24
25
  * This function is invoked when homebridge restores cached accessories from disk at startup.
@@ -36,6 +37,10 @@ export declare class Platform implements DynamicPlatformPlugin {
36
37
  * must not be registered again to prevent "duplicate UUID" errors.
37
38
  */
38
39
  discoverDevices(): Promise<void>;
40
+ /**
41
+ * Give a cached accessory a HomeKit compatible name (see hapName), e.g. "Büro kl." -> "Büro kl".
42
+ */
43
+ private renameCachedAccessory;
39
44
  executeAction(label: string, action: Action, highPriority?: boolean, standalone?: boolean): any;
40
45
  /**
41
46
  * Translate
package/dist/Platform.js CHANGED
@@ -4,6 +4,7 @@ import Mapper from './Mapper.js';
4
4
  import SceneMapper from './SceneMapper.js';
5
5
  import { CustomCharacteristics } from './CustomCharacteristics.js';
6
6
  import { BLUE, GREY, RESET } from './colors.js';
7
+ import { hapName } from './hapName.js';
7
8
  export let Services;
8
9
  export let Characteristics;
9
10
  const DEFAULT_RETRY_DELAY = 60;
@@ -28,6 +29,9 @@ export class Platform {
28
29
  translations;
29
30
  executionPromise;
30
31
  retryDelay = DEFAULT_RETRY_DELAY;
32
+ // UUIDs already mapped: a discovery retry after a partial failure must not build them twice
33
+ // (that would attach duplicate state listeners)
34
+ mapped = new Set();
31
35
  constructor(log, config, api) {
32
36
  this.log = log;
33
37
  this.config = config;
@@ -102,6 +106,7 @@ export class Platform {
102
106
  async discoverDevices() {
103
107
  try {
104
108
  const uuids = Array();
109
+ const renamed = Array();
105
110
  const devices = await this.client.getDevices();
106
111
  this.log.debug(devices.length + ' devices discovered');
107
112
  // loop over the discovered devices and register each one if it has not already been registered
@@ -117,23 +122,13 @@ export class Platform {
117
122
  // the cached devices we stored in the `configureAccessory` method above
118
123
  let accessory = this.accessories.find(accessory => accessory.UUID === device.uuid);
119
124
  if (accessory) {
120
- // the accessory already exists
121
- //this.log.info('Updating accessory:', accessory.displayName);
122
- /*
123
- const newaccessory = new this.api.platformAccessory(device.label, device.uuid);
124
- newaccessory.context.device = device;
125
- await this.configureAccessory(newaccessory);
126
- const services = newaccessory.services.map((service) => service.UUID);
127
- accessory.services
128
- .filter((service) => !services.includes(service.UUID))
129
- .forEach((services) => accessory?.removeService(services));
130
- this.api.updatePlatformAccessories([accessory]);
131
- */
125
+ // the accessory already exists: fix a cached name that HomeKit does not accept
126
+ this.renameCachedAccessory(accessory, hapName(device.label), renamed);
132
127
  }
133
128
  else {
134
129
  // the accessory does not yet exist, so we need to create it
135
130
  this.log.info('Create accessory:', device.label);
136
- accessory = new this.api.platformAccessory(device.label, device.uuid);
131
+ accessory = new this.api.platformAccessory(hapName(device.label), device.uuid);
137
132
  //accessory.context.device = device;
138
133
  await this.configureAccessory(accessory);
139
134
  this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
@@ -146,7 +141,10 @@ export class Platform {
146
141
  .catch(() => import(`./mappers/${device.definition.uiClass}.js`))
147
142
  .then((c) => c.default)
148
143
  .catch(() => ({ default: Mapper }));
149
- new mapper(this, accessory, device).build();
144
+ if (!this.mapped.has(device.uuid)) {
145
+ new mapper(this, accessory, device).build();
146
+ this.mapped.add(device.uuid);
147
+ }
150
148
  uuids.push(device.uuid);
151
149
  }
152
150
  if (this.exposeScenarios) {
@@ -160,18 +158,28 @@ export class Platform {
160
158
  continue;
161
159
  }
162
160
  let accessory = this.accessories.find(accessory => accessory.UUID === actionGroup.oid);
163
- if (!accessory) {
161
+ if (accessory) {
162
+ this.renameCachedAccessory(accessory, hapName(actionGroup.label, 'Scenario'), renamed);
163
+ }
164
+ else {
164
165
  // the accessory does not yet exist, so we need to create it
165
166
  this.log.info('Create accessory', actionGroup.label);
166
- accessory = new this.api.platformAccessory(actionGroup.label, actionGroup.oid);
167
+ accessory = new this.api.platformAccessory(hapName(actionGroup.label, 'Scenario'), actionGroup.oid);
167
168
  await this.configureAccessory(accessory);
168
169
  this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
169
170
  }
170
171
  this.log.info('Map scene', accessory.displayName);
171
- new SceneMapper(this, accessory, actionGroup);
172
+ if (!this.mapped.has(actionGroup.oid)) {
173
+ new SceneMapper(this, accessory, actionGroup);
174
+ this.mapped.add(actionGroup.oid);
175
+ }
172
176
  uuids.push(actionGroup.oid);
173
177
  }
174
178
  }
179
+ if (renamed.length > 0) {
180
+ // persist the new names in the accessory cache
181
+ this.api.updatePlatformAccessories(renamed);
182
+ }
175
183
  const deleted = this.accessories.filter((accessory) => !uuids.includes(accessory.UUID));
176
184
  this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, deleted);
177
185
  this.retryDelay = DEFAULT_RETRY_DELAY;
@@ -190,6 +198,16 @@ export class Platform {
190
198
  this.retryDelay = Math.min(this.retryDelay * 2, MAX_RETRY_DELAY);
191
199
  }
192
200
  }
201
+ /**
202
+ * Give a cached accessory a HomeKit compatible name (see hapName), e.g. "Büro kl." -> "Büro kl".
203
+ */
204
+ renameCachedAccessory(accessory, name, renamed) {
205
+ if (accessory.displayName !== name) {
206
+ this.log.info(`Rename accessory '${accessory.displayName}' to '${name}' (HomeKit naming rules)`);
207
+ accessory.updateDisplayName(name);
208
+ renamed.push(accessory);
209
+ }
210
+ }
193
211
  /*
194
212
  action: The action to execute
195
213
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Platform.js","sourceRoot":"","sources":["../src/Platform.ts"],"names":[],"mappings":"AAE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AAC,KAAK,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC;YAClF,CAAC;YACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;QACjC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,KAAa;QAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QACpC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACrB,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;gBACxD,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;YACnC,CAAC;iBAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACzC,IAAI,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACjC,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,WAAW,CAAC;YACvB,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
@@ -0,0 +1 @@
1
+ export declare function hapName(label: string | undefined, fallback?: string): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * HomeKit (HAP) accepts names that start and end with a letter or number and otherwise contain only
3
+ * letters, numbers, spaces and ’ ' & ! . _ : ; ( ) / , - Other names trigger HAP-NodeJS warnings and
4
+ * may be rejected by the Home app.
5
+ *
6
+ * Turns a TaHoma label into such a name, e.g. "Büro kl." → "Büro kl", "IO (6649146)" → "IO 6649146".
7
+ * The label in the TaHoma app is not changed.
8
+ */
9
+ const VALID_NAME = /^[\p{L}\p{N}](?:[\p{L}\p{N}\p{Zs}’'&!._:;()/,-]*[\p{L}\p{N}])?$/u;
10
+ export function hapName(label, fallback = 'Accessory') {
11
+ const original = (label ?? '').trim();
12
+ if (VALID_NAME.test(original)) {
13
+ return original;
14
+ }
15
+ const name = original
16
+ .replace(/\(([^()]*)\)/g, ' $1 ') // "IO (123)" -> "IO 123 "
17
+ .replace(/[^\p{L}\p{N}\p{Zs}’'&!._:;()/,-]/gu, ' ') // unsupported characters -> space
18
+ .replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, '') // must start and end with letter/number
19
+ .replace(/\s+/g, ' ')
20
+ .trim();
21
+ return name || fallback;
22
+ }
23
+ //# sourceMappingURL=hapName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hapName.js","sourceRoot":"","sources":["../src/hapName.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,kEAAkE,CAAC;AAEtF,MAAM,UAAU,OAAO,CAAC,KAAyB,EAAE,QAAQ,GAAG,WAAW;IACrE,MAAM,QAAQ,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACtC,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ;SAChB,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAuB,2BAA2B;SAClF,OAAO,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC,kCAAkC;SACrF,OAAO,CAAC,mCAAmC,EAAE,EAAE,CAAC,CAAO,wCAAwC;SAC/F,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;IACZ,OAAO,IAAI,IAAI,QAAQ,CAAC;AAC5B,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tplnet/homebridge-tahoma",
3
- "displayName": "Homebridge TaHoma (tplnet fork)",
3
+ "displayName": "Homebridge Somfy TaHoma (tplnet)",
4
4
  "type": "module",
5
- "version": "2.3.2",
5
+ "version": "2.3.5",
6
6
  "description": "Homebridge plugin for TaHoma and Cozytouch services (Somfy, Atlantic, Thermor, Sauter). Maintained fork of dubocr/homebridge-tahoma.",
7
7
  "author": "Romain DUBOC <dubocr@gmail.com>",
8
8
  "license": "Apache-2.0",