homebridge-nuheat2 1.2.4-beta.1 → 1.2.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 +102 -94
- package/LICENSE +21 -0
- package/README.md +125 -119
- package/config.schema.json +106 -106
- package/index.js +405 -434
- package/lib/NuHeatAPI.js +850 -854
- package/lib/NuHeatGroup.js +74 -74
- package/lib/NuHeatListener.js +132 -134
- package/lib/NuHeatModels.js +136 -136
- package/lib/NuHeatScheduleSwitch.js +69 -69
- package/lib/NuHeatThermostat.js +216 -216
- package/package.json +54 -51
package/CHANGELOG.md
CHANGED
|
@@ -1,102 +1,110 @@
|
|
|
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
|
-
|
|
9
|
-
### Added
|
|
10
|
-
|
|
11
|
-
- Swagger-aligned internal model helpers for account, thermostat, schedule, group, and energy responses
|
|
12
|
-
- Optional per-thermostat schedule switches that can resume schedule mode from HomeKit
|
|
13
|
-
- Account, schedule, and energy log API helpers for future UI and automation features
|
|
14
|
-
|
|
15
|
-
### Changed
|
|
16
|
-
|
|
17
|
-
- Simplify thermostat operating-mode handling to match the documented Nuheat Swagger model
|
|
18
|
-
- Refresh thermostats when Nuheat sends schedule notifications
|
|
19
|
-
|
|
20
|
-
## [1.2.4-beta.0] - 2026-04-11
|
|
21
|
-
|
|
22
|
-
### Changed
|
|
23
|
-
|
|
24
|
-
- Delay platform startup until Homebridge finishes restoring cached accessories
|
|
25
|
-
- Allow overriding Nuheat OAuth client settings through config or environment variables
|
|
26
|
-
- Improve SignalR reconnection handling and token refresh behavior
|
|
27
|
-
- Add basic regression tests and modernize package metadata for Homebridge 1.8+ and 2.0 betas
|
|
28
|
-
- Publish the maintained fork under the new npm package identity `homebridge-nuheat2`
|
|
29
|
-
|
|
30
|
-
### Fixed
|
|
31
|
-
|
|
32
|
-
- Correct manual-mode thermostat mapping so HomeKit no longer snaps back to off
|
|
33
|
-
- Fix thermostat online-state handling so status updates no longer rely on an assignment bug
|
|
34
|
-
- Pin transitive websocket and cookie dependencies away from known vulnerable versions
|
|
35
|
-
|
|
36
|
-
## [1.2.3] - 2024-11-04
|
|
37
|
-
|
|
38
|
-
### Fixed
|
|
39
|
-
|
|
40
|
-
- Bug when using away mode switches
|
|
41
|
-
- Variable handling in some debug logging
|
|
42
|
-
|
|
43
|
-
## [1.2.2] - 2023-06-13
|
|
44
|
-
|
|
45
|
-
### Fixed
|
|
46
|
-
|
|
47
|
-
- variable typo
|
|
48
|
-
|
|
49
|
-
## [1.2.1] - 2023-06-01
|
|
50
|
-
|
|
51
|
-
### Fixed
|
|
52
|
-
|
|
53
|
-
- hold length bug
|
|
54
|
-
|
|
55
|
-
## [1.2.0] - 2023-05-26
|
|
56
|
-
|
|
57
|
-
### Changed
|
|
58
|
-
|
|
59
|
-
- client secret for api auth
|
|
60
|
-
|
|
61
|
-
### Fixed
|
|
62
|
-
|
|
63
|
-
- async updates from the api to reduce cookie creation
|
|
64
|
-
|
|
65
|
-
## [1.1.4] - 2023-05-12
|
|
66
|
-
|
|
67
|
-
### Changed
|
|
68
|
-
|
|
69
|
-
- error handling when unable to get access token, as to not crash homebridge
|
|
70
|
-
|
|
71
|
-
## [1.1.3] - 2023-04-17
|
|
72
|
-
|
|
73
|
-
### Fixed
|
|
74
|
-
|
|
75
|
-
- typo in away mode
|
|
76
|
-
|
|
77
|
-
## [1.1.2] - 2022-12-24
|
|
78
|
-
|
|
79
|
-
### Fixed
|
|
80
|
-
|
|
81
|
-
- some unhandled api auth error
|
|
7
|
+
## [1.2.5] - 2026-04-11
|
|
82
8
|
|
|
83
9
|
### Changed
|
|
84
10
|
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
11
|
+
- Refactor platform accessory setup paths to reduce repeated lookups and simplify accessory updates
|
|
12
|
+
- Consolidate shared Homebridge test stubs into reusable helpers
|
|
13
|
+
- Restrict the test script to `*.test.js` files for cleaner local and CI output
|
|
88
14
|
|
|
89
15
|
### Fixed
|
|
90
16
|
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
17
|
+
- Improve SignalR notification tracing readability
|
|
18
|
+
- Correct setpoint debug log spacing in thermostat updates
|
|
19
|
+
|
|
20
|
+
## [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
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joshua Appleman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,123 +1,129 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- `
|
|
66
|
-
- `
|
|
67
|
-
- `
|
|
68
|
-
- `
|
|
69
|
-
- `
|
|
70
|
-
- `
|
|
71
|
-
- `
|
|
72
|
-
- `
|
|
73
|
-
- `
|
|
74
|
-
- `
|
|
75
|
-
- `
|
|
76
|
-
- `
|
|
77
|
-
- `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- `
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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.
|