node-red-contrib-octopus-intelligent 1.2.1 → 1.3.1

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
@@ -5,6 +5,97 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.3.1] — 2026-05-14
9
+
10
+ Critical hotfix for v1.3.0. Users on 1.3.0 should upgrade immediately.
11
+
12
+ ### Fixed
13
+ - **Intelligent category crash on numeric string inputs** — `flexPlannedDispatches.energyAddedKwh` is returned by the live Kraken API as a string. The intelligent category's reduce accumulator concatenated strings instead of summing, then called `.toFixed()` on the resulting string, raising `TypeError: totalEnergy.toFixed is not a function`. Whole intelligent payload section fell back to `defaultData` (null slot times, `total_energy: 0`, `next_kwh: "0"`), which surfaced in Home Assistant as "Error updating entity" for every intelligent sensor. Fixed by coercing `energyAddedKwh` via `parseFloat()` before arithmetic and formatting in `lib/categories/intelligent.js`, matching the pattern already used in `lib/categories/flex-planned-dispatches.js`. Added regression tests covering both positive and negative (export dispatch) string inputs.
14
+ - `next_kwh` now consistently formats with two decimal places (e.g. `"5.50"`, `"15.20"`) per the documented contract in README, HTML help, and `test-mocks.js`. The v1.3.0 path stripped trailing zeros via `String(parseFloat(...))` — that branch is unreachable now because it always crashed before reaching it, but the format is corrected for completeness.
15
+
16
+ ## [1.3.0] — 2026-05-12
17
+
18
+ Major additive release covering the full Octopus Energy consumer read surface. No breaking changes to v1.2.x payload fields, entity IDs, MQTT topics, input commands, or node config fields. All v1.2.x automations and dashboards continue to work unchanged.
19
+
20
+ ### Added — Electricity (import)
21
+ - `electricity_standing_charge` — daily standing charge (p/day)
22
+ - `electricity_unit_rate` — fixed unit rate (p/kWh); `null` on half-hourly tariffs
23
+ - `electricity_tariff_code`, `electricity_valid_from`, `electricity_valid_to`
24
+ - `electricity_consumption_kwh` — previous day import consumption
25
+ - `electricity_consumption_from`, `electricity_consumption_to` — period boundaries
26
+ - `applicable_rates`, `applicable_rates_count` — full 48-slot half-hourly schedule
27
+ - `applicable_rates_current_pence`, `applicable_rates_current_gbp` — live rate (use these on half-hourly tariffs)
28
+ - `applicable_rates_prev_pence/_gbp/_to`, `applicable_rates_next_pence/_gbp/_from` — adjacent slot rates and transition timestamps (payload-only; not currently exposed as MQTT entities — see README)
29
+
30
+ ### Added — Electricity (export)
31
+ - `electricity_export_standing_charge` — typically `0` for Agile Outgoing
32
+ - `electricity_export_unit_rate` — fixed; `null` on half-hourly export tariffs
33
+ - `electricity_export_tariff_code` (e.g. `AGILE-OUTGOING-19-05-13`), `electricity_export_valid_from`, `electricity_export_valid_to`
34
+ - `electricity_export_consumption_kwh`, `_from`, `_to` — previous day export from the export meter
35
+ - `electricity_export_rate`, `electricity_export_rate_count` — full 48-slot half-hourly export schedule
36
+ - `electricity_export_rate_current_pence/_gbp` — live export rate
37
+ - `electricity_export_rate_prev_pence/_to`, `electricity_export_rate_next_pence/_from` — adjacent export slot rates
38
+
39
+ ### Added — Gas
40
+ - `gas_standing_charge`, `gas_unit_rate`, `gas_tariff_code`, `gas_valid_from`, `gas_valid_to`
41
+ - `gas_consumption_kwh`, `gas_consumption_from`, `gas_consumption_to`
42
+
43
+ ### Added — Home Mini
44
+ - `mini_demand_kw` (kW, numeric) — real-time grid demand
45
+ - `mini_consumption_delta_kwh` (kWh, numeric) — half-hour period consumption
46
+ - `mini_read_at` — timestamp of most recent telemetry
47
+ - Opt-in via "Enable Home Mini" checkbox in node config
48
+
49
+ ### Added — Rewards
50
+ - `saving_session_available` (binary), `saving_session_start`, `saving_session_end`, `saving_session_joined`
51
+ - `free_electricity_active` (binary), `free_electricity_available` (binary), `free_electricity_start`, `free_electricity_end`
52
+ - `wheel_of_fortune_electricity_spins`, `wheel_of_fortune_gas_spins` — opt-in via node config checkbox
53
+ - `octoplus_enrolled` (binary sensor), `octoplus_enrollment_status` (string), `octoplus_loyalty_points_user` (binary sensor)
54
+
55
+ ### Added — Account & dispatches
56
+ - `account_balance_pounds`, `account_balance_pence`
57
+ - `completed_dispatches` (array), `completed_dispatches_count` — completed intelligent dispatch history
58
+ - `flex_planned_dispatches` (array), `flex_planned_dispatches_count` — upcoming flex dispatches (replaces deprecated `plannedDispatches`)
59
+
60
+ ### Added — Infrastructure
61
+ - **Account discovery** — automatic product detection at startup; categories auto-enable based on registered products and discover both import and export meter points by `direction`, not array position
62
+ - **Per-category poll intervals** — configurable in node editor for each data source
63
+ - **1-second clock-aligned category scheduler** — independent polling; one slow category doesn't block others
64
+
65
+ ### Changed
66
+ - **Octopus `wheelOfFortuneSpins` migrated to `wheelOfFortuneSpinsAllowed`** on `api.backend.octopus.energy` — the old field was deprecated and scheduled for removal 2026-04-20
67
+ - **Octopus `savingSessions` migrated to `api.backend.octopus.energy`** endpoint — the field was removed from the main endpoint
68
+ - **`octoplus_enrolled` and `octoplus_loyalty_points_user` now publish as `binary_sensor` instead of `sensor`** — these are boolean values and HA's sensor domain rejects raw booleans. **HA-side breaking change for users referencing the old `sensor.*` entity IDs**: update automations and dashboards to use `binary_sensor.*`. Payload field names (`msg.payload.octoplus_enrolled`, `msg.payload.octoplus_loyalty_points_user`) are unchanged.
69
+ - **`entity_category: config` removed** from read-only tariff/validity sensors (`electricity_unit_rate`, `electricity_tariff_code`, `electricity_valid_from/to`, `gas_*`, `electricity_export_*`, `saving_session_start/end`, `free_electricity_start/end`, `octoplus_enrollment_status`). These now appear in the main device entity list rather than a separate Configuration section. HA's `entity_category: config` is intended for user-configurable entities (switches, numbers, selects) — applying it to read-only sensors caused state to stick at "unavailable" on some installs.
70
+
71
+ ### Fixed
72
+ - **Import/export meter point selection** — discovery now selects meter points by the `direction` field (`IMPORT` or `EXPORT`), not array position. Earlier dev builds on accounts with both meters could surface export data as import (live "current rate" showing the export Agile rate instead of the import tariff). No stable v1.x release was affected; caught and fixed before v1.3.0 ship.
73
+ - **MQTT transport headers** — `lib/graphql.js` now sends `User-Agent: node-red-contrib-octopus-intelligent/<version>` on every request. Without it, `api.backend.octopus.energy` returns 403 at the edge — which previously surfaced as "WoF returns HTML" and silently broken saving sessions.
74
+ - **MQTT auth format** — uses raw JWT in the Authorization header (no `JWT ` prefix). Main endpoint accepts both; backend endpoint sub-resolvers require the raw form.
75
+ - **Saving sessions schema migration** — removed deprecated `octopoints` field from `SavingSessionsAccountType` query (Octopus moved loyalty points to the Octoplus query).
76
+ - **Gas tariff query fragments** — `GasTariffType` is an object type, not a union — removed inline fragments that caused "Fragment cannot be spread here" errors.
77
+
78
+ ### Unchanged (no breaking changes)
79
+ - All v1.2.x payload field names in `msg.payload`
80
+ - All v1.2.x MQTT topics, `unique_id` values, and HA entity IDs (except the Octoplus domain change noted above)
81
+ - All v1.2.x input commands: `set_limit`, `set_time`, `set_smart_charging`, `set_timezone`
82
+ - All v1.2.x node config fields: `accountNumber`, `apiKey`, `broker`, `enableMqtt`, `name`, `refreshInterval`, `timezoneOverride`
83
+ - Intelligent Octopus Go charging schedule, smart charging toggle, charging preferences
84
+
85
+ ---
86
+
87
+ ## [1.2.1] — 2026-04-29
88
+
89
+ ### Fixed
90
+ - **Deprecated API migration** — moved smart-charging verification from the deprecated `registeredKrakenflexDevice` query to the current `devices` query
91
+ - **Mutation migration** — `setVehicleChargePreferences` (deprecated) replaced with `setDevicePreferences` using the 7-day schedule input
92
+ - **Startup device fetch** — uses the current `devices` query instead of deprecated `registeredKrakenflexDevice`
93
+
94
+ ### Unchanged
95
+ - All v1.2.0 payload fields, MQTT topics, and entity IDs preserved
96
+
97
+ ---
98
+
8
99
  ## [1.2.0] - 2026-04-26
9
100
 
10
101
  ### Added