homebridge-nuheat2 1.2.6 → 1.2.8

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,9 +1,29 @@
1
- # Changelog
2
-
3
- All notable changes to this project should be documented in this file
4
-
1
+ # Changelog
2
+
3
+ All notable changes to this project should be documented in this file
4
+
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.2.8] - 2026-04-15
8
+
9
+ ### Fixed
10
+
11
+ - Correct `config.schema.json` to use object-level `required` arrays so Homebridge verification accepts the schema
12
+
13
+ ## [1.2.7] - 2026-04-15
14
+
15
+ ### Added
16
+
17
+ - TypeScript build and typecheck scaffolding for incremental migration
18
+ - TypeScript tests for the Swagger-normalization helpers, schedule switch, and thermostat behavior
19
+ - GitHub Actions workflows for CI validation and automated npm publishing
20
+
21
+ ### Changed
22
+
23
+ - Move the platform entrypoint, API client, accessory classes, logger, settings, models, and test helpers to TypeScript source under `src/`
24
+ - Keep the published CommonJS runtime layout stable by compiling TypeScript back into `index.js`, `lib/`, and `test/`
25
+ - Switch package repository metadata to the canonical GitHub URL for npm trusted publishing and provenance
26
+
7
27
  ## [1.2.6] - 2026-04-11
8
28
 
9
29
  ### Added
@@ -29,93 +49,93 @@ All notable changes to this project should be documented in this file
29
49
  - Correct setpoint debug log spacing in thermostat updates
30
50
 
31
51
  ## [1.2.4] - 2026-04-11
