node-red-contrib-octopus-intelligent 1.5.0 → 1.6.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 +487 -442
- package/README.md +1004 -980
- package/examples/basic-monitoring.json +1 -1
- package/examples/ha-dashboard.yaml +602 -599
- package/examples/mqtt-integration.json +1 -1
- package/examples/node-red-dashboard-flow.json +1287 -1199
- package/examples/set-preferences.json +1 -1
- package/lib/api-metrics.js +31 -31
- package/lib/auth.js +20 -20
- package/lib/categories/account.js +32 -32
- package/lib/categories/applicable-rates.js +127 -127
- package/lib/categories/completed-dispatches.js +35 -35
- package/lib/categories/electricity.js +146 -146
- package/lib/categories/flex-planned-dispatches.js +36 -36
- package/lib/categories/free-electricity.js +61 -61
- package/lib/categories/gas.js +95 -95
- package/lib/categories/home-mini.js +37 -37
- package/lib/categories/intelligent.js +155 -124
- package/lib/categories/octoplus.js +32 -32
- package/lib/categories/saving-sessions.js +64 -64
- package/lib/categories/wheel-of-fortune.js +49 -49
- package/lib/commands.js +47 -0
- package/lib/discovery-retry.js +13 -0
- package/lib/discovery.js +92 -85
- package/lib/graphql-errors.js +18 -0
- package/lib/graphql.js +44 -44
- package/lib/http-get-json.js +22 -22
- package/lib/payload.js +89 -88
- package/lib/poll-tick.js +44 -44
- package/lib/preferences.js +32 -0
- package/lib/scheduler.js +47 -47
- package/lib/sensor-definitions.js +219 -0
- package/lib/timezone.js +49 -49
- package/lib/update-check.js +38 -38
- package/octopus-intelligent.html +218 -205
- package/octopus-intelligent.js +1687 -1807
- package/package.json +54 -54
|
@@ -1,1199 +1,1287 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "tab-octopus-main",
|
|
4
|
-
"type": "tab",
|
|
5
|
-
"label": "Octopus Intelligent Dashboard",
|
|
6
|
-
"disabled": false,
|
|
7
|
-
"info": "# Octopus Intelligent Dashboard 2.0 Example\n\nThis is a **teaching example** showing how to wire the `octopus-intelligent` node to a [@flowfuse/node-red-dashboard](https://github.com/FlowFuse/node-red-dashboard) (Dashboard 2.0) UI.\n\n## Setup\n\n1. Install `@flowfuse/node-red-dashboard` via the Node-RED Palette Manager.\n2. Open the **Octopus Intelligent** node and enter your real Account Number and API Key.\n3. Deploy, then open the dashboard at `http://<node-red-host>:1880/dashboard`.\n\n## Pages\n\n- **Controls** — writable controls that send commands back to the node's input port\n- **Status** — EV charging status, slots, and window\n- **Tariff** — current rates, rate stats, rate bands\n- **Optimization** — sample derivation logic on the `applicable_rates` array (see below)\n- **Account** — balance, Octoplus, Saving Sessions, Free Electricity, Home Mini\n- **Diagnostics** — API usage, version, per-category error list\n\n## Sample Function Nodes (USER-MODIFIABLE)\n\nThe **Optimization** page contains two function nodes marked `SAMPLE`. These are **not** part of the node's published payload — they demonstrate patterns for deriving custom values from `applicable_rates`. Edit them freely for your use case:\n\n- `find-cheapest-window`: Slides a configurable-duration window over the rate schedule to find the cheapest contiguous block starting in the future.\n- `is-cheapest-now`: Returns `true` when the current rate equals the day's minimum — useful as an automation trigger.\n\n## Writable Controls\n\nControls on the Controls page route back to the Octopus Intelligent node's **input** port via change nodes:\n\n| Control | Payload sent |\n|---|---|\n| Target Limit (number input) | `{ set_limit: <value> }` |\n| Ready By (dropdown) | `{ set_time: \"HH:MM\" }` |\n| Smart Charging (switch) | `{ set_smart_charging: true\\|false }` |\n| Refresh (button) | `{ refresh: true }` (any non-command object triggers refresh) |\n| Timezone (text input) | `{ set_timezone: \"Region/City\" }` |"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "ui-base-octopus",
|
|
11
|
-
"type": "ui-base",
|
|
12
|
-
"name": "Octopus Intelligent UI",
|
|
13
|
-
"path": "/dashboard",
|
|
14
|
-
"includeClientData": true,
|
|
15
|
-
"acceptsClientConfig": ["ui-notification", "ui-control"],
|
|
16
|
-
"showPathInSidebar": false,
|
|
17
|
-
"navigationStyle": "default",
|
|
18
|
-
"titleBarStyle": "default"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": "ui-page-controls",
|
|
22
|
-
"type": "ui-page",
|
|
23
|
-
"name": "Controls",
|
|
24
|
-
"ui": "ui-base-octopus",
|
|
25
|
-
"path": "/controls",
|
|
26
|
-
"icon": "mdi-tune",
|
|
27
|
-
"layout": "grid",
|
|
28
|
-
"theme": "ui-theme-default",
|
|
29
|
-
"order": 1,
|
|
30
|
-
"className": "",
|
|
31
|
-
"visible": true,
|
|
32
|
-
"disabled": false
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"id": "ui-page-status",
|
|
36
|
-
"type": "ui-page",
|
|
37
|
-
"name": "Status",
|
|
38
|
-
"ui": "ui-base-octopus",
|
|
39
|
-
"path": "/status",
|
|
40
|
-
"icon": "mdi-ev-station",
|
|
41
|
-
"layout": "grid",
|
|
42
|
-
"theme": "ui-theme-default",
|
|
43
|
-
"order": 2,
|
|
44
|
-
"className": "",
|
|
45
|
-
"visible": true,
|
|
46
|
-
"disabled": false
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"id": "ui-page-tariff",
|
|
50
|
-
"type": "ui-page",
|
|
51
|
-
"name": "Tariff",
|
|
52
|
-
"ui": "ui-base-octopus",
|
|
53
|
-
"path": "/tariff",
|
|
54
|
-
"icon": "mdi-cash-multiple",
|
|
55
|
-
"layout": "grid",
|
|
56
|
-
"theme": "ui-theme-default",
|
|
57
|
-
"order": 3,
|
|
58
|
-
"className": "",
|
|
59
|
-
"visible": true,
|
|
60
|
-
"disabled": false
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"id": "ui-page-optimization",
|
|
64
|
-
"type": "ui-page",
|
|
65
|
-
"name": "Optimization",
|
|
66
|
-
"ui": "ui-base-octopus",
|
|
67
|
-
"path": "/optimization",
|
|
68
|
-
"icon": "mdi-chart-line",
|
|
69
|
-
"layout": "grid",
|
|
70
|
-
"theme": "ui-theme-default",
|
|
71
|
-
"order": 4,
|
|
72
|
-
"className": "",
|
|
73
|
-
"visible": true,
|
|
74
|
-
"disabled": false
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"id": "ui-page-account",
|
|
78
|
-
"type": "ui-page",
|
|
79
|
-
"name": "Account",
|
|
80
|
-
"ui": "ui-base-octopus",
|
|
81
|
-
"path": "/account",
|
|
82
|
-
"icon": "mdi-account",
|
|
83
|
-
"layout": "grid",
|
|
84
|
-
"theme": "ui-theme-default",
|
|
85
|
-
"order": 5,
|
|
86
|
-
"className": "",
|
|
87
|
-
"visible": true,
|
|
88
|
-
"disabled": false
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"id": "ui-page-diagnostics",
|
|
92
|
-
"type": "ui-page",
|
|
93
|
-
"name": "Diagnostics",
|
|
94
|
-
"ui": "ui-base-octopus",
|
|
95
|
-
"path": "/diagnostics",
|
|
96
|
-
"icon": "mdi-stethoscope",
|
|
97
|
-
"layout": "grid",
|
|
98
|
-
"theme": "ui-theme-default",
|
|
99
|
-
"order": 6,
|
|
100
|
-
"className": "",
|
|
101
|
-
"visible": true,
|
|
102
|
-
"disabled": false
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"id": "ui-group-controls-ev",
|
|
106
|
-
"type": "ui-group",
|
|
107
|
-
"name": "EV Charging Controls",
|
|
108
|
-
"page": "ui-page-controls",
|
|
109
|
-
"width": "6",
|
|
110
|
-
"height": "1",
|
|
111
|
-
"order": 1,
|
|
112
|
-
"showTitle": true,
|
|
113
|
-
"className": "",
|
|
114
|
-
"visible": true,
|
|
115
|
-
"disabled": false
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"id": "ui-group-controls-sys",
|
|
119
|
-
"type": "ui-group",
|
|
120
|
-
"name": "System",
|
|
121
|
-
"page": "ui-page-controls",
|
|
122
|
-
"width": "6",
|
|
123
|
-
"height": "1",
|
|
124
|
-
"order": 2,
|
|
125
|
-
"showTitle": true,
|
|
126
|
-
"className": "",
|
|
127
|
-
"visible": true,
|
|
128
|
-
"disabled": false
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"id": "ui-group-status-main",
|
|
132
|
-
"type": "ui-group",
|
|
133
|
-
"name": "Charging Status",
|
|
134
|
-
"page": "ui-page-status",
|
|
135
|
-
"width": "6",
|
|
136
|
-
"height": "1",
|
|
137
|
-
"order": 1,
|
|
138
|
-
"showTitle": true,
|
|
139
|
-
"className": "",
|
|
140
|
-
"visible": true,
|
|
141
|
-
"disabled": false
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"id": "ui-group-status-slots",
|
|
145
|
-
"type": "ui-group",
|
|
146
|
-
"name": "Charging Slots",
|
|
147
|
-
"page": "ui-page-status",
|
|
148
|
-
"width": "6",
|
|
149
|
-
"height": "1",
|
|
150
|
-
"order": 2,
|
|
151
|
-
"showTitle": true,
|
|
152
|
-
"className": "",
|
|
153
|
-
"visible": true,
|
|
154
|
-
"disabled": false
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"id": "ui-group-tariff-current",
|
|
158
|
-
"type": "ui-group",
|
|
159
|
-
"name": "Current Rates",
|
|
160
|
-
"page": "ui-page-tariff",
|
|
161
|
-
"width": "6",
|
|
162
|
-
"height": "1",
|
|
163
|
-
"order": 1,
|
|
164
|
-
"showTitle": true,
|
|
165
|
-
"className": "",
|
|
166
|
-
"visible": true,
|
|
167
|
-
"disabled": false
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"id": "ui-group-tariff-stats",
|
|
171
|
-
"type": "ui-group",
|
|
172
|
-
"name": "Rate Statistics (24h)",
|
|
173
|
-
"page": "ui-page-tariff",
|
|
174
|
-
"width": "6",
|
|
175
|
-
"height": "1",
|
|
176
|
-
"order": 2,
|
|
177
|
-
"showTitle": true,
|
|
178
|
-
"className": "",
|
|
179
|
-
"visible": true,
|
|
180
|
-
"disabled": false
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"id": "ui-group-tariff-bands",
|
|
184
|
-
"type": "ui-group",
|
|
185
|
-
"name": "Rate Bands",
|
|
186
|
-
"page": "ui-page-tariff",
|
|
187
|
-
"width": "6",
|
|
188
|
-
"height": "1",
|
|
189
|
-
"order": 3,
|
|
190
|
-
"showTitle": true,
|
|
191
|
-
"className": "",
|
|
192
|
-
"visible": true,
|
|
193
|
-
"disabled": false
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"id": "ui-group-opt-schedule",
|
|
197
|
-
"type": "ui-group",
|
|
198
|
-
"name": "Rate Schedule",
|
|
199
|
-
"page": "ui-page-optimization",
|
|
200
|
-
"width": "12",
|
|
201
|
-
"height": "1",
|
|
202
|
-
"order": 1,
|
|
203
|
-
"showTitle": true,
|
|
204
|
-
"className": "",
|
|
205
|
-
"visible": true,
|
|
206
|
-
"disabled": false
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"id": "ui-group-opt-samples",
|
|
210
|
-
"type": "ui-group",
|
|
211
|
-
"name": "Sample Derivations (User-Modifiable)",
|
|
212
|
-
"page": "ui-page-optimization",
|
|
213
|
-
"width": "12",
|
|
214
|
-
"height": "1",
|
|
215
|
-
"order": 2,
|
|
216
|
-
"showTitle": true,
|
|
217
|
-
"className": "",
|
|
218
|
-
"visible": true,
|
|
219
|
-
"disabled": false
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"id": "ui-group-account-main",
|
|
223
|
-
"type": "ui-group",
|
|
224
|
-
"name": "Account & Rewards",
|
|
225
|
-
"page": "ui-page-account",
|
|
226
|
-
"width": "6",
|
|
227
|
-
"height": "1",
|
|
228
|
-
"order": 1,
|
|
229
|
-
"showTitle": true,
|
|
230
|
-
"className": "",
|
|
231
|
-
"visible": true,
|
|
232
|
-
"disabled": false
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"id": "ui-group-account-mini",
|
|
236
|
-
"type": "ui-group",
|
|
237
|
-
"name": "Home Mini Live",
|
|
238
|
-
"page": "ui-page-account",
|
|
239
|
-
"width": "6",
|
|
240
|
-
"height": "1",
|
|
241
|
-
"order": 2,
|
|
242
|
-
"showTitle": true,
|
|
243
|
-
"className": "",
|
|
244
|
-
"visible": true,
|
|
245
|
-
"disabled": false
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"id": "ui-group-diag-main",
|
|
249
|
-
"type": "ui-group",
|
|
250
|
-
"name": "API & System",
|
|
251
|
-
"page": "ui-page-diagnostics",
|
|
252
|
-
"width": "6",
|
|
253
|
-
"height": "1",
|
|
254
|
-
"order": 1,
|
|
255
|
-
"showTitle": true,
|
|
256
|
-
"className": "",
|
|
257
|
-
"visible": true,
|
|
258
|
-
"disabled": false
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
"id": "ui-group-diag-errors",
|
|
262
|
-
"type": "ui-group",
|
|
263
|
-
"name": "Category Errors",
|
|
264
|
-
"page": "ui-page-diagnostics",
|
|
265
|
-
"width": "6",
|
|
266
|
-
"height": "1",
|
|
267
|
-
"order": 2,
|
|
268
|
-
"showTitle": true,
|
|
269
|
-
"className": "",
|
|
270
|
-
"visible": true,
|
|
271
|
-
"disabled": false
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
"id": "node-octopus-main",
|
|
275
|
-
"type": "octopus-intelligent",
|
|
276
|
-
"name": "Octopus Intelligent",
|
|
277
|
-
"z": "tab-octopus-main",
|
|
278
|
-
"accountNumber": "A-XXXXXXXX",
|
|
279
|
-
"refreshInterval": "5",
|
|
280
|
-
"enableMqtt": false,
|
|
281
|
-
"timezoneOverride": "",
|
|
282
|
-
"x": 200,
|
|
283
|
-
"y": 100,
|
|
284
|
-
"wires": [
|
|
285
|
-
[
|
|
286
|
-
"fn-route-pages",
|
|
287
|
-
"fn-find-cheapest-window",
|
|
288
|
-
"fn-is-cheapest-now"
|
|
289
|
-
]
|
|
290
|
-
]
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"id": "fn-route-pages",
|
|
294
|
-
"type": "function",
|
|
295
|
-
"name": "Fan out to all page branches",
|
|
296
|
-
"z": "tab-octopus-main",
|
|
297
|
-
"func": "// Distributes the full payload to every page branch.\n// Node-RED sends the same msg to all wires listed — widgets and\n// extractor functions each receive msg.payload intact.\nreturn msg;",
|
|
298
|
-
"outputs": 1,
|
|
299
|
-
"noerr": 0,
|
|
300
|
-
"initialize": "",
|
|
301
|
-
"finalize": "",
|
|
302
|
-
"libs": [],
|
|
303
|
-
"x": 470,
|
|
304
|
-
"y": 100,
|
|
305
|
-
"wires": [
|
|
306
|
-
[
|
|
307
|
-
"fn-controls-status",
|
|
308
|
-
"
|
|
309
|
-
"widget-status-
|
|
310
|
-
"widget-status-
|
|
311
|
-
"widget-status-confirmed-
|
|
312
|
-
"widget-status-
|
|
313
|
-
"widget-status-
|
|
314
|
-
"
|
|
315
|
-
"fn-extract-
|
|
316
|
-
"
|
|
317
|
-
"widget-tariff-
|
|
318
|
-
"widget-
|
|
319
|
-
"widget-
|
|
320
|
-
"widget-
|
|
321
|
-
"widget-account-
|
|
322
|
-
"widget-account-
|
|
323
|
-
"widget-account-
|
|
324
|
-
"widget-account-
|
|
325
|
-
"
|
|
326
|
-
"
|
|
327
|
-
"widget-
|
|
328
|
-
"
|
|
329
|
-
"
|
|
330
|
-
"widget-diag-
|
|
331
|
-
"widget-diag-
|
|
332
|
-
"widget-diag-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
"
|
|
339
|
-
"
|
|
340
|
-
"
|
|
341
|
-
"
|
|
342
|
-
"
|
|
343
|
-
"
|
|
344
|
-
"
|
|
345
|
-
"
|
|
346
|
-
"
|
|
347
|
-
"
|
|
348
|
-
"
|
|
349
|
-
"
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
"
|
|
354
|
-
"
|
|
355
|
-
"
|
|
356
|
-
"
|
|
357
|
-
"
|
|
358
|
-
"
|
|
359
|
-
"
|
|
360
|
-
"
|
|
361
|
-
"
|
|
362
|
-
"
|
|
363
|
-
"
|
|
364
|
-
"
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
"
|
|
369
|
-
"
|
|
370
|
-
"
|
|
371
|
-
"
|
|
372
|
-
"
|
|
373
|
-
"
|
|
374
|
-
"
|
|
375
|
-
"
|
|
376
|
-
"
|
|
377
|
-
"
|
|
378
|
-
"
|
|
379
|
-
"
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
"
|
|
384
|
-
"
|
|
385
|
-
"
|
|
386
|
-
"
|
|
387
|
-
"
|
|
388
|
-
"
|
|
389
|
-
"
|
|
390
|
-
"
|
|
391
|
-
"
|
|
392
|
-
"
|
|
393
|
-
"
|
|
394
|
-
"
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
"
|
|
399
|
-
"
|
|
400
|
-
"
|
|
401
|
-
"
|
|
402
|
-
"
|
|
403
|
-
"
|
|
404
|
-
"
|
|
405
|
-
"
|
|
406
|
-
"
|
|
407
|
-
"
|
|
408
|
-
"
|
|
409
|
-
"
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
"
|
|
414
|
-
"
|
|
415
|
-
"
|
|
416
|
-
"
|
|
417
|
-
"
|
|
418
|
-
"
|
|
419
|
-
"
|
|
420
|
-
"
|
|
421
|
-
"
|
|
422
|
-
"
|
|
423
|
-
"
|
|
424
|
-
"
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
"
|
|
429
|
-
"
|
|
430
|
-
"
|
|
431
|
-
"
|
|
432
|
-
"
|
|
433
|
-
"
|
|
434
|
-
"
|
|
435
|
-
"
|
|
436
|
-
"
|
|
437
|
-
"
|
|
438
|
-
"
|
|
439
|
-
"
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
"
|
|
444
|
-
"
|
|
445
|
-
"
|
|
446
|
-
"
|
|
447
|
-
"
|
|
448
|
-
"
|
|
449
|
-
"
|
|
450
|
-
"
|
|
451
|
-
"
|
|
452
|
-
"
|
|
453
|
-
"x":
|
|
454
|
-
"y":
|
|
455
|
-
"wires": [["
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
"id": "
|
|
459
|
-
"type": "
|
|
460
|
-
"
|
|
461
|
-
"
|
|
462
|
-
"
|
|
463
|
-
"
|
|
464
|
-
"
|
|
465
|
-
"
|
|
466
|
-
"
|
|
467
|
-
"
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
"
|
|
474
|
-
"
|
|
475
|
-
"
|
|
476
|
-
"
|
|
477
|
-
"
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
"
|
|
481
|
-
"
|
|
482
|
-
"
|
|
483
|
-
"
|
|
484
|
-
"
|
|
485
|
-
"
|
|
486
|
-
"
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
"
|
|
490
|
-
"
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
"
|
|
512
|
-
"
|
|
513
|
-
"
|
|
514
|
-
"
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
"
|
|
518
|
-
"
|
|
519
|
-
"
|
|
520
|
-
"
|
|
521
|
-
"
|
|
522
|
-
"
|
|
523
|
-
"
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
"
|
|
574
|
-
"
|
|
575
|
-
"
|
|
576
|
-
"
|
|
577
|
-
"
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
"
|
|
583
|
-
"
|
|
584
|
-
"
|
|
585
|
-
"
|
|
586
|
-
"
|
|
587
|
-
"
|
|
588
|
-
"
|
|
589
|
-
"
|
|
590
|
-
"
|
|
591
|
-
"
|
|
592
|
-
"
|
|
593
|
-
"
|
|
594
|
-
"
|
|
595
|
-
"
|
|
596
|
-
"
|
|
597
|
-
"
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
"
|
|
601
|
-
"
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
"
|
|
605
|
-
"
|
|
606
|
-
"
|
|
607
|
-
"
|
|
608
|
-
"
|
|
609
|
-
"
|
|
610
|
-
"
|
|
611
|
-
"
|
|
612
|
-
"
|
|
613
|
-
"
|
|
614
|
-
"
|
|
615
|
-
"
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
"
|
|
619
|
-
"
|
|
620
|
-
"
|
|
621
|
-
"
|
|
622
|
-
"
|
|
623
|
-
"
|
|
624
|
-
"
|
|
625
|
-
"
|
|
626
|
-
"
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
"
|
|
630
|
-
"
|
|
631
|
-
"
|
|
632
|
-
"
|
|
633
|
-
"
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
"
|
|
637
|
-
"
|
|
638
|
-
"
|
|
639
|
-
"
|
|
640
|
-
"
|
|
641
|
-
"
|
|
642
|
-
"
|
|
643
|
-
"
|
|
644
|
-
"
|
|
645
|
-
"
|
|
646
|
-
"
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
"
|
|
650
|
-
"
|
|
651
|
-
"
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
"
|
|
655
|
-
"
|
|
656
|
-
"
|
|
657
|
-
"
|
|
658
|
-
"
|
|
659
|
-
"
|
|
660
|
-
"
|
|
661
|
-
"
|
|
662
|
-
"
|
|
663
|
-
"
|
|
664
|
-
"
|
|
665
|
-
"
|
|
666
|
-
"
|
|
667
|
-
"
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
"
|
|
673
|
-
"
|
|
674
|
-
"
|
|
675
|
-
"
|
|
676
|
-
"
|
|
677
|
-
"
|
|
678
|
-
"
|
|
679
|
-
"
|
|
680
|
-
"
|
|
681
|
-
"
|
|
682
|
-
"
|
|
683
|
-
"
|
|
684
|
-
"
|
|
685
|
-
"
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
"
|
|
691
|
-
"
|
|
692
|
-
"
|
|
693
|
-
"
|
|
694
|
-
"
|
|
695
|
-
"
|
|
696
|
-
"
|
|
697
|
-
"
|
|
698
|
-
"
|
|
699
|
-
"
|
|
700
|
-
"
|
|
701
|
-
"
|
|
702
|
-
"
|
|
703
|
-
"
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
"
|
|
709
|
-
"
|
|
710
|
-
"
|
|
711
|
-
"
|
|
712
|
-
"
|
|
713
|
-
"
|
|
714
|
-
"
|
|
715
|
-
"
|
|
716
|
-
"
|
|
717
|
-
"
|
|
718
|
-
"
|
|
719
|
-
"
|
|
720
|
-
"
|
|
721
|
-
"
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
"
|
|
725
|
-
"
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
"
|
|
729
|
-
"
|
|
730
|
-
"
|
|
731
|
-
"
|
|
732
|
-
"
|
|
733
|
-
"
|
|
734
|
-
"
|
|
735
|
-
"
|
|
736
|
-
"
|
|
737
|
-
"
|
|
738
|
-
"
|
|
739
|
-
"
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
"
|
|
743
|
-
"
|
|
744
|
-
"
|
|
745
|
-
"
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
"
|
|
751
|
-
"
|
|
752
|
-
"
|
|
753
|
-
"
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
"
|
|
757
|
-
"
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
"
|
|
761
|
-
"
|
|
762
|
-
"
|
|
763
|
-
"
|
|
764
|
-
"
|
|
765
|
-
"
|
|
766
|
-
"
|
|
767
|
-
"
|
|
768
|
-
"
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
"
|
|
772
|
-
"
|
|
773
|
-
"
|
|
774
|
-
"
|
|
775
|
-
"
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
"
|
|
779
|
-
"
|
|
780
|
-
"
|
|
781
|
-
"
|
|
782
|
-
"
|
|
783
|
-
"
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
"
|
|
787
|
-
"
|
|
788
|
-
"
|
|
789
|
-
"
|
|
790
|
-
"
|
|
791
|
-
"
|
|
792
|
-
"
|
|
793
|
-
"
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
"
|
|
797
|
-
"
|
|
798
|
-
"
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
"
|
|
802
|
-
"
|
|
803
|
-
"
|
|
804
|
-
"
|
|
805
|
-
"
|
|
806
|
-
"
|
|
807
|
-
"
|
|
808
|
-
"
|
|
809
|
-
"
|
|
810
|
-
"
|
|
811
|
-
"x":
|
|
812
|
-
"y":
|
|
813
|
-
"wires": [[
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
"id": "widget-tariff-
|
|
817
|
-
"type": "ui-gauge",
|
|
818
|
-
"z": "tab-octopus-main",
|
|
819
|
-
"group": "ui-group-tariff-current",
|
|
820
|
-
"name": "
|
|
821
|
-
"label": "
|
|
822
|
-
"order":
|
|
823
|
-
"width": "3",
|
|
824
|
-
"height": "3",
|
|
825
|
-
"gtype": "gauge-half",
|
|
826
|
-
"gstyle": "needle",
|
|
827
|
-
"topic": "",
|
|
828
|
-
"topicType": "str",
|
|
829
|
-
"units": "p/kWh",
|
|
830
|
-
"format": "{{value}}",
|
|
831
|
-
"min": "0",
|
|
832
|
-
"max": "
|
|
833
|
-
"segments": [
|
|
834
|
-
{"color": "#
|
|
835
|
-
{"color": "#FFA726", "from": "
|
|
836
|
-
{"color": "#
|
|
837
|
-
],
|
|
838
|
-
"className": "",
|
|
839
|
-
"x": 970,
|
|
840
|
-
"y":
|
|
841
|
-
"wires": []
|
|
842
|
-
},
|
|
843
|
-
{
|
|
844
|
-
"id": "
|
|
845
|
-
"type": "
|
|
846
|
-
"
|
|
847
|
-
"
|
|
848
|
-
"
|
|
849
|
-
"
|
|
850
|
-
"
|
|
851
|
-
"
|
|
852
|
-
"
|
|
853
|
-
"
|
|
854
|
-
"
|
|
855
|
-
"
|
|
856
|
-
"
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
"
|
|
860
|
-
"
|
|
861
|
-
"
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
"
|
|
865
|
-
"
|
|
866
|
-
"
|
|
867
|
-
"
|
|
868
|
-
"
|
|
869
|
-
"
|
|
870
|
-
"
|
|
871
|
-
"
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
"
|
|
875
|
-
"
|
|
876
|
-
"
|
|
877
|
-
"
|
|
878
|
-
"
|
|
879
|
-
"
|
|
880
|
-
"
|
|
881
|
-
"
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
"
|
|
885
|
-
"
|
|
886
|
-
"
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
"
|
|
890
|
-
"
|
|
891
|
-
"
|
|
892
|
-
"
|
|
893
|
-
"
|
|
894
|
-
"
|
|
895
|
-
"
|
|
896
|
-
"
|
|
897
|
-
"
|
|
898
|
-
"
|
|
899
|
-
"x":
|
|
900
|
-
"y":
|
|
901
|
-
"wires": [[]]
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
"id": "widget-
|
|
905
|
-
"type": "ui-
|
|
906
|
-
"z": "tab-octopus-main",
|
|
907
|
-
"group": "ui-group-
|
|
908
|
-
"name": "
|
|
909
|
-
"
|
|
910
|
-
"
|
|
911
|
-
"
|
|
912
|
-
"
|
|
913
|
-
"
|
|
914
|
-
"
|
|
915
|
-
"
|
|
916
|
-
"
|
|
917
|
-
"
|
|
918
|
-
"
|
|
919
|
-
"
|
|
920
|
-
"
|
|
921
|
-
"
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
"
|
|
927
|
-
"
|
|
928
|
-
"
|
|
929
|
-
"
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
"
|
|
933
|
-
"
|
|
934
|
-
"
|
|
935
|
-
"
|
|
936
|
-
"
|
|
937
|
-
"
|
|
938
|
-
"
|
|
939
|
-
"
|
|
940
|
-
"
|
|
941
|
-
"
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
"
|
|
945
|
-
"
|
|
946
|
-
"
|
|
947
|
-
"
|
|
948
|
-
"
|
|
949
|
-
"
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
"
|
|
953
|
-
"
|
|
954
|
-
"
|
|
955
|
-
"
|
|
956
|
-
"
|
|
957
|
-
"
|
|
958
|
-
"
|
|
959
|
-
"
|
|
960
|
-
|
|
961
|
-
{
|
|
962
|
-
"
|
|
963
|
-
"
|
|
964
|
-
"
|
|
965
|
-
"
|
|
966
|
-
"
|
|
967
|
-
"
|
|
968
|
-
"
|
|
969
|
-
"
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
"
|
|
973
|
-
"
|
|
974
|
-
"
|
|
975
|
-
"
|
|
976
|
-
"
|
|
977
|
-
"
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
"
|
|
981
|
-
"
|
|
982
|
-
"
|
|
983
|
-
"
|
|
984
|
-
"
|
|
985
|
-
"
|
|
986
|
-
"
|
|
987
|
-
"
|
|
988
|
-
"
|
|
989
|
-
"
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
"
|
|
993
|
-
"
|
|
994
|
-
"
|
|
995
|
-
"
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
"
|
|
999
|
-
"
|
|
1000
|
-
"
|
|
1001
|
-
"
|
|
1002
|
-
"
|
|
1003
|
-
"
|
|
1004
|
-
"
|
|
1005
|
-
"
|
|
1006
|
-
"
|
|
1007
|
-
"
|
|
1008
|
-
"
|
|
1009
|
-
"
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
"
|
|
1013
|
-
"
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
"
|
|
1017
|
-
"
|
|
1018
|
-
"
|
|
1019
|
-
"
|
|
1020
|
-
"
|
|
1021
|
-
"
|
|
1022
|
-
"
|
|
1023
|
-
"
|
|
1024
|
-
"
|
|
1025
|
-
"
|
|
1026
|
-
"
|
|
1027
|
-
"
|
|
1028
|
-
"
|
|
1029
|
-
"
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
"
|
|
1035
|
-
"
|
|
1036
|
-
"
|
|
1037
|
-
"
|
|
1038
|
-
"
|
|
1039
|
-
"
|
|
1040
|
-
"
|
|
1041
|
-
"
|
|
1042
|
-
"
|
|
1043
|
-
"
|
|
1044
|
-
"
|
|
1045
|
-
"
|
|
1046
|
-
"
|
|
1047
|
-
"
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
"
|
|
1051
|
-
"
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
"
|
|
1057
|
-
"
|
|
1058
|
-
"
|
|
1059
|
-
"
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
"
|
|
1063
|
-
"
|
|
1064
|
-
"
|
|
1065
|
-
"
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
"
|
|
1069
|
-
"
|
|
1070
|
-
"
|
|
1071
|
-
"
|
|
1072
|
-
"
|
|
1073
|
-
"
|
|
1074
|
-
"
|
|
1075
|
-
"
|
|
1076
|
-
"
|
|
1077
|
-
"
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
"
|
|
1081
|
-
"
|
|
1082
|
-
"
|
|
1083
|
-
"
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
"
|
|
1087
|
-
"
|
|
1088
|
-
"
|
|
1089
|
-
"
|
|
1090
|
-
"
|
|
1091
|
-
"
|
|
1092
|
-
"
|
|
1093
|
-
"
|
|
1094
|
-
"
|
|
1095
|
-
"
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
"
|
|
1099
|
-
"
|
|
1100
|
-
"
|
|
1101
|
-
"
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
"
|
|
1105
|
-
"
|
|
1106
|
-
"
|
|
1107
|
-
"
|
|
1108
|
-
"
|
|
1109
|
-
"
|
|
1110
|
-
"
|
|
1111
|
-
"
|
|
1112
|
-
"
|
|
1113
|
-
"
|
|
1114
|
-
"
|
|
1115
|
-
"
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
]
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
"
|
|
1123
|
-
"
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
"
|
|
1127
|
-
"
|
|
1128
|
-
"
|
|
1129
|
-
"
|
|
1130
|
-
"
|
|
1131
|
-
"
|
|
1132
|
-
"
|
|
1133
|
-
"
|
|
1134
|
-
"
|
|
1135
|
-
"
|
|
1136
|
-
"
|
|
1137
|
-
"
|
|
1138
|
-
"
|
|
1139
|
-
"
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
"
|
|
1145
|
-
"
|
|
1146
|
-
"
|
|
1147
|
-
"
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
"
|
|
1151
|
-
"
|
|
1152
|
-
"
|
|
1153
|
-
"
|
|
1154
|
-
"
|
|
1155
|
-
"
|
|
1156
|
-
"
|
|
1157
|
-
"
|
|
1158
|
-
"
|
|
1159
|
-
"
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
"
|
|
1163
|
-
"
|
|
1164
|
-
"
|
|
1165
|
-
"
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
"
|
|
1169
|
-
"
|
|
1170
|
-
"
|
|
1171
|
-
"
|
|
1172
|
-
"
|
|
1173
|
-
"
|
|
1174
|
-
"
|
|
1175
|
-
"
|
|
1176
|
-
"
|
|
1177
|
-
"
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
"
|
|
1181
|
-
"
|
|
1182
|
-
"
|
|
1183
|
-
"
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
"
|
|
1187
|
-
"
|
|
1188
|
-
"
|
|
1189
|
-
"
|
|
1190
|
-
"
|
|
1191
|
-
"
|
|
1192
|
-
"
|
|
1193
|
-
"
|
|
1194
|
-
"
|
|
1195
|
-
"
|
|
1196
|
-
"
|
|
1197
|
-
"
|
|
1198
|
-
|
|
1199
|
-
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "tab-octopus-main",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "Octopus Intelligent Dashboard",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "# Octopus Intelligent Dashboard 2.0 Example\n\nThis is a **teaching example** showing how to wire the `octopus-intelligent` node to a [@flowfuse/node-red-dashboard](https://github.com/FlowFuse/node-red-dashboard) (Dashboard 2.0) UI.\n\n## Setup\n\n1. Install `@flowfuse/node-red-dashboard` via the Node-RED Palette Manager.\n2. Open the **Octopus Intelligent** node and enter your real Account Number and API Key.\n3. Deploy, then open the dashboard at `http://<node-red-host>:1880/dashboard`.\n\n## Pages\n\n- **Controls** — writable controls that send commands back to the node's input port\n- **Status** — EV charging status, slots, and window\n- **Tariff** — current rates, rate stats, rate bands\n- **Optimization** — sample derivation logic on the `applicable_rates` array (see below)\n- **Account** — balance, Octoplus, Saving Sessions, Free Electricity, Home Mini\n- **Diagnostics** — API usage, version, per-category error list\n\n## Sample Function Nodes (USER-MODIFIABLE)\n\nThe **Optimization** page contains two function nodes marked `SAMPLE`. These are **not** part of the node's published payload — they demonstrate patterns for deriving custom values from `applicable_rates`. Edit them freely for your use case:\n\n- `find-cheapest-window`: Slides a configurable-duration window over the rate schedule to find the cheapest contiguous block starting in the future.\n- `is-cheapest-now`: Returns `true` when the current rate equals the day's minimum — useful as an automation trigger.\n\n## Writable Controls\n\nControls on the Controls page route back to the Octopus Intelligent node's **input** port via change nodes:\n\n| Control | Payload sent |\n|---|---|\n| Target Limit (number input) | `{ set_limit: <value> }` |\n| Ready By (dropdown) | `{ set_time: \"HH:MM\" }` |\n| Smart Charging (switch) | `{ set_smart_charging: true\\|false }` |\n| Charge Cap (switch) | `{ set_charge_cap: true\\|false }`, state follows `charge_cap` |\n| Refresh (button) | `{ refresh: true }` (any non-command object triggers refresh) |\n| Timezone (text input) | `{ set_timezone: \"Region/City\" }` |"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "ui-base-octopus",
|
|
11
|
+
"type": "ui-base",
|
|
12
|
+
"name": "Octopus Intelligent UI",
|
|
13
|
+
"path": "/dashboard",
|
|
14
|
+
"includeClientData": true,
|
|
15
|
+
"acceptsClientConfig": ["ui-notification", "ui-control"],
|
|
16
|
+
"showPathInSidebar": false,
|
|
17
|
+
"navigationStyle": "default",
|
|
18
|
+
"titleBarStyle": "default"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "ui-page-controls",
|
|
22
|
+
"type": "ui-page",
|
|
23
|
+
"name": "Controls",
|
|
24
|
+
"ui": "ui-base-octopus",
|
|
25
|
+
"path": "/controls",
|
|
26
|
+
"icon": "mdi-tune",
|
|
27
|
+
"layout": "grid",
|
|
28
|
+
"theme": "ui-theme-default",
|
|
29
|
+
"order": 1,
|
|
30
|
+
"className": "",
|
|
31
|
+
"visible": true,
|
|
32
|
+
"disabled": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "ui-page-status",
|
|
36
|
+
"type": "ui-page",
|
|
37
|
+
"name": "Status",
|
|
38
|
+
"ui": "ui-base-octopus",
|
|
39
|
+
"path": "/status",
|
|
40
|
+
"icon": "mdi-ev-station",
|
|
41
|
+
"layout": "grid",
|
|
42
|
+
"theme": "ui-theme-default",
|
|
43
|
+
"order": 2,
|
|
44
|
+
"className": "",
|
|
45
|
+
"visible": true,
|
|
46
|
+
"disabled": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "ui-page-tariff",
|
|
50
|
+
"type": "ui-page",
|
|
51
|
+
"name": "Tariff",
|
|
52
|
+
"ui": "ui-base-octopus",
|
|
53
|
+
"path": "/tariff",
|
|
54
|
+
"icon": "mdi-cash-multiple",
|
|
55
|
+
"layout": "grid",
|
|
56
|
+
"theme": "ui-theme-default",
|
|
57
|
+
"order": 3,
|
|
58
|
+
"className": "",
|
|
59
|
+
"visible": true,
|
|
60
|
+
"disabled": false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "ui-page-optimization",
|
|
64
|
+
"type": "ui-page",
|
|
65
|
+
"name": "Optimization",
|
|
66
|
+
"ui": "ui-base-octopus",
|
|
67
|
+
"path": "/optimization",
|
|
68
|
+
"icon": "mdi-chart-line",
|
|
69
|
+
"layout": "grid",
|
|
70
|
+
"theme": "ui-theme-default",
|
|
71
|
+
"order": 4,
|
|
72
|
+
"className": "",
|
|
73
|
+
"visible": true,
|
|
74
|
+
"disabled": false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "ui-page-account",
|
|
78
|
+
"type": "ui-page",
|
|
79
|
+
"name": "Account",
|
|
80
|
+
"ui": "ui-base-octopus",
|
|
81
|
+
"path": "/account",
|
|
82
|
+
"icon": "mdi-account",
|
|
83
|
+
"layout": "grid",
|
|
84
|
+
"theme": "ui-theme-default",
|
|
85
|
+
"order": 5,
|
|
86
|
+
"className": "",
|
|
87
|
+
"visible": true,
|
|
88
|
+
"disabled": false
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "ui-page-diagnostics",
|
|
92
|
+
"type": "ui-page",
|
|
93
|
+
"name": "Diagnostics",
|
|
94
|
+
"ui": "ui-base-octopus",
|
|
95
|
+
"path": "/diagnostics",
|
|
96
|
+
"icon": "mdi-stethoscope",
|
|
97
|
+
"layout": "grid",
|
|
98
|
+
"theme": "ui-theme-default",
|
|
99
|
+
"order": 6,
|
|
100
|
+
"className": "",
|
|
101
|
+
"visible": true,
|
|
102
|
+
"disabled": false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "ui-group-controls-ev",
|
|
106
|
+
"type": "ui-group",
|
|
107
|
+
"name": "EV Charging Controls",
|
|
108
|
+
"page": "ui-page-controls",
|
|
109
|
+
"width": "6",
|
|
110
|
+
"height": "1",
|
|
111
|
+
"order": 1,
|
|
112
|
+
"showTitle": true,
|
|
113
|
+
"className": "",
|
|
114
|
+
"visible": true,
|
|
115
|
+
"disabled": false
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "ui-group-controls-sys",
|
|
119
|
+
"type": "ui-group",
|
|
120
|
+
"name": "System",
|
|
121
|
+
"page": "ui-page-controls",
|
|
122
|
+
"width": "6",
|
|
123
|
+
"height": "1",
|
|
124
|
+
"order": 2,
|
|
125
|
+
"showTitle": true,
|
|
126
|
+
"className": "",
|
|
127
|
+
"visible": true,
|
|
128
|
+
"disabled": false
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "ui-group-status-main",
|
|
132
|
+
"type": "ui-group",
|
|
133
|
+
"name": "Charging Status",
|
|
134
|
+
"page": "ui-page-status",
|
|
135
|
+
"width": "6",
|
|
136
|
+
"height": "1",
|
|
137
|
+
"order": 1,
|
|
138
|
+
"showTitle": true,
|
|
139
|
+
"className": "",
|
|
140
|
+
"visible": true,
|
|
141
|
+
"disabled": false
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "ui-group-status-slots",
|
|
145
|
+
"type": "ui-group",
|
|
146
|
+
"name": "Charging Slots",
|
|
147
|
+
"page": "ui-page-status",
|
|
148
|
+
"width": "6",
|
|
149
|
+
"height": "1",
|
|
150
|
+
"order": 2,
|
|
151
|
+
"showTitle": true,
|
|
152
|
+
"className": "",
|
|
153
|
+
"visible": true,
|
|
154
|
+
"disabled": false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "ui-group-tariff-current",
|
|
158
|
+
"type": "ui-group",
|
|
159
|
+
"name": "Current Rates",
|
|
160
|
+
"page": "ui-page-tariff",
|
|
161
|
+
"width": "6",
|
|
162
|
+
"height": "1",
|
|
163
|
+
"order": 1,
|
|
164
|
+
"showTitle": true,
|
|
165
|
+
"className": "",
|
|
166
|
+
"visible": true,
|
|
167
|
+
"disabled": false
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "ui-group-tariff-stats",
|
|
171
|
+
"type": "ui-group",
|
|
172
|
+
"name": "Rate Statistics (24h)",
|
|
173
|
+
"page": "ui-page-tariff",
|
|
174
|
+
"width": "6",
|
|
175
|
+
"height": "1",
|
|
176
|
+
"order": 2,
|
|
177
|
+
"showTitle": true,
|
|
178
|
+
"className": "",
|
|
179
|
+
"visible": true,
|
|
180
|
+
"disabled": false
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "ui-group-tariff-bands",
|
|
184
|
+
"type": "ui-group",
|
|
185
|
+
"name": "Rate Bands",
|
|
186
|
+
"page": "ui-page-tariff",
|
|
187
|
+
"width": "6",
|
|
188
|
+
"height": "1",
|
|
189
|
+
"order": 3,
|
|
190
|
+
"showTitle": true,
|
|
191
|
+
"className": "",
|
|
192
|
+
"visible": true,
|
|
193
|
+
"disabled": false
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "ui-group-opt-schedule",
|
|
197
|
+
"type": "ui-group",
|
|
198
|
+
"name": "Rate Schedule",
|
|
199
|
+
"page": "ui-page-optimization",
|
|
200
|
+
"width": "12",
|
|
201
|
+
"height": "1",
|
|
202
|
+
"order": 1,
|
|
203
|
+
"showTitle": true,
|
|
204
|
+
"className": "",
|
|
205
|
+
"visible": true,
|
|
206
|
+
"disabled": false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "ui-group-opt-samples",
|
|
210
|
+
"type": "ui-group",
|
|
211
|
+
"name": "Sample Derivations (User-Modifiable)",
|
|
212
|
+
"page": "ui-page-optimization",
|
|
213
|
+
"width": "12",
|
|
214
|
+
"height": "1",
|
|
215
|
+
"order": 2,
|
|
216
|
+
"showTitle": true,
|
|
217
|
+
"className": "",
|
|
218
|
+
"visible": true,
|
|
219
|
+
"disabled": false
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "ui-group-account-main",
|
|
223
|
+
"type": "ui-group",
|
|
224
|
+
"name": "Account & Rewards",
|
|
225
|
+
"page": "ui-page-account",
|
|
226
|
+
"width": "6",
|
|
227
|
+
"height": "1",
|
|
228
|
+
"order": 1,
|
|
229
|
+
"showTitle": true,
|
|
230
|
+
"className": "",
|
|
231
|
+
"visible": true,
|
|
232
|
+
"disabled": false
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"id": "ui-group-account-mini",
|
|
236
|
+
"type": "ui-group",
|
|
237
|
+
"name": "Home Mini Live",
|
|
238
|
+
"page": "ui-page-account",
|
|
239
|
+
"width": "6",
|
|
240
|
+
"height": "1",
|
|
241
|
+
"order": 2,
|
|
242
|
+
"showTitle": true,
|
|
243
|
+
"className": "",
|
|
244
|
+
"visible": true,
|
|
245
|
+
"disabled": false
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"id": "ui-group-diag-main",
|
|
249
|
+
"type": "ui-group",
|
|
250
|
+
"name": "API & System",
|
|
251
|
+
"page": "ui-page-diagnostics",
|
|
252
|
+
"width": "6",
|
|
253
|
+
"height": "1",
|
|
254
|
+
"order": 1,
|
|
255
|
+
"showTitle": true,
|
|
256
|
+
"className": "",
|
|
257
|
+
"visible": true,
|
|
258
|
+
"disabled": false
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"id": "ui-group-diag-errors",
|
|
262
|
+
"type": "ui-group",
|
|
263
|
+
"name": "Category Errors",
|
|
264
|
+
"page": "ui-page-diagnostics",
|
|
265
|
+
"width": "6",
|
|
266
|
+
"height": "1",
|
|
267
|
+
"order": 2,
|
|
268
|
+
"showTitle": true,
|
|
269
|
+
"className": "",
|
|
270
|
+
"visible": true,
|
|
271
|
+
"disabled": false
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"id": "node-octopus-main",
|
|
275
|
+
"type": "octopus-intelligent",
|
|
276
|
+
"name": "Octopus Intelligent",
|
|
277
|
+
"z": "tab-octopus-main",
|
|
278
|
+
"accountNumber": "A-XXXXXXXX",
|
|
279
|
+
"refreshInterval": "5",
|
|
280
|
+
"enableMqtt": false,
|
|
281
|
+
"timezoneOverride": "",
|
|
282
|
+
"x": 200,
|
|
283
|
+
"y": 100,
|
|
284
|
+
"wires": [
|
|
285
|
+
[
|
|
286
|
+
"fn-route-pages",
|
|
287
|
+
"fn-find-cheapest-window",
|
|
288
|
+
"fn-is-cheapest-now"
|
|
289
|
+
]
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"id": "fn-route-pages",
|
|
294
|
+
"type": "function",
|
|
295
|
+
"name": "Fan out to all page branches",
|
|
296
|
+
"z": "tab-octopus-main",
|
|
297
|
+
"func": "// Distributes the full payload to every page branch.\n// Node-RED sends the same msg to all wires listed — widgets and\n// extractor functions each receive msg.payload intact.\nreturn msg;",
|
|
298
|
+
"outputs": 1,
|
|
299
|
+
"noerr": 0,
|
|
300
|
+
"initialize": "",
|
|
301
|
+
"finalize": "",
|
|
302
|
+
"libs": [],
|
|
303
|
+
"x": 470,
|
|
304
|
+
"y": 100,
|
|
305
|
+
"wires": [
|
|
306
|
+
[
|
|
307
|
+
"fn-controls-status",
|
|
308
|
+
"fn-controls-charge-cap-state",
|
|
309
|
+
"widget-status-charging-now",
|
|
310
|
+
"widget-status-source",
|
|
311
|
+
"widget-status-confirmed-limit",
|
|
312
|
+
"widget-status-confirmed-time",
|
|
313
|
+
"widget-status-next-start",
|
|
314
|
+
"widget-status-window",
|
|
315
|
+
"fn-extract-import-rate",
|
|
316
|
+
"fn-extract-export-rate",
|
|
317
|
+
"widget-tariff-stats-table",
|
|
318
|
+
"widget-tariff-bands-template",
|
|
319
|
+
"widget-opt-schedule-template",
|
|
320
|
+
"widget-status-slots-template",
|
|
321
|
+
"widget-account-balance",
|
|
322
|
+
"widget-account-octoplus",
|
|
323
|
+
"widget-account-saving-session",
|
|
324
|
+
"widget-account-free-elec",
|
|
325
|
+
"widget-account-wof",
|
|
326
|
+
"fn-extract-mini-kw",
|
|
327
|
+
"widget-mini-read-at",
|
|
328
|
+
"widget-diag-api-req",
|
|
329
|
+
"fn-extract-complexity",
|
|
330
|
+
"widget-diag-next-poll",
|
|
331
|
+
"widget-diag-update",
|
|
332
|
+
"widget-diag-timezone",
|
|
333
|
+
"widget-diag-errors-template"
|
|
334
|
+
]
|
|
335
|
+
]
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"id": "fn-controls-status",
|
|
339
|
+
"type": "function",
|
|
340
|
+
"name": "Extract current confirmed settings for Controls page",
|
|
341
|
+
"z": "tab-octopus-main",
|
|
342
|
+
"func": "// Provides a status summary text for the Controls page.\nmsg.payload = [\n 'Confirmed limit: ' + (msg.payload.confirmed_limit || '--') + '%',\n 'Confirmed time: ' + (msg.payload.confirmed_time || '--'),\n 'Smart charging: ' + (msg.payload.smart_charging ? 'ON' : 'OFF'),\n 'Charging now: ' + (msg.payload.charging_now ? 'YES' : 'NO')\n].join(' | ');\nreturn msg;",
|
|
343
|
+
"outputs": 1,
|
|
344
|
+
"noerr": 0,
|
|
345
|
+
"initialize": "",
|
|
346
|
+
"finalize": "",
|
|
347
|
+
"libs": [],
|
|
348
|
+
"x": 760,
|
|
349
|
+
"y": 60,
|
|
350
|
+
"wires": [["widget-controls-status"]]
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"id": "fn-find-cheapest-window",
|
|
354
|
+
"type": "function",
|
|
355
|
+
"name": "find-cheapest-window [SAMPLE — edit freely]",
|
|
356
|
+
"z": "tab-octopus-main",
|
|
357
|
+
"func": "// SAMPLE — user-modifiable. Demonstrates how to derive a \"cheapest contiguous\n// N-hour window\" from the applicable_rates array. The Octopus node does NOT\n// publish this as a sensor by design — the API returns the raw array; YOU\n// decide what window logic matters for your use case.\n//\n// Modify DURATION_MINS below or wire to a ui-number-input on the page.\nconst DURATION_MINS = 180; // 3 hours — change this to suit your needs\nconst slots = msg.payload.applicable_rates || [];\nconst now = Date.now();\n\n// Filter to slots with non-null values, sort by valid_from.\nconst valid = slots\n .filter(s => s.value_pence_per_kwh !== null && s.value_pence_per_kwh !== undefined)\n .sort((a, b) => new Date(a.valid_from) - new Date(b.valid_from));\n\n// Group into contiguous runs (slot.valid_to === next slot.valid_from).\nconst runs = [];\nlet run = [];\nfor (const s of valid) {\n if (run.length === 0) { run.push(s); continue; }\n const prev = run[run.length - 1];\n if (new Date(s.valid_from).getTime() === new Date(prev.valid_to).getTime()) {\n run.push(s);\n } else {\n runs.push(run);\n run = [s];\n }\n}\nif (run.length) runs.push(run);\n\n// For each run, slide a continuous N-minute window and pick the lowest avg.\nconst durationMs = DURATION_MINS * 60 * 1000;\nlet best = null;\nfor (const r of runs) {\n const candidates = new Set();\n candidates.add(new Date(r[0].valid_from).getTime());\n for (let i = 1; i < r.length; i++) candidates.add(new Date(r[i].valid_from).getTime());\n candidates.add(new Date(r[r.length - 1].valid_to).getTime() - durationMs);\n for (const winStart of candidates) {\n if (winStart < now) continue;\n const winEnd = winStart + durationMs;\n if (winEnd > new Date(r[r.length - 1].valid_to).getTime()) continue;\n let weighted = 0;\n for (const slot of r) {\n const sStart = new Date(slot.valid_from).getTime();\n const sEnd = new Date(slot.valid_to).getTime();\n const overlap = Math.max(0, Math.min(winEnd, sEnd) - Math.max(winStart, sStart));\n if (overlap > 0) weighted += slot.value_pence_per_kwh * (overlap / durationMs);\n }\n if (!best || weighted < best.avg) {\n best = {\n start: new Date(winStart).toISOString(),\n end: new Date(winEnd).toISOString(),\n avg: parseFloat(weighted.toFixed(4)),\n };\n }\n }\n}\n\nmsg.payload = {\n cheapest_window: best || null,\n duration_mins: DURATION_MINS,\n};\nreturn msg;",
|
|
358
|
+
"outputs": 1,
|
|
359
|
+
"noerr": 0,
|
|
360
|
+
"initialize": "",
|
|
361
|
+
"finalize": "",
|
|
362
|
+
"libs": [],
|
|
363
|
+
"x": 470,
|
|
364
|
+
"y": 160,
|
|
365
|
+
"wires": [["widget-opt-cheapest-window"]]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"id": "fn-is-cheapest-now",
|
|
369
|
+
"type": "function",
|
|
370
|
+
"name": "is-cheapest-now [SAMPLE — edit freely]",
|
|
371
|
+
"z": "tab-octopus-main",
|
|
372
|
+
"func": "// SAMPLE — user-modifiable. Returns true when the current applicable rate\n// equals the minimum in the next 24h schedule. Use as an automation trigger:\n// \"start the dishwasher when we hit the cheapest rate of the day.\"\n//\n// Extend this: add a trigger node downstream, or wire to a ui-switch for\n// a visual indicator that lights up when now is the cheapest moment.\nconst currentRate = msg.payload.applicable_rates_current_pence;\nconst minRate = msg.payload.applicable_rates_min_pence;\nmsg.payload = {\n is_cheapest_now: currentRate !== null && minRate !== null && currentRate === minRate,\n current_pence: currentRate,\n min_pence: minRate,\n};\nreturn msg;",
|
|
373
|
+
"outputs": 1,
|
|
374
|
+
"noerr": 0,
|
|
375
|
+
"initialize": "",
|
|
376
|
+
"finalize": "",
|
|
377
|
+
"libs": [],
|
|
378
|
+
"x": 470,
|
|
379
|
+
"y": 220,
|
|
380
|
+
"wires": [["widget-opt-cheapest-now"]]
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"id": "fn-apply-limit",
|
|
384
|
+
"type": "function",
|
|
385
|
+
"name": "Wrap limit as set_limit command",
|
|
386
|
+
"z": "tab-octopus-main",
|
|
387
|
+
"func": "// Receives the slider value from ui-number-input and wraps it\n// into the command shape expected by the Octopus Intelligent node.\nconst val = parseInt(msg.payload, 10);\nif (isNaN(val) || val < 5 || val > 100) {\n node.warn('Invalid limit value: ' + msg.payload);\n return null;\n}\nmsg.payload = { set_limit: val };\nreturn msg;",
|
|
388
|
+
"outputs": 1,
|
|
389
|
+
"noerr": 0,
|
|
390
|
+
"initialize": "",
|
|
391
|
+
"finalize": "",
|
|
392
|
+
"libs": [],
|
|
393
|
+
"x": 760,
|
|
394
|
+
"y": 280,
|
|
395
|
+
"wires": [["node-octopus-main"]]
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"id": "fn-apply-time",
|
|
399
|
+
"type": "function",
|
|
400
|
+
"name": "Wrap time as set_time command",
|
|
401
|
+
"z": "tab-octopus-main",
|
|
402
|
+
"func": "// Receives the dropdown value from ui-dropdown and wraps it\n// into the command shape expected by the Octopus Intelligent node.\nmsg.payload = { set_time: msg.payload };\nreturn msg;",
|
|
403
|
+
"outputs": 1,
|
|
404
|
+
"noerr": 0,
|
|
405
|
+
"initialize": "",
|
|
406
|
+
"finalize": "",
|
|
407
|
+
"libs": [],
|
|
408
|
+
"x": 760,
|
|
409
|
+
"y": 340,
|
|
410
|
+
"wires": [["node-octopus-main"]]
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"id": "fn-apply-smart",
|
|
414
|
+
"type": "function",
|
|
415
|
+
"name": "Wrap smart charging toggle as set_smart_charging command",
|
|
416
|
+
"z": "tab-octopus-main",
|
|
417
|
+
"func": "// Receives true/false from the ui-switch and wraps it\n// into the command shape expected by the Octopus Intelligent node.\nmsg.payload = { set_smart_charging: msg.payload === true || msg.payload === 'true' };\nreturn msg;",
|
|
418
|
+
"outputs": 1,
|
|
419
|
+
"noerr": 0,
|
|
420
|
+
"initialize": "",
|
|
421
|
+
"finalize": "",
|
|
422
|
+
"libs": [],
|
|
423
|
+
"x": 760,
|
|
424
|
+
"y": 400,
|
|
425
|
+
"wires": [["node-octopus-main"]]
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"id": "fn-apply-charge-cap",
|
|
429
|
+
"type": "function",
|
|
430
|
+
"name": "Wrap Charge Cap toggle as set_charge_cap command",
|
|
431
|
+
"z": "tab-octopus-main",
|
|
432
|
+
"func": "// Receives true/false from the ui-switch and wraps it\n// into the command shape expected by the Octopus Intelligent node.\nmsg.payload = { set_charge_cap: msg.payload === true || msg.payload === 'true' };\nreturn msg;",
|
|
433
|
+
"outputs": 1,
|
|
434
|
+
"noerr": 0,
|
|
435
|
+
"initialize": "",
|
|
436
|
+
"finalize": "",
|
|
437
|
+
"libs": [],
|
|
438
|
+
"x": 760,
|
|
439
|
+
"y": 520,
|
|
440
|
+
"wires": [["node-octopus-main"]]
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"id": "fn-controls-charge-cap-state",
|
|
444
|
+
"type": "function",
|
|
445
|
+
"name": "Drive Charge Cap switch from charge_cap",
|
|
446
|
+
"z": "tab-octopus-main",
|
|
447
|
+
"func": "// Sets the Charge Cap switch from the node's charge_cap output field.\n// charge_cap is true/false, or null when Charge Cap does not apply to\n// the device: then nothing is sent and the switch keeps its state.\n// The switch has passthru off, so this never loops back as a command.\nconst v = msg.payload && msg.payload.charge_cap;\nif (typeof v !== 'boolean') return null;\nreturn { payload: v };",
|
|
448
|
+
"outputs": 1,
|
|
449
|
+
"noerr": 0,
|
|
450
|
+
"initialize": "",
|
|
451
|
+
"finalize": "",
|
|
452
|
+
"libs": [],
|
|
453
|
+
"x": 760,
|
|
454
|
+
"y": 580,
|
|
455
|
+
"wires": [["widget-controls-charge-cap"]]
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"id": "fn-apply-timezone",
|
|
459
|
+
"type": "function",
|
|
460
|
+
"name": "Wrap timezone as set_timezone command",
|
|
461
|
+
"z": "tab-octopus-main",
|
|
462
|
+
"func": "// Receives a string like 'Europe/London' from the ui-text-input\n// and wraps it into the command shape expected by the node.\nconst tz = (msg.payload || '').trim();\nif (!tz) { node.warn('Empty timezone string, ignoring.'); return null; }\nmsg.payload = { set_timezone: tz };\nreturn msg;",
|
|
463
|
+
"outputs": 1,
|
|
464
|
+
"noerr": 0,
|
|
465
|
+
"initialize": "",
|
|
466
|
+
"finalize": "",
|
|
467
|
+
"libs": [],
|
|
468
|
+
"x": 760,
|
|
469
|
+
"y": 460,
|
|
470
|
+
"wires": [["node-octopus-main"]]
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"id": "inject-refresh",
|
|
474
|
+
"type": "inject",
|
|
475
|
+
"name": "Refresh (inject trigger)",
|
|
476
|
+
"z": "tab-octopus-main",
|
|
477
|
+
"props": [{"p": "payload"}],
|
|
478
|
+
"repeat": "",
|
|
479
|
+
"crontab": "",
|
|
480
|
+
"once": false,
|
|
481
|
+
"topic": "",
|
|
482
|
+
"payload": "{\"refresh\":true}",
|
|
483
|
+
"payloadType": "json",
|
|
484
|
+
"x": 200,
|
|
485
|
+
"y": 520,
|
|
486
|
+
"wires": [["node-octopus-main"]]
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"id": "widget-controls-limit",
|
|
490
|
+
"type": "ui-number-input",
|
|
491
|
+
"z": "tab-octopus-main",
|
|
492
|
+
"group": "ui-group-controls-ev",
|
|
493
|
+
"name": "Target Charge Limit",
|
|
494
|
+
"label": "Target limit (%)",
|
|
495
|
+
"tooltip": "Set the target charge limit (5–100, step 5). Click Apply after adjusting.",
|
|
496
|
+
"order": 1,
|
|
497
|
+
"width": "6",
|
|
498
|
+
"height": "1",
|
|
499
|
+
"topic": "set_limit",
|
|
500
|
+
"topicType": "str",
|
|
501
|
+
"min": "5",
|
|
502
|
+
"max": "100",
|
|
503
|
+
"step": "5",
|
|
504
|
+
"wrap": false,
|
|
505
|
+
"className": "",
|
|
506
|
+
"x": 970,
|
|
507
|
+
"y": 280,
|
|
508
|
+
"wires": [["fn-apply-limit"]]
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"id": "widget-controls-ready-time",
|
|
512
|
+
"type": "ui-dropdown",
|
|
513
|
+
"z": "tab-octopus-main",
|
|
514
|
+
"group": "ui-group-controls-ev",
|
|
515
|
+
"name": "Ready By Time",
|
|
516
|
+
"label": "Ready by",
|
|
517
|
+
"tooltip": "Time the car should be fully charged by. Click Apply after selecting.",
|
|
518
|
+
"order": 2,
|
|
519
|
+
"width": "6",
|
|
520
|
+
"height": "1",
|
|
521
|
+
"topic": "set_time",
|
|
522
|
+
"topicType": "str",
|
|
523
|
+
"options": [
|
|
524
|
+
{"label": "00:00", "value": "00:00"},
|
|
525
|
+
{"label": "00:30", "value": "00:30"},
|
|
526
|
+
{"label": "01:00", "value": "01:00"},
|
|
527
|
+
{"label": "01:30", "value": "01:30"},
|
|
528
|
+
{"label": "02:00", "value": "02:00"},
|
|
529
|
+
{"label": "02:30", "value": "02:30"},
|
|
530
|
+
{"label": "03:00", "value": "03:00"},
|
|
531
|
+
{"label": "03:30", "value": "03:30"},
|
|
532
|
+
{"label": "04:00", "value": "04:00"},
|
|
533
|
+
{"label": "04:30", "value": "04:30"},
|
|
534
|
+
{"label": "05:00", "value": "05:00"},
|
|
535
|
+
{"label": "05:30", "value": "05:30"},
|
|
536
|
+
{"label": "06:00", "value": "06:00"},
|
|
537
|
+
{"label": "06:30", "value": "06:30"},
|
|
538
|
+
{"label": "07:00", "value": "07:00"},
|
|
539
|
+
{"label": "07:30", "value": "07:30"},
|
|
540
|
+
{"label": "08:00", "value": "08:00"},
|
|
541
|
+
{"label": "08:30", "value": "08:30"},
|
|
542
|
+
{"label": "09:00", "value": "09:00"},
|
|
543
|
+
{"label": "09:30", "value": "09:30"},
|
|
544
|
+
{"label": "10:00", "value": "10:00"},
|
|
545
|
+
{"label": "10:30", "value": "10:30"},
|
|
546
|
+
{"label": "11:00", "value": "11:00"},
|
|
547
|
+
{"label": "11:30", "value": "11:30"},
|
|
548
|
+
{"label": "12:00", "value": "12:00"},
|
|
549
|
+
{"label": "12:30", "value": "12:30"},
|
|
550
|
+
{"label": "13:00", "value": "13:00"},
|
|
551
|
+
{"label": "13:30", "value": "13:30"},
|
|
552
|
+
{"label": "14:00", "value": "14:00"},
|
|
553
|
+
{"label": "14:30", "value": "14:30"},
|
|
554
|
+
{"label": "15:00", "value": "15:00"},
|
|
555
|
+
{"label": "15:30", "value": "15:30"},
|
|
556
|
+
{"label": "16:00", "value": "16:00"},
|
|
557
|
+
{"label": "16:30", "value": "16:30"},
|
|
558
|
+
{"label": "17:00", "value": "17:00"},
|
|
559
|
+
{"label": "17:30", "value": "17:30"},
|
|
560
|
+
{"label": "18:00", "value": "18:00"},
|
|
561
|
+
{"label": "18:30", "value": "18:30"},
|
|
562
|
+
{"label": "19:00", "value": "19:00"},
|
|
563
|
+
{"label": "19:30", "value": "19:30"},
|
|
564
|
+
{"label": "20:00", "value": "20:00"},
|
|
565
|
+
{"label": "20:30", "value": "20:30"},
|
|
566
|
+
{"label": "21:00", "value": "21:00"},
|
|
567
|
+
{"label": "21:30", "value": "21:30"},
|
|
568
|
+
{"label": "22:00", "value": "22:00"},
|
|
569
|
+
{"label": "22:30", "value": "22:30"},
|
|
570
|
+
{"label": "23:00", "value": "23:00"},
|
|
571
|
+
{"label": "23:30", "value": "23:30"}
|
|
572
|
+
],
|
|
573
|
+
"allowInput": false,
|
|
574
|
+
"className": "",
|
|
575
|
+
"x": 970,
|
|
576
|
+
"y": 340,
|
|
577
|
+
"wires": [["fn-apply-time"]]
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"id": "widget-controls-smart",
|
|
581
|
+
"type": "ui-switch",
|
|
582
|
+
"z": "tab-octopus-main",
|
|
583
|
+
"group": "ui-group-controls-ev",
|
|
584
|
+
"name": "Smart Charging",
|
|
585
|
+
"label": "Smart Charging",
|
|
586
|
+
"tooltip": "Enable or disable Octopus Intelligent smart charging.",
|
|
587
|
+
"order": 3,
|
|
588
|
+
"width": "6",
|
|
589
|
+
"height": "1",
|
|
590
|
+
"topic": "set_smart_charging",
|
|
591
|
+
"topicType": "str",
|
|
592
|
+
"stateOn": true,
|
|
593
|
+
"stateOff": false,
|
|
594
|
+
"stateOnLabel": "Enabled",
|
|
595
|
+
"stateOffLabel": "Disabled",
|
|
596
|
+
"colorOn": "#00897B",
|
|
597
|
+
"colorOff": "#ccc",
|
|
598
|
+
"className": "",
|
|
599
|
+
"x": 970,
|
|
600
|
+
"y": 400,
|
|
601
|
+
"wires": [["fn-apply-smart"]]
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"id": "widget-controls-charge-cap",
|
|
605
|
+
"type": "ui-switch",
|
|
606
|
+
"z": "tab-octopus-main",
|
|
607
|
+
"group": "ui-group-controls-ev",
|
|
608
|
+
"name": "Charge Cap",
|
|
609
|
+
"label": "Charge Cap",
|
|
610
|
+
"tooltip": "Limit smart charging to off-peak rates only (as in the Octopus app).",
|
|
611
|
+
"order": 4,
|
|
612
|
+
"width": "6",
|
|
613
|
+
"height": "1",
|
|
614
|
+
"passthru": false,
|
|
615
|
+
"topic": "set_charge_cap",
|
|
616
|
+
"topicType": "str",
|
|
617
|
+
"stateOn": true,
|
|
618
|
+
"stateOff": false,
|
|
619
|
+
"stateOnLabel": "On",
|
|
620
|
+
"stateOffLabel": "Off",
|
|
621
|
+
"colorOn": "#00897B",
|
|
622
|
+
"colorOff": "#ccc",
|
|
623
|
+
"className": "",
|
|
624
|
+
"x": 1180,
|
|
625
|
+
"y": 400,
|
|
626
|
+
"wires": [["fn-apply-charge-cap"]]
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"id": "widget-controls-refresh",
|
|
630
|
+
"type": "ui-button",
|
|
631
|
+
"z": "tab-octopus-main",
|
|
632
|
+
"group": "ui-group-controls-sys",
|
|
633
|
+
"name": "Refresh Now",
|
|
634
|
+
"label": "Refresh",
|
|
635
|
+
"tooltip": "Trigger an immediate API poll. Note: the node has no rate limit on Node-RED input messages.",
|
|
636
|
+
"order": 1,
|
|
637
|
+
"width": "3",
|
|
638
|
+
"height": "1",
|
|
639
|
+
"topic": "refresh",
|
|
640
|
+
"topicType": "str",
|
|
641
|
+
"payload": "{\"refresh\":true}",
|
|
642
|
+
"payloadType": "json",
|
|
643
|
+
"className": "",
|
|
644
|
+
"x": 970,
|
|
645
|
+
"y": 460,
|
|
646
|
+
"wires": [["node-octopus-main"]]
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"id": "widget-controls-timezone",
|
|
650
|
+
"type": "ui-text-input",
|
|
651
|
+
"z": "tab-octopus-main",
|
|
652
|
+
"group": "ui-group-controls-sys",
|
|
653
|
+
"name": "Timezone Override",
|
|
654
|
+
"label": "Timezone (e.g. Europe/London)",
|
|
655
|
+
"tooltip": "Override the detected timezone. Leave blank to use auto-detected. Press Enter to apply.",
|
|
656
|
+
"order": 2,
|
|
657
|
+
"width": "6",
|
|
658
|
+
"height": "1",
|
|
659
|
+
"topic": "set_timezone",
|
|
660
|
+
"topicType": "str",
|
|
661
|
+
"mode": "text",
|
|
662
|
+
"sendOnBlur": true,
|
|
663
|
+
"clearable": true,
|
|
664
|
+
"className": "",
|
|
665
|
+
"x": 970,
|
|
666
|
+
"y": 520,
|
|
667
|
+
"wires": [["fn-apply-timezone"]]
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"id": "widget-controls-status",
|
|
671
|
+
"type": "ui-text",
|
|
672
|
+
"z": "tab-octopus-main",
|
|
673
|
+
"group": "ui-group-controls-sys",
|
|
674
|
+
"name": "Current Confirmed Settings",
|
|
675
|
+
"label": "Current settings:",
|
|
676
|
+
"format": "{{msg.payload}}",
|
|
677
|
+
"layout": "row-spread",
|
|
678
|
+
"style": false,
|
|
679
|
+
"order": 3,
|
|
680
|
+
"width": "12",
|
|
681
|
+
"height": "1",
|
|
682
|
+
"className": "",
|
|
683
|
+
"x": 970,
|
|
684
|
+
"y": 580,
|
|
685
|
+
"wires": []
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"id": "widget-status-charging-now",
|
|
689
|
+
"type": "ui-text",
|
|
690
|
+
"z": "tab-octopus-main",
|
|
691
|
+
"group": "ui-group-status-main",
|
|
692
|
+
"name": "Charging Now",
|
|
693
|
+
"label": "Charging now:",
|
|
694
|
+
"format": "{{msg.payload.charging_now ? 'YES' : 'NO'}}",
|
|
695
|
+
"layout": "row-spread",
|
|
696
|
+
"style": false,
|
|
697
|
+
"order": 1,
|
|
698
|
+
"width": "3",
|
|
699
|
+
"height": "1",
|
|
700
|
+
"className": "",
|
|
701
|
+
"x": 970,
|
|
702
|
+
"y": 640,
|
|
703
|
+
"wires": []
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
"id": "widget-status-source",
|
|
707
|
+
"type": "ui-text",
|
|
708
|
+
"z": "tab-octopus-main",
|
|
709
|
+
"group": "ui-group-status-main",
|
|
710
|
+
"name": "Charge Source",
|
|
711
|
+
"label": "Source:",
|
|
712
|
+
"format": "{{msg.payload.next_source || '--'}}",
|
|
713
|
+
"layout": "row-spread",
|
|
714
|
+
"style": false,
|
|
715
|
+
"order": 2,
|
|
716
|
+
"width": "3",
|
|
717
|
+
"height": "1",
|
|
718
|
+
"className": "",
|
|
719
|
+
"x": 970,
|
|
720
|
+
"y": 700,
|
|
721
|
+
"wires": []
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"id": "widget-status-confirmed-limit",
|
|
725
|
+
"type": "ui-text",
|
|
726
|
+
"z": "tab-octopus-main",
|
|
727
|
+
"group": "ui-group-status-main",
|
|
728
|
+
"name": "Confirmed Limit",
|
|
729
|
+
"label": "Confirmed limit:",
|
|
730
|
+
"format": "{{msg.payload.confirmed_limit || '--'}}%",
|
|
731
|
+
"layout": "row-spread",
|
|
732
|
+
"style": false,
|
|
733
|
+
"order": 3,
|
|
734
|
+
"width": "3",
|
|
735
|
+
"height": "1",
|
|
736
|
+
"className": "",
|
|
737
|
+
"x": 970,
|
|
738
|
+
"y": 760,
|
|
739
|
+
"wires": []
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"id": "widget-status-confirmed-time",
|
|
743
|
+
"type": "ui-text",
|
|
744
|
+
"z": "tab-octopus-main",
|
|
745
|
+
"group": "ui-group-status-main",
|
|
746
|
+
"name": "Confirmed Ready Time",
|
|
747
|
+
"label": "Confirmed ready by:",
|
|
748
|
+
"format": "{{msg.payload.confirmed_time || '--'}}",
|
|
749
|
+
"layout": "row-spread",
|
|
750
|
+
"style": false,
|
|
751
|
+
"order": 4,
|
|
752
|
+
"width": "3",
|
|
753
|
+
"height": "1",
|
|
754
|
+
"className": "",
|
|
755
|
+
"x": 970,
|
|
756
|
+
"y": 820,
|
|
757
|
+
"wires": []
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"id": "widget-status-next-start",
|
|
761
|
+
"type": "ui-text",
|
|
762
|
+
"z": "tab-octopus-main",
|
|
763
|
+
"group": "ui-group-status-main",
|
|
764
|
+
"name": "Next Charge Start",
|
|
765
|
+
"label": "Next charge start:",
|
|
766
|
+
"format": "{{msg.payload.next_start_locale || '--'}}",
|
|
767
|
+
"layout": "row-spread",
|
|
768
|
+
"style": false,
|
|
769
|
+
"order": 5,
|
|
770
|
+
"width": "3",
|
|
771
|
+
"height": "1",
|
|
772
|
+
"className": "",
|
|
773
|
+
"x": 970,
|
|
774
|
+
"y": 880,
|
|
775
|
+
"wires": []
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"id": "widget-status-window",
|
|
779
|
+
"type": "ui-text",
|
|
780
|
+
"z": "tab-octopus-main",
|
|
781
|
+
"group": "ui-group-status-main",
|
|
782
|
+
"name": "Charging Window",
|
|
783
|
+
"label": "Window:",
|
|
784
|
+
"format": "{{msg.payload.window_start_locale || '--'}} → {{msg.payload.window_end_locale || '--'}}",
|
|
785
|
+
"layout": "row-spread",
|
|
786
|
+
"style": false,
|
|
787
|
+
"order": 6,
|
|
788
|
+
"width": "6",
|
|
789
|
+
"height": "1",
|
|
790
|
+
"className": "",
|
|
791
|
+
"x": 970,
|
|
792
|
+
"y": 940,
|
|
793
|
+
"wires": []
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"id": "widget-status-slots-template",
|
|
797
|
+
"type": "ui-template",
|
|
798
|
+
"z": "tab-octopus-main",
|
|
799
|
+
"group": "ui-group-status-slots",
|
|
800
|
+
"name": "Charging Slots",
|
|
801
|
+
"order": 1,
|
|
802
|
+
"width": "12",
|
|
803
|
+
"height": "4",
|
|
804
|
+
"className": "",
|
|
805
|
+
"template": "<template>\n <div>\n <table style=\"width:100%; border-collapse:collapse; font-size:0.9em;\">\n <thead>\n <tr style=\"background:#1565C0; color:#fff;\">\n <th style=\"padding:6px 10px; text-align:left;\">Slot</th>\n <th style=\"padding:6px 10px; text-align:left;\">Start</th>\n <th style=\"padding:6px 10px; text-align:left;\">End</th>\n </tr>\n </thead>\n <tbody>\n <tr v-if=\"msg.payload.slot1_start_locale\" style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">1</td>\n <td style=\"padding:6px 10px;\">{{ msg.payload.slot1_start_locale }}</td>\n <td style=\"padding:6px 10px;\">{{ msg.payload.slot1_end_locale }}</td>\n </tr>\n <tr v-if=\"msg.payload.slot2_start_locale\">\n <td style=\"padding:6px 10px;\">2</td>\n <td style=\"padding:6px 10px;\">{{ msg.payload.slot2_start_locale }}</td>\n <td style=\"padding:6px 10px;\">{{ msg.payload.slot2_end_locale }}</td>\n </tr>\n <tr v-if=\"msg.payload.slot3_start_locale\" style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">3</td>\n <td style=\"padding:6px 10px;\">{{ msg.payload.slot3_start_locale }}</td>\n <td style=\"padding:6px 10px;\">{{ msg.payload.slot3_end_locale }}</td>\n </tr>\n <tr v-if=\"!msg.payload.slot1_start_locale\">\n <td colspan=\"3\" style=\"padding:10px; text-align:center; color:#888;\">No upcoming slots</td>\n </tr>\n </tbody>\n </table>\n <div style=\"margin-top:8px; font-size:0.85em; color:#555;\">\n Next kWh: {{ msg.payload.next_kwh || '--' }} | Total energy: {{ msg.payload.total_energy || '--' }} kWh\n </div>\n </div>\n</template>",
|
|
806
|
+
"storeOutMessages": true,
|
|
807
|
+
"passthru": true,
|
|
808
|
+
"resendOnRefresh": true,
|
|
809
|
+
"templateScope": "local",
|
|
810
|
+
"eventsFromServer": false,
|
|
811
|
+
"x": 970,
|
|
812
|
+
"y": 1000,
|
|
813
|
+
"wires": [[]]
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"id": "widget-tariff-import-gauge",
|
|
817
|
+
"type": "ui-gauge",
|
|
818
|
+
"z": "tab-octopus-main",
|
|
819
|
+
"group": "ui-group-tariff-current",
|
|
820
|
+
"name": "Import Rate Gauge",
|
|
821
|
+
"label": "Import rate (p/kWh)",
|
|
822
|
+
"order": 1,
|
|
823
|
+
"width": "3",
|
|
824
|
+
"height": "3",
|
|
825
|
+
"gtype": "gauge-half",
|
|
826
|
+
"gstyle": "needle",
|
|
827
|
+
"topic": "",
|
|
828
|
+
"topicType": "str",
|
|
829
|
+
"units": "p/kWh",
|
|
830
|
+
"format": "{{value}}",
|
|
831
|
+
"min": "0",
|
|
832
|
+
"max": "50",
|
|
833
|
+
"segments": [
|
|
834
|
+
{"color": "#00897B", "from": "0"},
|
|
835
|
+
{"color": "#FFA726", "from": "15"},
|
|
836
|
+
{"color": "#EF5350", "from": "30"}
|
|
837
|
+
],
|
|
838
|
+
"className": "",
|
|
839
|
+
"x": 970,
|
|
840
|
+
"y": 1060,
|
|
841
|
+
"wires": []
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"id": "fn-extract-import-rate",
|
|
845
|
+
"type": "function",
|
|
846
|
+
"name": "Extract import rate for gauge",
|
|
847
|
+
"z": "tab-octopus-main",
|
|
848
|
+
"func": "msg.payload = msg.payload.applicable_rates_current_pence || 0;\nreturn msg;",
|
|
849
|
+
"outputs": 1,
|
|
850
|
+
"noerr": 0,
|
|
851
|
+
"initialize": "",
|
|
852
|
+
"finalize": "",
|
|
853
|
+
"libs": [],
|
|
854
|
+
"x": 760,
|
|
855
|
+
"y": 1060,
|
|
856
|
+
"wires": [["widget-tariff-import-gauge"]]
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"id": "fn-extract-export-rate",
|
|
860
|
+
"type": "function",
|
|
861
|
+
"name": "Extract export rate for gauge",
|
|
862
|
+
"z": "tab-octopus-main",
|
|
863
|
+
"func": "msg.payload = msg.payload.electricity_export_rate_current_pence || 0;\nreturn msg;",
|
|
864
|
+
"outputs": 1,
|
|
865
|
+
"noerr": 0,
|
|
866
|
+
"initialize": "",
|
|
867
|
+
"finalize": "",
|
|
868
|
+
"libs": [],
|
|
869
|
+
"x": 760,
|
|
870
|
+
"y": 1120,
|
|
871
|
+
"wires": [["widget-tariff-export-gauge"]]
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"id": "fn-extract-complexity",
|
|
875
|
+
"type": "function",
|
|
876
|
+
"name": "Extract API complexity percent for gauge",
|
|
877
|
+
"z": "tab-octopus-main",
|
|
878
|
+
"func": "msg.payload = parseFloat(msg.payload.api_complexity_percent) || 0;\nreturn msg;",
|
|
879
|
+
"outputs": 1,
|
|
880
|
+
"noerr": 0,
|
|
881
|
+
"initialize": "",
|
|
882
|
+
"finalize": "",
|
|
883
|
+
"libs": [],
|
|
884
|
+
"x": 760,
|
|
885
|
+
"y": 1180,
|
|
886
|
+
"wires": [["widget-diag-complexity-gauge"]]
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"id": "fn-extract-mini-kw",
|
|
890
|
+
"type": "function",
|
|
891
|
+
"name": "Extract Home Mini kW for gauge",
|
|
892
|
+
"z": "tab-octopus-main",
|
|
893
|
+
"func": "msg.payload = parseFloat(msg.payload.mini_demand_kw) || 0;\nreturn msg;",
|
|
894
|
+
"outputs": 1,
|
|
895
|
+
"noerr": 0,
|
|
896
|
+
"initialize": "",
|
|
897
|
+
"finalize": "",
|
|
898
|
+
"libs": [],
|
|
899
|
+
"x": 760,
|
|
900
|
+
"y": 1240,
|
|
901
|
+
"wires": [["widget-mini-gauge"]]
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"id": "widget-tariff-export-gauge",
|
|
905
|
+
"type": "ui-gauge",
|
|
906
|
+
"z": "tab-octopus-main",
|
|
907
|
+
"group": "ui-group-tariff-current",
|
|
908
|
+
"name": "Export Rate Gauge",
|
|
909
|
+
"label": "Export rate (p/kWh)",
|
|
910
|
+
"order": 2,
|
|
911
|
+
"width": "3",
|
|
912
|
+
"height": "3",
|
|
913
|
+
"gtype": "gauge-half",
|
|
914
|
+
"gstyle": "needle",
|
|
915
|
+
"topic": "",
|
|
916
|
+
"topicType": "str",
|
|
917
|
+
"units": "p/kWh",
|
|
918
|
+
"format": "{{value}}",
|
|
919
|
+
"min": "0",
|
|
920
|
+
"max": "30",
|
|
921
|
+
"segments": [
|
|
922
|
+
{"color": "#EF5350", "from": "0"},
|
|
923
|
+
{"color": "#FFA726", "from": "10"},
|
|
924
|
+
{"color": "#00897B", "from": "20"}
|
|
925
|
+
],
|
|
926
|
+
"className": "",
|
|
927
|
+
"x": 970,
|
|
928
|
+
"y": 1120,
|
|
929
|
+
"wires": []
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"id": "widget-tariff-stats-table",
|
|
933
|
+
"type": "ui-template",
|
|
934
|
+
"z": "tab-octopus-main",
|
|
935
|
+
"group": "ui-group-tariff-stats",
|
|
936
|
+
"name": "24h Rate Statistics",
|
|
937
|
+
"order": 1,
|
|
938
|
+
"width": "12",
|
|
939
|
+
"height": "3",
|
|
940
|
+
"className": "",
|
|
941
|
+
"template": "<template>\n <div style=\"font-size:0.9em;\">\n <table style=\"width:100%; border-collapse:collapse;\">\n <thead>\n <tr style=\"background:#1565C0; color:#fff;\">\n <th style=\"padding:6px 10px; text-align:left;\">Metric</th>\n <th style=\"padding:6px 10px; text-align:right;\">Import (p/kWh)</th>\n <th style=\"padding:6px 10px; text-align:right;\">Export (p/kWh)</th>\n </tr>\n </thead>\n <tbody>\n <tr style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">Current</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.applicable_rates_current_pence ?? '--' }}</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_export_rate_current_pence ?? '--' }}</td>\n </tr>\n <tr>\n <td style=\"padding:6px 10px;\">Min</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.applicable_rates_min_pence ?? '--' }}</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_export_rate_min_pence ?? '--' }}</td>\n </tr>\n <tr style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">Median</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.applicable_rates_median_pence ?? '--' }}</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_export_rate_median_pence ?? '--' }}</td>\n </tr>\n <tr>\n <td style=\"padding:6px 10px;\">Avg</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.applicable_rates_avg_pence ?? '--' }}</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_export_rate_avg_pence ?? '--' }}</td>\n </tr>\n <tr style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">Max</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.applicable_rates_max_pence ?? '--' }}</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_export_rate_max_pence ?? '--' }}</td>\n </tr>\n <tr>\n <td style=\"padding:6px 10px; color:#888; font-size:0.85em;\">Next slot from</td>\n <td style=\"padding:6px 10px; text-align:right; color:#888; font-size:0.85em;\">{{ msg.payload.applicable_rates_next_from ? new Date(msg.payload.applicable_rates_next_from).toLocaleTimeString() : '--' }} @ {{ msg.payload.applicable_rates_next_pence ?? '--' }}p</td>\n <td style=\"padding:6px 10px; text-align:right; color:#888; font-size:0.85em;\">{{ msg.payload.electricity_export_rate_next_from ? new Date(msg.payload.electricity_export_rate_next_from).toLocaleTimeString() : '--' }} @ {{ msg.payload.electricity_export_rate_next_pence ?? '--' }}p</td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>",
|
|
942
|
+
"storeOutMessages": true,
|
|
943
|
+
"passthru": true,
|
|
944
|
+
"resendOnRefresh": true,
|
|
945
|
+
"templateScope": "local",
|
|
946
|
+
"eventsFromServer": false,
|
|
947
|
+
"x": 970,
|
|
948
|
+
"y": 1180,
|
|
949
|
+
"wires": [[]]
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
"id": "widget-tariff-bands-template",
|
|
953
|
+
"type": "ui-template",
|
|
954
|
+
"z": "tab-octopus-main",
|
|
955
|
+
"group": "ui-group-tariff-bands",
|
|
956
|
+
"name": "Tariff Rate Bands",
|
|
957
|
+
"order": 1,
|
|
958
|
+
"width": "12",
|
|
959
|
+
"height": "3",
|
|
960
|
+
"className": "",
|
|
961
|
+
"template": "<template>\n <div style=\"font-size:0.9em;\">\n <table style=\"width:100%; border-collapse:collapse;\">\n <thead>\n <tr style=\"background:#37474F; color:#fff;\">\n <th style=\"padding:6px 10px; text-align:left;\">Band</th>\n <th style=\"padding:6px 10px; text-align:right;\">Rate</th>\n </tr>\n </thead>\n <tbody>\n <tr style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">Day rate</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_day_rate != null ? msg.payload.electricity_day_rate + ' p/kWh' : '--' }}</td>\n </tr>\n <tr>\n <td style=\"padding:6px 10px;\">Night rate</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_night_rate != null ? msg.payload.electricity_night_rate + ' p/kWh' : '--' }}</td>\n </tr>\n <tr style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">EV peak rate</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_ev_peak_rate != null ? msg.payload.electricity_ev_peak_rate + ' p/kWh' : '--' }}</td>\n </tr>\n <tr>\n <td style=\"padding:6px 10px;\">EV off-peak rate</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.electricity_ev_off_peak_rate != null ? msg.payload.electricity_ev_off_peak_rate + ' p/kWh' : '--' }}</td>\n </tr>\n <tr style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">Tariff code</td>\n <td style=\"padding:6px 10px; text-align:right; font-size:0.85em;\">{{ msg.payload.electricity_tariff_code || '--' }}</td>\n </tr>\n <tr>\n <td style=\"padding:6px 10px;\">Gas unit rate</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.gas_unit_rate != null ? msg.payload.gas_unit_rate + ' p/kWh' : '--' }}</td>\n </tr>\n <tr style=\"background:#f5f5f5;\">\n <td style=\"padding:6px 10px;\">Gas standing charge</td>\n <td style=\"padding:6px 10px; text-align:right;\">{{ msg.payload.gas_standing_charge != null ? msg.payload.gas_standing_charge + ' p/day' : '--' }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>",
|
|
962
|
+
"storeOutMessages": true,
|
|
963
|
+
"passthru": true,
|
|
964
|
+
"resendOnRefresh": true,
|
|
965
|
+
"templateScope": "local",
|
|
966
|
+
"eventsFromServer": false,
|
|
967
|
+
"x": 970,
|
|
968
|
+
"y": 1240,
|
|
969
|
+
"wires": [[]]
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"id": "widget-opt-schedule-template",
|
|
973
|
+
"type": "ui-template",
|
|
974
|
+
"z": "tab-octopus-main",
|
|
975
|
+
"group": "ui-group-opt-schedule",
|
|
976
|
+
"name": "Rate Schedule (applicable_rates)",
|
|
977
|
+
"order": 1,
|
|
978
|
+
"width": "12",
|
|
979
|
+
"height": "6",
|
|
980
|
+
"className": "",
|
|
981
|
+
"template": "<template>\n <div style=\"font-size:0.85em; max-height:300px; overflow-y:auto;\">\n <div style=\"margin-bottom:6px; font-weight:bold;\">Applicable Rates Schedule ({{ (msg.payload.applicable_rates || []).length }} slots)</div>\n <table style=\"width:100%; border-collapse:collapse;\">\n <thead>\n <tr style=\"background:#1565C0; color:#fff; position:sticky; top:0;\">\n <th style=\"padding:4px 8px; text-align:left;\">From</th>\n <th style=\"padding:4px 8px; text-align:left;\">To</th>\n <th style=\"padding:4px 8px; text-align:right;\">p/kWh</th>\n <th style=\"padding:4px 8px; text-align:center;\">Level</th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(slot, i) in (msg.payload.applicable_rates || [])\"\n :key=\"i\"\n :style=\"{ background: i % 2 === 0 ? '#f5f5f5' : '#fff' }\"\n >\n <td style=\"padding:4px 8px;\">{{ new Date(slot.valid_from).toLocaleTimeString([], {hour:'2-digit', minute:'2-digit'}) }}</td>\n <td style=\"padding:4px 8px;\">{{ new Date(slot.valid_to).toLocaleTimeString([], {hour:'2-digit', minute:'2-digit'}) }}</td>\n <td style=\"padding:4px 8px; text-align:right; font-weight:bold;\">{{ slot.value_pence_per_kwh }}</td>\n <td style=\"padding:4px 8px; text-align:center;\">\n <span :style=\"{\n display:'inline-block',\n width: Math.min(60, Math.max(4, (slot.value_pence_per_kwh / (msg.payload.applicable_rates_max_pence || 50)) * 60)) + 'px',\n height:'10px',\n background: slot.value_pence_per_kwh <= (msg.payload.applicable_rates_min_pence || 0) ? '#00897B' :\n slot.value_pence_per_kwh >= (msg.payload.applicable_rates_max_pence || 50) ? '#EF5350' : '#FFA726',\n borderRadius:'3px'\n }\"></span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>",
|
|
982
|
+
"storeOutMessages": true,
|
|
983
|
+
"passthru": true,
|
|
984
|
+
"resendOnRefresh": true,
|
|
985
|
+
"templateScope": "local",
|
|
986
|
+
"eventsFromServer": false,
|
|
987
|
+
"x": 970,
|
|
988
|
+
"y": 1300,
|
|
989
|
+
"wires": [[]]
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"id": "widget-opt-cheapest-window",
|
|
993
|
+
"type": "ui-template",
|
|
994
|
+
"z": "tab-octopus-main",
|
|
995
|
+
"group": "ui-group-opt-samples",
|
|
996
|
+
"name": "Cheapest Window Result [SAMPLE]",
|
|
997
|
+
"order": 1,
|
|
998
|
+
"width": "6",
|
|
999
|
+
"height": "3",
|
|
1000
|
+
"className": "",
|
|
1001
|
+
"template": "<template>\n <div style=\"padding:8px;\">\n <div style=\"font-weight:bold; color:#1565C0; margin-bottom:6px;\">Cheapest Contiguous Window (SAMPLE)</div>\n <div v-if=\"msg.payload.cheapest_window\">\n <div>Duration: <strong>{{ msg.payload.duration_mins }} min</strong></div>\n <div>Start: <strong>{{ new Date(msg.payload.cheapest_window.start).toLocaleString() }}</strong></div>\n <div>End: <strong>{{ new Date(msg.payload.cheapest_window.end).toLocaleString() }}</strong></div>\n <div>Avg rate: <strong>{{ msg.payload.cheapest_window.avg }} p/kWh</strong></div>\n </div>\n <div v-else style=\"color:#888;\">No future window found in current schedule.</div>\n <div style=\"margin-top:8px; font-size:0.8em; color:#888;\">\n Edit the <code>find-cheapest-window</code> function node to change DURATION_MINS.\n </div>\n </div>\n</template>",
|
|
1002
|
+
"storeOutMessages": true,
|
|
1003
|
+
"passthru": true,
|
|
1004
|
+
"resendOnRefresh": true,
|
|
1005
|
+
"templateScope": "local",
|
|
1006
|
+
"eventsFromServer": false,
|
|
1007
|
+
"x": 970,
|
|
1008
|
+
"y": 1360,
|
|
1009
|
+
"wires": [[]]
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
"id": "widget-opt-cheapest-now",
|
|
1013
|
+
"type": "ui-template",
|
|
1014
|
+
"z": "tab-octopus-main",
|
|
1015
|
+
"group": "ui-group-opt-samples",
|
|
1016
|
+
"name": "Is Cheapest Now Result [SAMPLE]",
|
|
1017
|
+
"order": 2,
|
|
1018
|
+
"width": "6",
|
|
1019
|
+
"height": "3",
|
|
1020
|
+
"className": "",
|
|
1021
|
+
"template": "<template>\n <div style=\"padding:8px;\">\n <div style=\"font-weight:bold; color:#1565C0; margin-bottom:6px;\">Is Cheapest Rate Right Now? (SAMPLE)</div>\n <div style=\"font-size:2em; font-weight:bold;\" :style=\"{ color: msg.payload.is_cheapest_now ? '#00897B' : '#555' }\">\n {{ msg.payload.is_cheapest_now ? 'YES' : 'NO' }}\n </div>\n <div style=\"margin-top:6px; font-size:0.9em;\">\n Current: <strong>{{ msg.payload.current_pence ?? '--' }} p/kWh</strong> |\n Day min: <strong>{{ msg.payload.min_pence ?? '--' }} p/kWh</strong>\n </div>\n <div style=\"margin-top:8px; font-size:0.8em; color:#888;\">\n Wire a <strong>trigger</strong> node after <code>is-cheapest-now</code> to automate appliances at the cheapest rate.\n </div>\n </div>\n</template>",
|
|
1022
|
+
"storeOutMessages": true,
|
|
1023
|
+
"passthru": true,
|
|
1024
|
+
"resendOnRefresh": true,
|
|
1025
|
+
"templateScope": "local",
|
|
1026
|
+
"eventsFromServer": false,
|
|
1027
|
+
"x": 970,
|
|
1028
|
+
"y": 1420,
|
|
1029
|
+
"wires": [[]]
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"id": "widget-account-balance",
|
|
1033
|
+
"type": "ui-text",
|
|
1034
|
+
"z": "tab-octopus-main",
|
|
1035
|
+
"group": "ui-group-account-main",
|
|
1036
|
+
"name": "Account Balance",
|
|
1037
|
+
"label": "Account balance:",
|
|
1038
|
+
"format": "£{{msg.payload.account_balance_pounds != null ? msg.payload.account_balance_pounds : '--'}}",
|
|
1039
|
+
"layout": "row-spread",
|
|
1040
|
+
"style": false,
|
|
1041
|
+
"order": 1,
|
|
1042
|
+
"width": "4",
|
|
1043
|
+
"height": "1",
|
|
1044
|
+
"className": "",
|
|
1045
|
+
"x": 970,
|
|
1046
|
+
"y": 1480,
|
|
1047
|
+
"wires": []
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"id": "widget-account-octoplus",
|
|
1051
|
+
"type": "ui-text",
|
|
1052
|
+
"z": "tab-octopus-main",
|
|
1053
|
+
"group": "ui-group-account-main",
|
|
1054
|
+
"name": "Octoplus Status",
|
|
1055
|
+
"label": "Octoplus:",
|
|
1056
|
+
"format": "{{msg.payload.octoplus_enrolled ? 'Enrolled' : 'Not enrolled'}} | Points: {{msg.payload.octoplus_loyalty_points_user ?? '--'}}",
|
|
1057
|
+
"layout": "row-spread",
|
|
1058
|
+
"style": false,
|
|
1059
|
+
"order": 2,
|
|
1060
|
+
"width": "4",
|
|
1061
|
+
"height": "1",
|
|
1062
|
+
"className": "",
|
|
1063
|
+
"x": 970,
|
|
1064
|
+
"y": 1540,
|
|
1065
|
+
"wires": []
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"id": "widget-account-saving-session",
|
|
1069
|
+
"type": "ui-text",
|
|
1070
|
+
"z": "tab-octopus-main",
|
|
1071
|
+
"group": "ui-group-account-main",
|
|
1072
|
+
"name": "Saving Session",
|
|
1073
|
+
"label": "Saving session:",
|
|
1074
|
+
"format": "{{msg.payload.saving_session_active ? 'ACTIVE' : (msg.payload.saving_session_available ? 'Available' : 'None')}} | Points: {{msg.payload.saving_session_points ?? '--'}}",
|
|
1075
|
+
"layout": "row-spread",
|
|
1076
|
+
"style": false,
|
|
1077
|
+
"order": 3,
|
|
1078
|
+
"width": "4",
|
|
1079
|
+
"height": "1",
|
|
1080
|
+
"className": "",
|
|
1081
|
+
"x": 970,
|
|
1082
|
+
"y": 1600,
|
|
1083
|
+
"wires": []
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
"id": "widget-account-free-elec",
|
|
1087
|
+
"type": "ui-text",
|
|
1088
|
+
"z": "tab-octopus-main",
|
|
1089
|
+
"group": "ui-group-account-main",
|
|
1090
|
+
"name": "Free Electricity",
|
|
1091
|
+
"label": "Free electricity:",
|
|
1092
|
+
"format": "{{msg.payload.free_electricity_active ? 'ACTIVE NOW' : (msg.payload.free_electricity_available ? 'Available' : 'None')}}",
|
|
1093
|
+
"layout": "row-spread",
|
|
1094
|
+
"style": false,
|
|
1095
|
+
"order": 4,
|
|
1096
|
+
"width": "4",
|
|
1097
|
+
"height": "1",
|
|
1098
|
+
"className": "",
|
|
1099
|
+
"x": 970,
|
|
1100
|
+
"y": 1660,
|
|
1101
|
+
"wires": []
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"id": "widget-account-wof",
|
|
1105
|
+
"type": "ui-text",
|
|
1106
|
+
"z": "tab-octopus-main",
|
|
1107
|
+
"group": "ui-group-account-main",
|
|
1108
|
+
"name": "Wheel of Fortune Spins",
|
|
1109
|
+
"label": "WoF spins:",
|
|
1110
|
+
"format": "Electricity: {{msg.payload.wheel_of_fortune_electricity_spins ?? 0}} | Gas: {{msg.payload.wheel_of_fortune_gas_spins ?? 0}}",
|
|
1111
|
+
"layout": "row-spread",
|
|
1112
|
+
"style": false,
|
|
1113
|
+
"order": 5,
|
|
1114
|
+
"width": "4",
|
|
1115
|
+
"height": "1",
|
|
1116
|
+
"className": "",
|
|
1117
|
+
"x": 970,
|
|
1118
|
+
"y": 1720,
|
|
1119
|
+
"wires": []
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"id": "widget-mini-gauge",
|
|
1123
|
+
"type": "ui-gauge",
|
|
1124
|
+
"z": "tab-octopus-main",
|
|
1125
|
+
"group": "ui-group-account-mini",
|
|
1126
|
+
"name": "Home Mini Demand",
|
|
1127
|
+
"label": "Live demand (kW)",
|
|
1128
|
+
"order": 1,
|
|
1129
|
+
"width": "6",
|
|
1130
|
+
"height": "4",
|
|
1131
|
+
"gtype": "gauge-half",
|
|
1132
|
+
"gstyle": "needle",
|
|
1133
|
+
"topic": "",
|
|
1134
|
+
"topicType": "str",
|
|
1135
|
+
"units": "kW",
|
|
1136
|
+
"format": "{{value}}",
|
|
1137
|
+
"min": "-10",
|
|
1138
|
+
"max": "10",
|
|
1139
|
+
"segments": [
|
|
1140
|
+
{"color": "#00897B", "from": "-10"},
|
|
1141
|
+
{"color": "#FFA726", "from": "3"},
|
|
1142
|
+
{"color": "#EF5350", "from": "7"}
|
|
1143
|
+
],
|
|
1144
|
+
"className": "",
|
|
1145
|
+
"x": 970,
|
|
1146
|
+
"y": 1780,
|
|
1147
|
+
"wires": []
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
"id": "widget-mini-read-at",
|
|
1151
|
+
"type": "ui-text",
|
|
1152
|
+
"z": "tab-octopus-main",
|
|
1153
|
+
"group": "ui-group-account-mini",
|
|
1154
|
+
"name": "Home Mini Read At",
|
|
1155
|
+
"label": "Last read:",
|
|
1156
|
+
"format": "{{msg.payload.mini_read_at ? new Date(msg.payload.mini_read_at).toLocaleTimeString() : '--'}}",
|
|
1157
|
+
"layout": "row-spread",
|
|
1158
|
+
"style": false,
|
|
1159
|
+
"order": 2,
|
|
1160
|
+
"width": "6",
|
|
1161
|
+
"height": "1",
|
|
1162
|
+
"className": "",
|
|
1163
|
+
"x": 970,
|
|
1164
|
+
"y": 1840,
|
|
1165
|
+
"wires": []
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
"id": "widget-diag-api-req",
|
|
1169
|
+
"type": "ui-text",
|
|
1170
|
+
"z": "tab-octopus-main",
|
|
1171
|
+
"group": "ui-group-diag-main",
|
|
1172
|
+
"name": "API Requests per Hour",
|
|
1173
|
+
"label": "API requests/hr:",
|
|
1174
|
+
"format": "{{msg.payload.api_requests_hour ?? '--'}}",
|
|
1175
|
+
"layout": "row-spread",
|
|
1176
|
+
"style": false,
|
|
1177
|
+
"order": 1,
|
|
1178
|
+
"width": "3",
|
|
1179
|
+
"height": "1",
|
|
1180
|
+
"className": "",
|
|
1181
|
+
"x": 970,
|
|
1182
|
+
"y": 1900,
|
|
1183
|
+
"wires": []
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
"id": "widget-diag-complexity-gauge",
|
|
1187
|
+
"type": "ui-gauge",
|
|
1188
|
+
"z": "tab-octopus-main",
|
|
1189
|
+
"group": "ui-group-diag-main",
|
|
1190
|
+
"name": "API Complexity %",
|
|
1191
|
+
"label": "API complexity usage",
|
|
1192
|
+
"order": 2,
|
|
1193
|
+
"width": "3",
|
|
1194
|
+
"height": "3",
|
|
1195
|
+
"gtype": "gauge-half",
|
|
1196
|
+
"gstyle": "needle",
|
|
1197
|
+
"topic": "",
|
|
1198
|
+
"topicType": "str",
|
|
1199
|
+
"units": "%",
|
|
1200
|
+
"format": "{{value}}",
|
|
1201
|
+
"min": "0",
|
|
1202
|
+
"max": "100",
|
|
1203
|
+
"segments": [
|
|
1204
|
+
{"color": "#00897B", "from": "0"},
|
|
1205
|
+
{"color": "#FFA726", "from": "50"},
|
|
1206
|
+
{"color": "#EF5350", "from": "80"}
|
|
1207
|
+
],
|
|
1208
|
+
"className": "",
|
|
1209
|
+
"x": 970,
|
|
1210
|
+
"y": 1960,
|
|
1211
|
+
"wires": []
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
"id": "widget-diag-next-poll",
|
|
1215
|
+
"type": "ui-text",
|
|
1216
|
+
"z": "tab-octopus-main",
|
|
1217
|
+
"group": "ui-group-diag-main",
|
|
1218
|
+
"name": "Next Poll",
|
|
1219
|
+
"label": "Next poll:",
|
|
1220
|
+
"format": "{{msg.payload.next_poll ? new Date(msg.payload.next_poll).toLocaleTimeString() : '--'}}",
|
|
1221
|
+
"layout": "row-spread",
|
|
1222
|
+
"style": false,
|
|
1223
|
+
"order": 3,
|
|
1224
|
+
"width": "3",
|
|
1225
|
+
"height": "1",
|
|
1226
|
+
"className": "",
|
|
1227
|
+
"x": 970,
|
|
1228
|
+
"y": 2020,
|
|
1229
|
+
"wires": []
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
"id": "widget-diag-update",
|
|
1233
|
+
"type": "ui-text",
|
|
1234
|
+
"z": "tab-octopus-main",
|
|
1235
|
+
"group": "ui-group-diag-main",
|
|
1236
|
+
"name": "Version / Update",
|
|
1237
|
+
"label": "Version:",
|
|
1238
|
+
"format": "{{msg.payload.installed_version || '--'}} {{msg.payload.update_available ? '→ ' + msg.payload.latest_version + ' available' : '(up to date)'}}",
|
|
1239
|
+
"layout": "row-spread",
|
|
1240
|
+
"style": false,
|
|
1241
|
+
"order": 4,
|
|
1242
|
+
"width": "6",
|
|
1243
|
+
"height": "1",
|
|
1244
|
+
"className": "",
|
|
1245
|
+
"x": 970,
|
|
1246
|
+
"y": 2080,
|
|
1247
|
+
"wires": []
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"id": "widget-diag-timezone",
|
|
1251
|
+
"type": "ui-text",
|
|
1252
|
+
"z": "tab-octopus-main",
|
|
1253
|
+
"group": "ui-group-diag-main",
|
|
1254
|
+
"name": "Timezone Applied",
|
|
1255
|
+
"label": "Timezone:",
|
|
1256
|
+
"format": "{{msg.payload.timezone_applied || '--'}} (detected: {{msg.payload.timezone_detected || '--'}})",
|
|
1257
|
+
"layout": "row-spread",
|
|
1258
|
+
"style": false,
|
|
1259
|
+
"order": 5,
|
|
1260
|
+
"width": "6",
|
|
1261
|
+
"height": "1",
|
|
1262
|
+
"className": "",
|
|
1263
|
+
"x": 970,
|
|
1264
|
+
"y": 2140,
|
|
1265
|
+
"wires": []
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
"id": "widget-diag-errors-template",
|
|
1269
|
+
"type": "ui-template",
|
|
1270
|
+
"z": "tab-octopus-main",
|
|
1271
|
+
"group": "ui-group-diag-errors",
|
|
1272
|
+
"name": "Category Error List",
|
|
1273
|
+
"order": 1,
|
|
1274
|
+
"width": "12",
|
|
1275
|
+
"height": "5",
|
|
1276
|
+
"className": "",
|
|
1277
|
+
"template": "<template>\n <div style=\"font-size:0.85em;\">\n <div style=\"font-weight:bold; margin-bottom:6px;\">Per-Category Errors (null = healthy)</div>\n <table style=\"width:100%; border-collapse:collapse;\">\n <thead>\n <tr style=\"background:#37474F; color:#fff;\">\n <th style=\"padding:4px 8px; text-align:left;\">Category</th>\n <th style=\"padding:4px 8px; text-align:left;\">Status</th>\n </tr>\n </thead>\n <tbody>\n <template v-for=\"(key, i) in [\n 'intelligent_error', 'electricity_tariff_error', 'electricity_consumption_error',\n 'electricity_export_rate_error', 'electricity_export_consumption_error',\n 'gas_tariff_error', 'gas_consumption_error',\n 'account_error', 'octoplus_error', 'saving_sessions_error',\n 'free_electricity_error', 'wheel_of_fortune_error',\n 'home_mini_error', 'update_check_error', 'applicable_rates_error'\n ]\" :key=\"i\">\n <tr v-if=\"msg.payload[key] != null\"\n :style=\"{ background: i % 2 === 0 ? '#fff3f3' : '#ffe0e0' }\">\n <td style=\"padding:4px 8px; font-weight:bold;\">{{ key.replace('_error','') }}</td>\n <td style=\"padding:4px 8px; color:#c62828;\">{{ msg.payload[key] }}</td>\n </tr>\n </template>\n <tr v-if=\"Object.keys(msg.payload).filter(k => k.endsWith('_error') && msg.payload[k] != null).length === 0\">\n <td colspan=\"2\" style=\"padding:10px; text-align:center; color:#00897B; font-weight:bold;\">All categories healthy</td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>",
|
|
1278
|
+
"storeOutMessages": true,
|
|
1279
|
+
"passthru": true,
|
|
1280
|
+
"resendOnRefresh": true,
|
|
1281
|
+
"templateScope": "local",
|
|
1282
|
+
"eventsFromServer": false,
|
|
1283
|
+
"x": 970,
|
|
1284
|
+
"y": 2200,
|
|
1285
|
+
"wires": [[]]
|
|
1286
|
+
}
|
|
1287
|
+
]
|