homebridge-nuheat2 1.2.5 → 1.2.7
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 +119 -94
- package/README.md +158 -124
- package/config.schema.json +111 -106
- package/index.js +307 -405
- package/lib/NuHeatAPI.js +600 -850
- package/lib/NuHeatGroup.js +68 -74
- package/lib/NuHeatListener.js +107 -132
- package/lib/NuHeatModels.js +92 -136
- package/lib/NuHeatScheduleSwitch.js +55 -69
- package/lib/NuHeatThermostat.js +157 -216
- package/lib/logger.js +46 -35
- package/lib/settings.js +9 -19
- package/lib/types.js +2 -0
- package/package.json +63 -54
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
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.7] - 2026-04-15
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- TypeScript build and typecheck scaffolding for incremental migration
|
|
12
|
+
- TypeScript tests for the Swagger-normalization helpers, schedule switch, and thermostat behavior
|
|
13
|
+
- GitHub Actions workflows for CI validation and automated npm publishing
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Move the platform entrypoint, API client, accessory classes, logger, settings, models, and test helpers to TypeScript source under `src/`
|
|
18
|
+
- Keep the published CommonJS runtime layout stable by compiling TypeScript back into `index.js`, `lib/`, and `test/`
|
|
19
|
+
- Switch package repository metadata to the canonical GitHub URL for npm trusted publishing and provenance
|
|
20
|
+
|
|
21
|
+
## [1.2.6] - 2026-04-11
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Add an `enableNotifications` config option so SignalR can be disabled during troubleshooting
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Skip group setup and refresh calls unless away-mode groups are actually configured
|
|
30
|
+
- Improve Nuheat API error logging with request method, endpoint, status code, and response snippets
|
|
31
|
+
|
|
7
32
|
## [1.2.5] - 2026-04-11
|
|
8
33
|
|
|
9
34
|
### Changed
|
|
@@ -18,93 +43,93 @@ All notable changes to this project should be documented in this file
|
|
|
18
43
|
- Correct setpoint debug log spacing in thermostat updates
|
|
19
44
|
|
|
20
45
|
## [1.2.4] - 2026-04-11
|
|
21
|
-
|
|
22
|
-
### Added
|
|
23
|
-
|
|
24
|
-
- Swagger-aligned internal model helpers for account, thermostat, schedule, group, and energy responses
|
|
25
|
-
- Optional per-thermostat schedule switches that can resume schedule mode from HomeKit
|
|
26
|
-
- Account, schedule, and energy log API helpers for future UI and automation features
|
|
27
|
-
|
|
28
|
-
### Changed
|
|
29
|
-
|
|
30
|
-
- Delay platform startup until Homebridge finishes restoring cached accessories
|
|
31
|
-
- Allow overriding Nuheat OAuth client settings through config or environment variables
|
|
32
|
-
- Improve SignalR reconnection handling and token refresh behavior
|
|
33
|
-
- Add regression tests and modernize package metadata for current Homebridge releases
|
|
34
|
-
- Publish the maintained fork under the npm package identity `homebridge-nuheat2`
|
|
35
|
-
- Simplify thermostat operating-mode handling to match the documented Nuheat Swagger model
|
|
36
|
-
- Refresh thermostats when Nuheat sends schedule notifications
|
|
37
|
-
|
|
38
|
-
### Fixed
|
|
39
|
-
|
|
40
|
-
- Correct manual-mode thermostat mapping so HomeKit no longer snaps back to off
|
|
41
|
-
- Fix thermostat online-state handling so status updates no longer rely on an assignment bug
|
|
42
|
-
- Pin transitive websocket and cookie dependencies away from known vulnerable versions
|
|
43
|
-
|
|
44
|
-
## [1.2.3] - 2024-11-04
|
|
45
|
-
|
|
46
|
-
### Fixed
|
|
47
|
-
|
|
48
|
-
- Bug when using away mode switches
|
|
49
|
-
- Variable handling in some debug logging
|
|
50
|
-
|
|
51
|
-
## [1.2.2] - 2023-06-13
|
|
52
|
-
|
|
53
|
-
### Fixed
|
|
54
|
-
|
|
55
|
-
- variable typo
|
|
56
|
-
|
|
57
|
-
## [1.2.1] - 2023-06-01
|
|
58
|
-
|
|
59
|
-
### Fixed
|
|
60
|
-
|
|
61
|
-
- hold length bug
|
|
62
|
-
|
|
63
|
-
## [1.2.0] - 2023-05-26
|
|
64
|
-
|
|
65
|
-
### Changed
|
|
66
|
-
|
|
67
|
-
- client secret for api auth
|
|
68
|
-
|
|
69
|
-
### Fixed
|
|
70
|
-
|
|
71
|
-
- async updates from the api to reduce cookie creation
|
|
72
|
-
|
|
73
|
-
## [1.1.4] - 2023-05-12
|
|
74
|
-
|
|
75
|
-
### Changed
|
|
76
|
-
|
|
77
|
-
- error handling when unable to get access token, as to not crash homebridge
|
|
78
|
-
|
|
79
|
-
## [1.1.3] - 2023-04-17
|
|
80
|
-
|
|
81
|
-
### Fixed
|
|
82
|
-
|
|
83
|
-
- typo in away mode
|
|
84
|
-
|
|
85
|
-
## [1.1.2] - 2022-12-24
|
|
86
|
-
|
|
87
|
-
### Fixed
|
|
88
|
-
|
|
89
|
-
- some unhandled api auth error
|
|
90
|
-
|
|
91
|
-
### Changed
|
|
92
|
-
|
|
93
|
-
- some debug logging code
|
|
94
|
-
|
|
95
|
-
## [1.1.1] - 2022-11-17
|
|
96
|
-
|
|
97
|
-
### Fixed
|
|
98
|
-
|
|
99
|
-
- changed the 'homebridge-nuheat' name to be lower case so HOOBS handles properly
|
|
100
|
-
|
|
101
|
-
## [1.1.0] - 2022-11-15
|
|
102
|
-
|
|
103
|
-
### Added
|
|
104
|
-
|
|
105
|
-
- Added `homebridge-ui` support with auto detection
|
|
106
|
-
- Added Away Mode switches for groups
|
|
107
|
-
|
|
108
|
-
### Changed
|
|
109
|
-
|
|
110
|
-
- Changed the underlying API to use nuheats new api system
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- Swagger-aligned internal model helpers for account, thermostat, schedule, group, and energy responses
|
|
50
|
+
- Optional per-thermostat schedule switches that can resume schedule mode from HomeKit
|
|
51
|
+
- Account, schedule, and energy log API helpers for future UI and automation features
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- Delay platform startup until Homebridge finishes restoring cached accessories
|
|
56
|
+
- Allow overriding Nuheat OAuth client settings through config or environment variables
|
|
57
|
+
- Improve SignalR reconnection handling and token refresh behavior
|
|
58
|
+
- Add regression tests and modernize package metadata for current Homebridge releases
|
|
59
|
+
- Publish the maintained fork under the npm package identity `homebridge-nuheat2`
|
|
60
|
+
- Simplify thermostat operating-mode handling to match the documented Nuheat Swagger model
|
|
61
|
+
- Refresh thermostats when Nuheat sends schedule notifications
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- Correct manual-mode thermostat mapping so HomeKit no longer snaps back to off
|
|
66
|
+
- Fix thermostat online-state handling so status updates no longer rely on an assignment bug
|
|
67
|
+
- Pin transitive websocket and cookie dependencies away from known vulnerable versions
|
|
68
|
+
|
|
69
|
+
## [1.2.3] - 2024-11-04
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
|
|
73
|
+
- Bug when using away mode switches
|
|
74
|
+
- Variable handling in some debug logging
|
|
75
|
+
|
|
76
|
+
## [1.2.2] - 2023-06-13
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- variable typo
|
|
81
|
+
|
|
82
|
+
## [1.2.1] - 2023-06-01
|
|
83
|
+
|
|
84
|
+
### Fixed
|
|
85
|
+
|
|
86
|
+
- hold length bug
|
|
87
|
+
|
|
88
|
+
## [1.2.0] - 2023-05-26
|
|
89
|
+
|
|
90
|
+
### Changed
|
|
91
|
+
|
|
92
|
+
- client secret for api auth
|
|
93
|
+
|
|
94
|
+
### Fixed
|
|
95
|
+
|
|
96
|
+
- async updates from the api to reduce cookie creation
|
|
97
|
+
|
|
98
|
+
## [1.1.4] - 2023-05-12
|
|
99
|
+
|
|
100
|
+
### Changed
|
|
101
|
+
|
|
102
|
+
- error handling when unable to get access token, as to not crash homebridge
|
|
103
|
+
|
|
104
|
+
## [1.1.3] - 2023-04-17
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- typo in away mode
|
|
109
|
+
|
|
110
|
+
## [1.1.2] - 2022-12-24
|
|
111
|
+
|
|
112
|
+
### Fixed
|
|
113
|
+
|
|
114
|
+
- some unhandled api auth error
|
|
115
|
+
|
|
116
|
+
### Changed
|
|
117
|
+
|
|
118
|
+
- some debug logging code
|
|
119
|
+
|
|
120
|
+
## [1.1.1] - 2022-11-17
|
|
121
|
+
|
|
122
|
+
### Fixed
|
|
123
|
+
|
|
124
|
+
- changed the 'homebridge-nuheat' name to be lower case so HOOBS handles properly
|
|
125
|
+
|
|
126
|
+
## [1.1.0] - 2022-11-15
|
|
127
|
+
|
|
128
|
+
### Added
|
|
129
|
+
|
|
130
|
+
- Added `homebridge-ui` support with auto detection
|
|
131
|
+
- Added Away Mode switches for groups
|
|
132
|
+
|
|
133
|
+
### Changed
|
|
134
|
+
|
|
135
|
+
- Changed the underlying API to use nuheats new api system
|
package/README.md
CHANGED
|
@@ -1,129 +1,163 @@
|
|
|
1
|
-
# homebridge-nuheat2
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/homebridge-nuheat2)
|
|
4
|
-
[](https://www.npmjs.com/package/homebridge-nuheat2)
|
|
5
|
-
|
|
1
|
+
# homebridge-nuheat2
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/homebridge-nuheat2)
|
|
4
|
+
[](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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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.
|