32
-
33
- ### Added
34
-
35
- - Swagger-aligned internal model helpers for account, thermostat, schedule, group, and energy responses
36
- - Optional per-thermostat schedule switches that can resume schedule mode from HomeKit
37
- - Account, schedule, and energy log API helpers for future UI and automation features
38
-
39
- ### Changed
40
-
41
- - Delay platform startup until Homebridge finishes restoring cached accessories
42
- - Allow overriding Nuheat OAuth client settings through config or environment variables
43
- - Improve SignalR reconnection handling and token refresh behavior
44
- - Add regression tests and modernize package metadata for current Homebridge releases
45
- - Publish the maintained fork under the npm package identity `homebridge-nuheat2`
46
- - Simplify thermostat operating-mode handling to match the documented Nuheat Swagger model
47
- - Refresh thermostats when Nuheat sends schedule notifications
48
-
49
- ### Fixed
50
-
51
- - Correct manual-mode thermostat mapping so HomeKit no longer snaps back to off
52
- - Fix thermostat online-state handling so status updates no longer rely on an assignment bug
53
- - Pin transitive websocket and cookie dependencies away from known vulnerable versions
54
-
55
- ## [1.2.3] - 2024-11-04
56
-
57
- ### Fixed
58
-
59
- - Bug when using away mode switches
60
- - Variable handling in some debug logging
61
-
62
- ## [1.2.2] - 2023-06-13
63
-
64
- ### Fixed
65
-
66
- - variable typo
67
-
68
- ## [1.2.1] - 2023-06-01
69
-
70
- ### Fixed
71
-
72
- - hold length bug
73
-
74
- ## [1.2.0] - 2023-05-26
75
-
76
- ### Changed
77
-
78
- - client secret for api auth
79
-
80
- ### Fixed
81
-
82
- - async updates from the api to reduce cookie creation
83
-
84
- ## [1.1.4] - 2023-05-12
85
-
86
- ### Changed
87
-
88
- - error handling when unable to get access token, as to not crash homebridge
89
-
90
- ## [1.1.3] - 2023-04-17
91
-
92
- ### Fixed
93
-
94
- - typo in away mode
95
-
96
- ## [1.1.2] - 2022-12-24
97
-
98
- ### Fixed
99
-
100
- - some unhandled api auth error
101
-
102
- ### Changed
103
-
104
- - some debug logging code
105
-
106
- ## [1.1.1] - 2022-11-17
107
-
108
- ### Fixed
109
-
110
- - changed the 'homebridge-nuheat' name to be lower case so HOOBS handles properly
111
-
112
- ## [1.1.0] - 2022-11-15
113
-
114
- ### Added
115
-
116
- - Added `homebridge-ui` support with auto detection
117
- - Added Away Mode switches for groups
118
-
119
- ### Changed
120
-
121
- - Changed the underlying API to use nuheats new api system
52
+
53
+ ### Added
54
+
55
+ - Swagger-aligned internal model helpers for account, thermostat, schedule, group, and energy responses
56
+ - Optional per-thermostat schedule switches that can resume schedule mode from HomeKit
57
+ - Account, schedule, and energy log API helpers for future UI and automation features
58
+
59
+ ### Changed
60
+
61
+ - Delay platform startup until Homebridge finishes restoring cached accessories
62
+ - Allow overriding Nuheat OAuth client settings through config or environment variables
63
+ - Improve SignalR reconnection handling and token refresh behavior
64
+ - Add regression tests and modernize package metadata for current Homebridge releases
65
+ - Publish the maintained fork under the npm package identity `homebridge-nuheat2`
66
+ - Simplify thermostat operating-mode handling to match the documented Nuheat Swagger model
67
+ - Refresh thermostats when Nuheat sends schedule notifications
68
+
69
+ ### Fixed
70
+
71
+ - Correct manual-mode thermostat mapping so HomeKit no longer snaps back to off
72
+ - Fix thermostat online-state handling so status updates no longer rely on an assignment bug
73
+ - Pin transitive websocket and cookie dependencies away from known vulnerable versions
74
+
75
+ ## [1.2.3] - 2024-11-04
76
+
77
+ ### Fixed
78
+
79
+ - Bug when using away mode switches
80
+ - Variable handling in some debug logging
81
+
82
+ ## [1.2.2] - 2023-06-13
83
+
84
+ ### Fixed
85
+
86
+ - variable typo
87
+
88
+ ## [1.2.1] - 2023-06-01
89
+
90
+ ### Fixed
91
+
92
+ - hold length bug
93
+
94
+ ## [1.2.0] - 2023-05-26
95
+
96
+ ### Changed
97
+
98
+ - client secret for api auth
99
+
100
+ ### Fixed
101
+
102
+ - async updates from the api to reduce cookie creation
103
+
104
+ ## [1.1.4] - 2023-05-12
105
+
106
+ ### Changed
107
+
108
+ - error handling when unable to get access token, as to not crash homebridge
109
+
110
+ ## [1.1.3] - 2023-04-17
111
+
112
+ ### Fixed
113
+
114
+ - typo in away mode
115
+
116
+ ## [1.1.2] - 2022-12-24
117
+
118
+ ### Fixed
119
+
120
+ - some unhandled api auth error
121
+
122
+ ### Changed
123
+
124
+ - some debug logging code
125
+
126
+ ## [1.1.1] - 2022-11-17
127
+
128
+ ### Fixed
129
+
130
+ - changed the 'homebridge-nuheat' name to be lower case so HOOBS handles properly
131
+
132
+ ## [1.1.0] - 2022-11-15
133
+
134
+ ### Added
135
+
136
+ - Added `homebridge-ui` support with auto detection
137
+ - Added Away Mode switches for groups
138
+
139
+ ### Changed
140
+
141
+ - Changed the underlying API to use nuheats new api system
package/README.md CHANGED
@@ -1,129 +1,163 @@
1
- # homebridge-nuheat2
2
-
3
- [![npm version](https://img.shields.io/npm/v/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
4
- [![npm downloads](https://img.shields.io/npm/dm/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
5
-
1
+ # homebridge-nuheat2
2
+
3
+ [![npm version](https://img.shields.io/npm/v/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
4
+ [![npm downloads](https://img.shields.io/npm/dm/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
5
+
6
6
  Homebridge platform plugin for Nuheat Signature floor-heating thermostats.
7
7
 
8
8
  This fork focuses on modernizing the plugin for current Homebridge releases, improving runtime stability, and preparing for Homebridge 2.0 while keeping the existing `NuHeat` platform configuration intact.
9
9
 
10
10
  This project builds on the original [`senorshaun/homebridge-nuheat`](https://github.com/senorshaun/homebridge-nuheat) plugin and retains attribution for Shaun's original work.
11
-
12
- ## Highlights
13
-
14
- - Automatically discovers thermostats on the authenticated Nuheat account
15
- - Optionally creates HomeKit switches for Nuheat group away mode
16
- - Supports permanent, scheduled, and timed holds
17
- - Uses Nuheat's OAuth-based API instead of legacy site scraping
18
- - Includes compatibility improvements for Homebridge 1.8+ and 2.0 betas
19
- - Can optionally expose a schedule switch for each thermostat
20
- - Allows advanced OAuth overrides for long-term API stability
21
-
22
- ## Compatibility
23
-
24
- - Homebridge: `^1.8.0 || ^2.0.0-beta.0`
25
- - Node.js: `^18.20.4 || ^20.18.0 || ^22 || ^24`
26
-
27
- For current Homebridge 2.0 betas, use Node 22 or 24.
28
-
29
- ## Installation
30
-
31
- Install Homebridge first:
32
-
33
- ```bash
34
- npm install -g homebridge
35
- ```
36
-
37
- Then install the plugin:
38
-
39
- ```bash
40
- npm install -g homebridge-nuheat2
41
- ```
42
-
43
- The published package name for this maintained fork is `homebridge-nuheat2`. The Homebridge platform name in config remains `NuHeat`.
44
-
45
- ## Configuration
46
-
47
- Most users should configure the plugin through Homebridge Config UI X, but the equivalent JSON looks like this:
48
-
49
- ```json
50
- {
51
- "platform": "NuHeat",
52
- "name": "NuHeat",
53
- "email": "email@address.com",
54
- "password": "password123",
55
- "devices": [{ "serialNumber": "1111111" }, { "serialNumber": "2222222" }],
56
- "autoPopulateAwayModeSwitches": true,
57
- "exposeScheduleSwitches": false,
58
- "holdLength": 1440,
59
- "refresh": 60
60
- }
61
- ```
62
-
63
- ### Options
64
-
65
- - `platform`: Must be `NuHeat`
66
- - `name`: Display name used in Homebridge logs
67
- - `email`: MyNuheat account email address
68
- - `Email`: Legacy alias still accepted for backward compatibility, but `email` is the preferred documented field
69
- - `password`: MyNuheat account password
70
- - `devices`: Optional list of thermostats to expose. If omitted or empty, every thermostat on the account will be discovered automatically
71
- - `serialNumber`: Thermostat serial number from MyNuheat
72
- - `autoPopulateAwayModeSwitches`: Automatically expose away-mode switches for all groups on the account
73
- - `exposeScheduleSwitches`: Optionally expose a switch per thermostat that reflects whether the thermostat is following its schedule and can be turned on to resume the schedule
74
- - `groups`: Optional allow-list of groups to expose as away-mode switches. This only affects group/away-mode accessories
75
- - `groupName`: Group name as shown in MyNuheat
76
- - `holdLength`: Hold duration in minutes
77
- - `refresh`: Poll interval in seconds, default `60`
78
- - `debug`: Enables verbose logging
79
- - `clientId`: Optional advanced override for the Nuheat OAuth client ID. This is recommended once you have official Nuheat API credentials
80
- - `clientSecret`: Optional advanced override for the Nuheat OAuth client secret
81
- - `redirectUri`: Optional advanced override for the Nuheat OAuth redirect URI, default `http://localhost`
82
-
83
- ### Hold Length Behavior
84
-
85
- - `0`: hold until the next scheduled event
86
- - `1-1439`: timed hold for the configured number of minutes
87
- - `1440`: permanent hold
88
-
89
- ### Device Discovery
90
-
91
- If `devices` is omitted or empty, the plugin will automatically expose every thermostat on the authenticated account.
92
-
93
- If `groups` is omitted and `autoPopulateAwayModeSwitches` is enabled, the plugin will automatically expose away-mode switches for all groups on the account.
94
-
95
- If `exposeScheduleSwitches` is enabled, the plugin will also create one switch per thermostat that turns on when the thermostat is following its Nuheat schedule and can be used to resume that schedule from HomeKit.
96
-
97
- ## Nuheat API Access
98
-
99
- Nuheat's public OpenAPI documentation indicates that third-party developers should request their own API credentials:
100
-
101
- - [Nuheat OpenAPI docs](https://api.mynuheat.com/)
102
- - [Nuheat API access request page](https://www.nuheat.com/openapi)
103
-
104
- This fork still supports the legacy built-in OAuth client settings as a fallback, but using your own `clientId` and `clientSecret` is the recommended long-term path once Nuheat issues them for your integration.
105
-
106
- ## What's New In This Fork
107
-
108
- - Fixed the manual-mode thermostat issue where HomeKit could immediately snap back to `Off`
109
- - Hardened online-state parsing and general accessory refresh behavior
110
- - Delayed platform startup until Homebridge finishes restoring cached accessories
111
- - Improved SignalR reconnect handling
112
- - Added regression tests for the key thermostat behavior fixes
113
- - Updated package metadata and dependency overrides for a cleaner modern release
114
- - Published under the maintainer-owned package identity `homebridge-nuheat2`
115
- - Added Swagger-aligned account, schedule, and energy API helpers for future enhancements
116
-
117
- ## Development
118
-
119
- Run the test suite with:
120
-
121
- ```bash
122
- npm test
123
- ```
124
-
125
- ## Future Work
126
-
127
- - Validate the plugin against the official Nuheat API credentials requested for this integration.
128
- - Verify group and away-mode behavior against current live API responses.
129
- - Evaluate whether SignalR notifications can reduce polling further in real-world deployments.
11
+
12
+ ## Highlights
13
+
14
+ - Automatically discovers thermostats on the authenticated Nuheat account
15
+ - Optionally creates HomeKit switches for Nuheat group away mode
16
+ - Supports permanent, scheduled, and timed holds
17
+ - Uses Nuheat's OAuth-based API instead of legacy site scraping
18
+ - Includes compatibility improvements for Homebridge 1.8+ and 2.0 betas
19
+ - Can optionally expose a schedule switch for each thermostat
20
+ - Allows advanced OAuth overrides for long-term API stability
21
+
22
+ ## Compatibility
23
+
24
+ - Homebridge: `^1.8.0 || ^2.0.0-beta.0`
25
+ - Node.js: `^18.20.4 || ^20.18.0 || ^22 || ^24`
26
+
27
+ For current Homebridge 2.0 betas, use Node 22 or 24.
28
+
29
+ ## Installation
30
+
31
+ Install Homebridge first:
32
+
33
+ ```bash
34
+ npm install -g homebridge
35
+ ```
36
+
37
+ Then install the plugin:
38
+
39
+ ```bash
40
+ npm install -g homebridge-nuheat2
41
+ ```
42
+
43
+ The published package name for this maintained fork is `homebridge-nuheat2`. The Homebridge platform name in config remains `NuHeat`.
44
+
45
+ ## Configuration
46
+
47
+ Most users should configure the plugin through Homebridge Config UI X, but the equivalent JSON looks like this:
48
+
49
+ ```json
50
+ {
51
+ "platform": "NuHeat",
52
+ "name": "NuHeat",
53
+ "email": "email@address.com",
54
+ "password": "password123",
55
+ "devices": [{ "serialNumber": "1111111" }, { "serialNumber": "2222222" }],
56
+ "autoPopulateAwayModeSwitches": true,
57
+ "exposeScheduleSwitches": false,
58
+ "holdLength": 1440,
59
+ "refresh": 60
60
+ }
61
+ ```
62
+
63
+ ### Options
64
+
65
+ - `platform`: Must be `NuHeat`
66
+ - `name`: Display name used in Homebridge logs
67
+ - `email`: MyNuheat account email address
68
+ - `Email`: Legacy alias still accepted for backward compatibility, but `email` is the preferred documented field
69
+ - `password`: MyNuheat account password
70
+ - `devices`: Optional list of thermostats to expose. If omitted or empty, every thermostat on the account will be discovered automatically
71
+ - `serialNumber`: Thermostat serial number from MyNuheat
72
+ - `autoPopulateAwayModeSwitches`: Automatically expose away-mode switches for all groups on the account
73
+ - `exposeScheduleSwitches`: Optionally expose a switch per thermostat that reflects whether the thermostat is following its schedule and can be turned on to resume the schedule
74
+ - `groups`: Optional allow-list of groups to expose as away-mode switches. This only affects group/away-mode accessories
75
+ - `groupName`: Group name as shown in MyNuheat
76
+ - `holdLength`: Hold duration in minutes
77
+ - `refresh`: Poll interval in seconds, default `60`
78
+ - `debug`: Enables verbose logging
79
+ - `clientId`: Optional advanced override for the Nuheat OAuth client ID. This is recommended once you have official Nuheat API credentials
80
+ - `clientSecret`: Optional advanced override for the Nuheat OAuth client secret
81
+ - `redirectUri`: Optional advanced override for the Nuheat OAuth redirect URI, default `http://localhost`
82
+
83
+ ### Hold Length Behavior
84
+
85
+ - `0`: hold until the next scheduled event
86
+ - `1-1439`: timed hold for the configured number of minutes
87
+ - `1440`: permanent hold
88
+
89
+ ### Device Discovery
90
+
91
+ If `devices` is omitted or empty, the plugin will automatically expose every thermostat on the authenticated account.
92
+
93
+ If `groups` is omitted and `autoPopulateAwayModeSwitches` is enabled, the plugin will automatically expose away-mode switches for all groups on the account.
94
+
95
+ If `exposeScheduleSwitches` is enabled, the plugin will also create one switch per thermostat that turns on when the thermostat is following its Nuheat schedule and can be used to resume that schedule from HomeKit.
96
+
97
+ ## Nuheat API Access
98
+
99
+ Nuheat's public OpenAPI documentation indicates that third-party developers should request their own API credentials:
100
+
101
+ - [Nuheat OpenAPI docs](https://api.mynuheat.com/)
102
+ - [Nuheat API access request page](https://www.nuheat.com/openapi)
103
+
104
+ This fork still supports the legacy built-in OAuth client settings as a fallback, but using your own `clientId` and `clientSecret` is the recommended long-term path once Nuheat issues them for your integration.
105
+
106
+ ## What's New In This Fork
107
+
108
+ - Fixed the manual-mode thermostat issue where HomeKit could immediately snap back to `Off`
109
+ - Hardened online-state parsing and general accessory refresh behavior
110
+ - Delayed platform startup until Homebridge finishes restoring cached accessories
111
+ - Improved SignalR reconnect handling
112
+ - Added regression tests for the key thermostat behavior fixes
113
+ - Updated package metadata and dependency overrides for a cleaner modern release
114
+ - Published under the maintainer-owned package identity `homebridge-nuheat2`
115
+ - Added Swagger-aligned account, schedule, and energy API helpers for future enhancements
116
+
117
+ ## Development
118
+
119
+ The TypeScript migration is now underway for the core runtime. The source of truth for the platform, API client, accessories, internal models, and tests lives under `src/`, and `npm run build` compiles that back into the existing CommonJS layout used by Homebridge (`index.js`, `lib/`, and `test/`).
120
+
121
+ This keeps the published plugin layout stable while we migrate incrementally instead of doing a risky one-shot rewrite.
122
+
123
+ Common development commands:
124
+
125
+ ```bash
126
+ npm run build
127
+ npm run typecheck
128
+ ```
129
+
130
+ Run the test suite with:
131
+
132
+ ```bash
133
+ npm test
134
+ ```
135
+
136
+ ## Release Automation
137
+
138
+ GitHub Actions now handles two jobs for this repository:
139
+
140
+ - `.github/workflows/ci.yml` runs `npm ci`, `npm run typecheck`, and `npm test` on pushes and pull requests across Node 20, 22, and 24
141
+ - `.github/workflows/publish.yml` runs on pushes to `master` when `package.json` changes, re-runs the checks on Node 24, and publishes to npm only when the `package.json` version is not already on the registry
142
+
143
+ The publish workflow also maps prerelease versions to npm dist-tags automatically. For example, `1.2.7-beta.1` publishes with the `beta` tag, while stable versions publish to `latest`.
144
+
145
+ ### Recommended npm Setup
146
+
147
+ Use npm trusted publishing rather than a long-lived automation token.
148
+
149
+ 1. Open the `homebridge-nuheat2` package settings on npm.
150
+ 2. Add a trusted publisher for GitHub Actions.
151
+ 3. Configure:
152
+ - Organization or user: `applemanj`
153
+ - Repository: `homebridge-nuheat2`
154
+ - Workflow filename: `publish.yml`
155
+ 4. Keep the workflow on GitHub-hosted runners.
156
+
157
+ After that, bump the version in `package.json`, push to `master`, and GitHub Actions will publish the new version automatically once the checks pass.
158
+
159
+ ## Future Work
160
+
161
+ - Validate the plugin against the official Nuheat API credentials requested for this integration.
162
+ - Verify group and away-mode behavior against current live API responses.
163
+ - Evaluate whether SignalR notifications can reduce polling further in real-world deployments.