node-red-contrib-octopus-intelligent 1.5.0 → 1.7.0
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 +597 -442
- package/README.md +1234 -980
- package/examples/basic-monitoring.json +1 -1
- package/examples/boost-on-cheap-or-surplus.json +171 -0
- package/examples/charging-and-error-alerts.json +95 -0
- package/examples/cheapest-window-planner.json +165 -0
- package/examples/daily-charging-summary.json +165 -0
- package/examples/ha-dashboard.yaml +667 -599
- package/examples/mqtt-integration.json +1 -1
- package/examples/node-red-dashboard-flow.json +1377 -1199
- package/examples/set-preferences.json +1 -1
- package/lib/active-now.js +33 -0
- package/lib/api-metrics.js +31 -31
- package/lib/auth.js +25 -20
- package/lib/boost.js +85 -0
- package/lib/categories/account.js +32 -32
- package/lib/categories/applicable-rates.js +137 -127
- package/lib/categories/completed-dispatches.js +36 -35
- package/lib/categories/electricity.js +156 -146
- package/lib/categories/flex-planned-dispatches.js +36 -36
- package/lib/categories/free-electricity.js +73 -61
- package/lib/categories/gas.js +102 -95
- package/lib/categories/home-mini.js +45 -37
- package/lib/categories/intelligent.js +221 -124
- package/lib/categories/octoplus.js +35 -32
- package/lib/categories/saving-sessions.js +78 -64
- package/lib/categories/smartflex-inverter.js +95 -0
- package/lib/categories/smartflex-vehicle.js +198 -0
- package/lib/categories/wheel-of-fortune.js +50 -49
- package/lib/commands.js +69 -0
- package/lib/discovery-retry.js +16 -0
- package/lib/discovery.js +154 -85
- package/lib/graphql-errors.js +174 -0
- package/lib/graphql.js +141 -44
- package/lib/http-get-json.js +80 -22
- package/lib/payload.js +104 -88
- package/lib/poll-retry.js +71 -0
- package/lib/poll-tick.js +112 -44
- package/lib/preferences.js +34 -0
- package/lib/scheduler.js +85 -47
- package/lib/sensor-definitions.js +269 -0
- package/lib/timezone.js +67 -49
- package/lib/update-check.js +38 -38
- package/lib/values.js +47 -0
- package/octopus-intelligent.html +258 -205
- package/octopus-intelligent.js +2816 -1807
- package/package.json +54 -54
|
@@ -1,1199 +1,1377 @@
|
|
|
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-
|
|
158
|
-
"type": "ui-group",
|
|
159
|
-
"name": "
|
|
160
|
-
"page": "ui-page-
|
|
161
|
-
"width": "6",
|
|
162
|
-
"height": "1",
|
|
163
|
-
"order":
|
|
164
|
-
"showTitle": true,
|
|
165
|
-
"className": "",
|
|
166
|
-
"visible": true,
|
|
167
|
-
"disabled": false
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"id": "ui-group-tariff-
|
|
171
|
-
"type": "ui-group",
|
|
172
|
-
"name": "
|
|
173
|
-
"page": "ui-page-tariff",
|
|
174
|
-
"width": "6",
|
|
175
|
-
"height": "1",
|
|
176
|
-
"order":
|
|
177
|
-
"showTitle": true,
|
|
178
|
-
"className": "",
|
|
179
|
-
"visible": true,
|
|
180
|
-
"disabled": false
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"id": "ui-group-tariff-
|
|
184
|
-
"type": "ui-group",
|
|
185
|
-
"name": "Rate
|
|
186
|
-
"page": "ui-page-tariff",
|
|
187
|
-
"width": "6",
|
|
188
|
-
"height": "1",
|
|
189
|
-
"order":
|
|
190
|
-
"showTitle": true,
|
|
191
|
-
"className": "",
|
|
192
|
-
"visible": true,
|
|
193
|
-
"disabled": false
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"id": "ui-group-
|
|
197
|
-
"type": "ui-group",
|
|
198
|
-
"name": "Rate
|
|
199
|
-
"page": "ui-page-
|
|
200
|
-
"width": "
|
|
201
|
-
"height": "1",
|
|
202
|
-
"order":
|
|
203
|
-
"showTitle": true,
|
|
204
|
-
"className": "",
|
|
205
|
-
"visible": true,
|
|
206
|
-
"disabled": false
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"id": "ui-group-opt-
|
|
210
|
-
"type": "ui-group",
|
|
211
|
-
"name": "
|
|
212
|
-
"page": "ui-page-optimization",
|
|
213
|
-
"width": "12",
|
|
214
|
-
"height": "1",
|
|
215
|
-
"order":
|
|
216
|
-
"showTitle": true,
|
|
217
|
-
"className": "",
|
|
218
|
-
"visible": true,
|
|
219
|
-
"disabled": false
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"id": "ui-group-
|
|
223
|
-
"type": "ui-group",
|
|
224
|
-
"name": "
|
|
225
|
-
"page": "ui-page-
|
|
226
|
-
"width": "
|
|
227
|
-
"height": "1",
|
|
228
|
-
"order":
|
|
229
|
-
"showTitle": true,
|
|
230
|
-
"className": "",
|
|
231
|
-
"visible": true,
|
|
232
|
-
"disabled": false
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"id": "ui-group-account-
|
|
236
|
-
"type": "ui-group",
|
|
237
|
-
"name": "
|
|
238
|
-
"page": "ui-page-account",
|
|
239
|
-
"width": "6",
|
|
240
|
-
"height": "1",
|
|
241
|
-
"order":
|
|
242
|
-
"showTitle": true,
|
|
243
|
-
"className": "",
|
|
244
|
-
"visible": true,
|
|
245
|
-
"disabled": false
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"id": "ui-group-
|
|
249
|
-
"type": "ui-group",
|
|
250
|
-
"name": "
|
|
251
|
-
"page": "ui-page-
|
|
252
|
-
"width": "6",
|
|
253
|
-
"height": "1",
|
|
254
|
-
"order":
|
|
255
|
-
"showTitle": true,
|
|
256
|
-
"className": "",
|
|
257
|
-
"visible": true,
|
|
258
|
-
"disabled": false
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
"id": "ui-group-diag-
|
|
262
|
-
"type": "ui-group",
|
|
263
|
-
"name": "
|
|
264
|
-
"page": "ui-page-diagnostics",
|
|
265
|
-
"width": "6",
|
|
266
|
-
"height": "1",
|
|
267
|
-
"order":
|
|
268
|
-
"showTitle": true,
|
|
269
|
-
"className": "",
|
|
270
|
-
"visible": true,
|
|
271
|
-
"disabled": false
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
"id": "
|
|
275
|
-
"type": "
|
|
276
|
-
"name": "
|
|
277
|
-
"
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
"
|
|
296
|
-
"
|
|
297
|
-
"
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
"widget-
|
|
324
|
-
"widget-
|
|
325
|
-
"
|
|
326
|
-
"widget-
|
|
327
|
-
"widget-
|
|
328
|
-
"
|
|
329
|
-
"
|
|
330
|
-
"
|
|
331
|
-
"widget-
|
|
332
|
-
"widget-
|
|
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": 520,
|
|
455
|
-
"wires": [["node-octopus-main"]]
|
|
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
|
-
"order": 5,
|
|
682
|
-
"width": "
|
|
683
|
-
"height": "1",
|
|
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
|
-
|
|
812
|
-
"
|
|
813
|
-
"
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
"
|
|
817
|
-
"
|
|
818
|
-
"
|
|
819
|
-
"
|
|
820
|
-
"
|
|
821
|
-
"
|
|
822
|
-
"
|
|
823
|
-
"
|
|
824
|
-
"
|
|
825
|
-
"
|
|
826
|
-
"
|
|
827
|
-
"
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
"
|
|
831
|
-
"
|
|
832
|
-
"
|
|
833
|
-
"
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
"
|
|
839
|
-
"
|
|
840
|
-
"
|
|
841
|
-
"
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
"
|
|
845
|
-
"
|
|
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
|
-
"
|
|
900
|
-
"
|
|
901
|
-
"
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
"
|
|
907
|
-
"
|
|
908
|
-
"
|
|
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
|
-
"name": "
|
|
967
|
-
"
|
|
968
|
-
"
|
|
969
|
-
"
|
|
970
|
-
"
|
|
971
|
-
"
|
|
972
|
-
"
|
|
973
|
-
"
|
|
974
|
-
"
|
|
975
|
-
"
|
|
976
|
-
"
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
"
|
|
981
|
-
"
|
|
982
|
-
"z": "tab-octopus-main",
|
|
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
|
-
"x": 970,
|
|
1058
|
-
"y":
|
|
1059
|
-
"wires": []
|
|
1060
|
-
},
|
|
1061
|
-
{
|
|
1062
|
-
"id": "widget-
|
|
1063
|
-
"type": "ui-
|
|
1064
|
-
"z": "tab-octopus-main",
|
|
1065
|
-
"group": "ui-group-
|
|
1066
|
-
"name": "
|
|
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
|
-
"order":
|
|
1186
|
-
"width": "
|
|
1187
|
-
"height": "
|
|
1188
|
-
"className": "",
|
|
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-status-vehicle",
|
|
158
|
+
"type": "ui-group",
|
|
159
|
+
"name": "Vehicle",
|
|
160
|
+
"page": "ui-page-status",
|
|
161
|
+
"width": "6",
|
|
162
|
+
"height": "1",
|
|
163
|
+
"order": 3,
|
|
164
|
+
"showTitle": true,
|
|
165
|
+
"className": "",
|
|
166
|
+
"visible": true,
|
|
167
|
+
"disabled": false
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "ui-group-tariff-current",
|
|
171
|
+
"type": "ui-group",
|
|
172
|
+
"name": "Current Rates",
|
|
173
|
+
"page": "ui-page-tariff",
|
|
174
|
+
"width": "6",
|
|
175
|
+
"height": "1",
|
|
176
|
+
"order": 1,
|
|
177
|
+
"showTitle": true,
|
|
178
|
+
"className": "",
|
|
179
|
+
"visible": true,
|
|
180
|
+
"disabled": false
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "ui-group-tariff-stats",
|
|
184
|
+
"type": "ui-group",
|
|
185
|
+
"name": "Rate Statistics (24h)",
|
|
186
|
+
"page": "ui-page-tariff",
|
|
187
|
+
"width": "6",
|
|
188
|
+
"height": "1",
|
|
189
|
+
"order": 2,
|
|
190
|
+
"showTitle": true,
|
|
191
|
+
"className": "",
|
|
192
|
+
"visible": true,
|
|
193
|
+
"disabled": false
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "ui-group-tariff-bands",
|
|
197
|
+
"type": "ui-group",
|
|
198
|
+
"name": "Rate Bands",
|
|
199
|
+
"page": "ui-page-tariff",
|
|
200
|
+
"width": "6",
|
|
201
|
+
"height": "1",
|
|
202
|
+
"order": 3,
|
|
203
|
+
"showTitle": true,
|
|
204
|
+
"className": "",
|
|
205
|
+
"visible": true,
|
|
206
|
+
"disabled": false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "ui-group-opt-schedule",
|
|
210
|
+
"type": "ui-group",
|
|
211
|
+
"name": "Rate Schedule",
|
|
212
|
+
"page": "ui-page-optimization",
|
|
213
|
+
"width": "12",
|
|
214
|
+
"height": "1",
|
|
215
|
+
"order": 1,
|
|
216
|
+
"showTitle": true,
|
|
217
|
+
"className": "",
|
|
218
|
+
"visible": true,
|
|
219
|
+
"disabled": false
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "ui-group-opt-samples",
|
|
223
|
+
"type": "ui-group",
|
|
224
|
+
"name": "Sample Derivations (User-Modifiable)",
|
|
225
|
+
"page": "ui-page-optimization",
|
|
226
|
+
"width": "12",
|
|
227
|
+
"height": "1",
|
|
228
|
+
"order": 2,
|
|
229
|
+
"showTitle": true,
|
|
230
|
+
"className": "",
|
|
231
|
+
"visible": true,
|
|
232
|
+
"disabled": false
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"id": "ui-group-account-main",
|
|
236
|
+
"type": "ui-group",
|
|
237
|
+
"name": "Account & Rewards",
|
|
238
|
+
"page": "ui-page-account",
|
|
239
|
+
"width": "6",
|
|
240
|
+
"height": "1",
|
|
241
|
+
"order": 1,
|
|
242
|
+
"showTitle": true,
|
|
243
|
+
"className": "",
|
|
244
|
+
"visible": true,
|
|
245
|
+
"disabled": false
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"id": "ui-group-account-mini",
|
|
249
|
+
"type": "ui-group",
|
|
250
|
+
"name": "Home Mini Live",
|
|
251
|
+
"page": "ui-page-account",
|
|
252
|
+
"width": "6",
|
|
253
|
+
"height": "1",
|
|
254
|
+
"order": 2,
|
|
255
|
+
"showTitle": true,
|
|
256
|
+
"className": "",
|
|
257
|
+
"visible": true,
|
|
258
|
+
"disabled": false
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"id": "ui-group-diag-main",
|
|
262
|
+
"type": "ui-group",
|
|
263
|
+
"name": "API & System",
|
|
264
|
+
"page": "ui-page-diagnostics",
|
|
265
|
+
"width": "6",
|
|
266
|
+
"height": "1",
|
|
267
|
+
"order": 1,
|
|
268
|
+
"showTitle": true,
|
|
269
|
+
"className": "",
|
|
270
|
+
"visible": true,
|
|
271
|
+
"disabled": false
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"id": "ui-group-diag-errors",
|
|
275
|
+
"type": "ui-group",
|
|
276
|
+
"name": "Category Errors",
|
|
277
|
+
"page": "ui-page-diagnostics",
|
|
278
|
+
"width": "6",
|
|
279
|
+
"height": "1",
|
|
280
|
+
"order": 2,
|
|
281
|
+
"showTitle": true,
|
|
282
|
+
"className": "",
|
|
283
|
+
"visible": true,
|
|
284
|
+
"disabled": false
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"id": "node-octopus-main",
|
|
288
|
+
"type": "octopus-intelligent",
|
|
289
|
+
"name": "Octopus Intelligent",
|
|
290
|
+
"z": "tab-octopus-main",
|
|
291
|
+
"accountNumber": "A-XXXXXXXX",
|
|
292
|
+
"refreshInterval": "5",
|
|
293
|
+
"enableMqtt": false,
|
|
294
|
+
"timezoneOverride": "",
|
|
295
|
+
"x": 200,
|
|
296
|
+
"y": 100,
|
|
297
|
+
"wires": [
|
|
298
|
+
[
|
|
299
|
+
"fn-route-pages",
|
|
300
|
+
"fn-find-cheapest-window",
|
|
301
|
+
"fn-is-cheapest-now"
|
|
302
|
+
]
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"id": "fn-route-pages",
|
|
307
|
+
"type": "function",
|
|
308
|
+
"name": "Fan out to all page branches",
|
|
309
|
+
"z": "tab-octopus-main",
|
|
310
|
+
"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;",
|
|
311
|
+
"outputs": 1,
|
|
312
|
+
"noerr": 0,
|
|
313
|
+
"initialize": "",
|
|
314
|
+
"finalize": "",
|
|
315
|
+
"libs": [],
|
|
316
|
+
"x": 470,
|
|
317
|
+
"y": 100,
|
|
318
|
+
"wires": [
|
|
319
|
+
[
|
|
320
|
+
"fn-controls-status",
|
|
321
|
+
"fn-controls-charge-cap-state",
|
|
322
|
+
"fn-controls-boost-state",
|
|
323
|
+
"widget-status-charging-now",
|
|
324
|
+
"widget-status-source",
|
|
325
|
+
"widget-status-confirmed-limit",
|
|
326
|
+
"widget-status-confirmed-time",
|
|
327
|
+
"widget-status-next-start",
|
|
328
|
+
"widget-status-window",
|
|
329
|
+
"fn-extract-import-rate",
|
|
330
|
+
"fn-extract-export-rate",
|
|
331
|
+
"widget-tariff-stats-table",
|
|
332
|
+
"widget-tariff-bands-template",
|
|
333
|
+
"widget-opt-schedule-template",
|
|
334
|
+
"widget-status-slots-template",
|
|
335
|
+
"widget-status-vehicle-template",
|
|
336
|
+
"widget-account-balance",
|
|
337
|
+
"widget-account-octoplus",
|
|
338
|
+
"widget-account-saving-session",
|
|
339
|
+
"widget-account-free-elec",
|
|
340
|
+
"widget-account-wof",
|
|
341
|
+
"fn-extract-mini-kw",
|
|
342
|
+
"widget-mini-read-at",
|
|
343
|
+
"widget-diag-api-req",
|
|
344
|
+
"fn-extract-complexity",
|
|
345
|
+
"widget-diag-next-poll",
|
|
346
|
+
"widget-diag-update",
|
|
347
|
+
"widget-diag-timezone",
|
|
348
|
+
"widget-diag-errors-template"
|
|
349
|
+
]
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"id": "fn-controls-status",
|
|
354
|
+
"type": "function",
|
|
355
|
+
"name": "Extract current confirmed settings for Controls page",
|
|
356
|
+
"z": "tab-octopus-main",
|
|
357
|
+
"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 'Boost: ' + (msg.payload.boosting ? 'ON' : 'OFF'),\n 'Charging now: ' + (msg.payload.charging_now ? 'YES' : 'NO')\n].join(' | ');\nreturn msg;",
|
|
358
|
+
"outputs": 1,
|
|
359
|
+
"noerr": 0,
|
|
360
|
+
"initialize": "",
|
|
361
|
+
"finalize": "",
|
|
362
|
+
"libs": [],
|
|
363
|
+
"x": 760,
|
|
364
|
+
"y": 60,
|
|
365
|
+
"wires": [["widget-controls-status"]]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"id": "fn-find-cheapest-window",
|
|
369
|
+
"type": "function",
|
|
370
|
+
"name": "find-cheapest-window [SAMPLE — edit freely]",
|
|
371
|
+
"z": "tab-octopus-main",
|
|
372
|
+
"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;",
|
|
373
|
+
"outputs": 1,
|
|
374
|
+
"noerr": 0,
|
|
375
|
+
"initialize": "",
|
|
376
|
+
"finalize": "",
|
|
377
|
+
"libs": [],
|
|
378
|
+
"x": 470,
|
|
379
|
+
"y": 160,
|
|
380
|
+
"wires": [["widget-opt-cheapest-window"]]
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"id": "fn-is-cheapest-now",
|
|
384
|
+
"type": "function",
|
|
385
|
+
"name": "is-cheapest-now [SAMPLE — edit freely]",
|
|
386
|
+
"z": "tab-octopus-main",
|
|
387
|
+
"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;",
|
|
388
|
+
"outputs": 1,
|
|
389
|
+
"noerr": 0,
|
|
390
|
+
"initialize": "",
|
|
391
|
+
"finalize": "",
|
|
392
|
+
"libs": [],
|
|
393
|
+
"x": 470,
|
|
394
|
+
"y": 220,
|
|
395
|
+
"wires": [["widget-opt-cheapest-now"]]
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"id": "fn-apply-limit",
|
|
399
|
+
"type": "function",
|
|
400
|
+
"name": "Wrap limit as set_limit command",
|
|
401
|
+
"z": "tab-octopus-main",
|
|
402
|
+
"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;",
|
|
403
|
+
"outputs": 1,
|
|
404
|
+
"noerr": 0,
|
|
405
|
+
"initialize": "",
|
|
406
|
+
"finalize": "",
|
|
407
|
+
"libs": [],
|
|
408
|
+
"x": 760,
|
|
409
|
+
"y": 280,
|
|
410
|
+
"wires": [["node-octopus-main"]]
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"id": "fn-apply-time",
|
|
414
|
+
"type": "function",
|
|
415
|
+
"name": "Wrap time as set_time command",
|
|
416
|
+
"z": "tab-octopus-main",
|
|
417
|
+
"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;",
|
|
418
|
+
"outputs": 1,
|
|
419
|
+
"noerr": 0,
|
|
420
|
+
"initialize": "",
|
|
421
|
+
"finalize": "",
|
|
422
|
+
"libs": [],
|
|
423
|
+
"x": 760,
|
|
424
|
+
"y": 340,
|
|
425
|
+
"wires": [["node-octopus-main"]]
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"id": "fn-apply-smart",
|
|
429
|
+
"type": "function",
|
|
430
|
+
"name": "Wrap smart charging toggle as set_smart_charging 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_smart_charging: 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": 400,
|
|
440
|
+
"wires": [["node-octopus-main"]]
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"id": "fn-apply-charge-cap",
|
|
444
|
+
"type": "function",
|
|
445
|
+
"name": "Wrap Charge Cap toggle as set_charge_cap command",
|
|
446
|
+
"z": "tab-octopus-main",
|
|
447
|
+
"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;",
|
|
448
|
+
"outputs": 1,
|
|
449
|
+
"noerr": 0,
|
|
450
|
+
"initialize": "",
|
|
451
|
+
"finalize": "",
|
|
452
|
+
"libs": [],
|
|
453
|
+
"x": 760,
|
|
454
|
+
"y": 520,
|
|
455
|
+
"wires": [["node-octopus-main"]]
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"id": "fn-controls-charge-cap-state",
|
|
459
|
+
"type": "function",
|
|
460
|
+
"name": "Drive Charge Cap switch from charge_cap",
|
|
461
|
+
"z": "tab-octopus-main",
|
|
462
|
+
"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 };",
|
|
463
|
+
"outputs": 1,
|
|
464
|
+
"noerr": 0,
|
|
465
|
+
"initialize": "",
|
|
466
|
+
"finalize": "",
|
|
467
|
+
"libs": [],
|
|
468
|
+
"x": 760,
|
|
469
|
+
"y": 580,
|
|
470
|
+
"wires": [["widget-controls-charge-cap"]]
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"id": "fn-apply-boost",
|
|
474
|
+
"type": "function",
|
|
475
|
+
"name": "Wrap Boost Charge toggle as set_boost command",
|
|
476
|
+
"z": "tab-octopus-main",
|
|
477
|
+
"func": "// Receives true/false from the ui-switch and wraps it\n// into the command shape expected by the Octopus Intelligent node.\n// true starts a boost (charge now, outside the plan). false cancels it.\nmsg.payload = { set_boost: msg.payload === true || msg.payload === 'true' };\nreturn msg;",
|
|
478
|
+
"outputs": 1,
|
|
479
|
+
"noerr": 0,
|
|
480
|
+
"initialize": "",
|
|
481
|
+
"finalize": "",
|
|
482
|
+
"libs": [],
|
|
483
|
+
"x": 760,
|
|
484
|
+
"y": 640,
|
|
485
|
+
"wires": [["node-octopus-main"]]
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"id": "fn-controls-boost-state",
|
|
489
|
+
"type": "function",
|
|
490
|
+
"name": "Drive Boost Charge switch from boosting",
|
|
491
|
+
"z": "tab-octopus-main",
|
|
492
|
+
"func": "// Sets the Boost Charge switch from the node's boosting output field.\n// boosting is true/false, or null until the node knows: then nothing\n// 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.boosting;\nif (typeof v !== 'boolean') return null;\nreturn { payload: v };",
|
|
493
|
+
"outputs": 1,
|
|
494
|
+
"noerr": 0,
|
|
495
|
+
"initialize": "",
|
|
496
|
+
"finalize": "",
|
|
497
|
+
"libs": [],
|
|
498
|
+
"x": 760,
|
|
499
|
+
"y": 700,
|
|
500
|
+
"wires": [["widget-controls-boost"]]
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"id": "fn-apply-timezone",
|
|
504
|
+
"type": "function",
|
|
505
|
+
"name": "Wrap timezone as set_timezone command",
|
|
506
|
+
"z": "tab-octopus-main",
|
|
507
|
+
"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;",
|
|
508
|
+
"outputs": 1,
|
|
509
|
+
"noerr": 0,
|
|
510
|
+
"initialize": "",
|
|
511
|
+
"finalize": "",
|
|
512
|
+
"libs": [],
|
|
513
|
+
"x": 760,
|
|
514
|
+
"y": 460,
|
|
515
|
+
"wires": [["node-octopus-main"]]
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"id": "inject-refresh",
|
|
519
|
+
"type": "inject",
|
|
520
|
+
"name": "Refresh (inject trigger)",
|
|
521
|
+
"z": "tab-octopus-main",
|
|
522
|
+
"props": [{"p": "payload"}],
|
|
523
|
+
"repeat": "",
|
|
524
|
+
"crontab": "",
|
|
525
|
+
"once": false,
|
|
526
|
+
"topic": "",
|
|
527
|
+
"payload": "{\"refresh\":true}",
|
|
528
|
+
"payloadType": "json",
|
|
529
|
+
"x": 200,
|
|
530
|
+
"y": 520,
|
|
531
|
+
"wires": [["node-octopus-main"]]
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"id": "widget-controls-limit",
|
|
535
|
+
"type": "ui-number-input",
|
|
536
|
+
"z": "tab-octopus-main",
|
|
537
|
+
"group": "ui-group-controls-ev",
|
|
538
|
+
"name": "Target Charge Limit",
|
|
539
|
+
"label": "Target limit (%)",
|
|
540
|
+
"tooltip": "Set the target charge limit (5–100, step 5). Click Apply after adjusting.",
|
|
541
|
+
"order": 1,
|
|
542
|
+
"width": "6",
|
|
543
|
+
"height": "1",
|
|
544
|
+
"topic": "set_limit",
|
|
545
|
+
"topicType": "str",
|
|
546
|
+
"min": "5",
|
|
547
|
+
"max": "100",
|
|
548
|
+
"step": "5",
|
|
549
|
+
"wrap": false,
|
|
550
|
+
"className": "",
|
|
551
|
+
"x": 970,
|
|
552
|
+
"y": 280,
|
|
553
|
+
"wires": [["fn-apply-limit"]]
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"id": "widget-controls-ready-time",
|
|
557
|
+
"type": "ui-dropdown",
|
|
558
|
+
"z": "tab-octopus-main",
|
|
559
|
+
"group": "ui-group-controls-ev",
|
|
560
|
+
"name": "Ready By Time",
|
|
561
|
+
"label": "Ready by",
|
|
562
|
+
"tooltip": "Time the car should be fully charged by. Click Apply after selecting.",
|
|
563
|
+
"order": 2,
|
|
564
|
+
"width": "6",
|
|
565
|
+
"height": "1",
|
|
566
|
+
"topic": "set_time",
|
|
567
|
+
"topicType": "str",
|
|
568
|
+
"options": [
|
|
569
|
+
{"label": "00:00", "value": "00:00"},
|
|
570
|
+
{"label": "00:30", "value": "00:30"},
|
|
571
|
+
{"label": "01:00", "value": "01:00"},
|
|
572
|
+
{"label": "01:30", "value": "01:30"},
|
|
573
|
+
{"label": "02:00", "value": "02:00"},
|
|
574
|
+
{"label": "02:30", "value": "02:30"},
|
|
575
|
+
{"label": "03:00", "value": "03:00"},
|
|
576
|
+
{"label": "03:30", "value": "03:30"},
|
|
577
|
+
{"label": "04:00", "value": "04:00"},
|
|
578
|
+
{"label": "04:30", "value": "04:30"},
|
|
579
|
+
{"label": "05:00", "value": "05:00"},
|
|
580
|
+
{"label": "05:30", "value": "05:30"},
|
|
581
|
+
{"label": "06:00", "value": "06:00"},
|
|
582
|
+
{"label": "06:30", "value": "06:30"},
|
|
583
|
+
{"label": "07:00", "value": "07:00"},
|
|
584
|
+
{"label": "07:30", "value": "07:30"},
|
|
585
|
+
{"label": "08:00", "value": "08:00"},
|
|
586
|
+
{"label": "08:30", "value": "08:30"},
|
|
587
|
+
{"label": "09:00", "value": "09:00"},
|
|
588
|
+
{"label": "09:30", "value": "09:30"},
|
|
589
|
+
{"label": "10:00", "value": "10:00"},
|
|
590
|
+
{"label": "10:30", "value": "10:30"},
|
|
591
|
+
{"label": "11:00", "value": "11:00"},
|
|
592
|
+
{"label": "11:30", "value": "11:30"},
|
|
593
|
+
{"label": "12:00", "value": "12:00"},
|
|
594
|
+
{"label": "12:30", "value": "12:30"},
|
|
595
|
+
{"label": "13:00", "value": "13:00"},
|
|
596
|
+
{"label": "13:30", "value": "13:30"},
|
|
597
|
+
{"label": "14:00", "value": "14:00"},
|
|
598
|
+
{"label": "14:30", "value": "14:30"},
|
|
599
|
+
{"label": "15:00", "value": "15:00"},
|
|
600
|
+
{"label": "15:30", "value": "15:30"},
|
|
601
|
+
{"label": "16:00", "value": "16:00"},
|
|
602
|
+
{"label": "16:30", "value": "16:30"},
|
|
603
|
+
{"label": "17:00", "value": "17:00"},
|
|
604
|
+
{"label": "17:30", "value": "17:30"},
|
|
605
|
+
{"label": "18:00", "value": "18:00"},
|
|
606
|
+
{"label": "18:30", "value": "18:30"},
|
|
607
|
+
{"label": "19:00", "value": "19:00"},
|
|
608
|
+
{"label": "19:30", "value": "19:30"},
|
|
609
|
+
{"label": "20:00", "value": "20:00"},
|
|
610
|
+
{"label": "20:30", "value": "20:30"},
|
|
611
|
+
{"label": "21:00", "value": "21:00"},
|
|
612
|
+
{"label": "21:30", "value": "21:30"},
|
|
613
|
+
{"label": "22:00", "value": "22:00"},
|
|
614
|
+
{"label": "22:30", "value": "22:30"},
|
|
615
|
+
{"label": "23:00", "value": "23:00"},
|
|
616
|
+
{"label": "23:30", "value": "23:30"}
|
|
617
|
+
],
|
|
618
|
+
"allowInput": false,
|
|
619
|
+
"className": "",
|
|
620
|
+
"x": 970,
|
|
621
|
+
"y": 340,
|
|
622
|
+
"wires": [["fn-apply-time"]]
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"id": "widget-controls-smart",
|
|
626
|
+
"type": "ui-switch",
|
|
627
|
+
"z": "tab-octopus-main",
|
|
628
|
+
"group": "ui-group-controls-ev",
|
|
629
|
+
"name": "Smart Charging",
|
|
630
|
+
"label": "Smart Charging",
|
|
631
|
+
"tooltip": "Enable or disable Octopus Intelligent smart charging.",
|
|
632
|
+
"order": 3,
|
|
633
|
+
"width": "6",
|
|
634
|
+
"height": "1",
|
|
635
|
+
"topic": "set_smart_charging",
|
|
636
|
+
"topicType": "str",
|
|
637
|
+
"stateOn": true,
|
|
638
|
+
"stateOff": false,
|
|
639
|
+
"stateOnLabel": "Enabled",
|
|
640
|
+
"stateOffLabel": "Disabled",
|
|
641
|
+
"colorOn": "#00897B",
|
|
642
|
+
"colorOff": "#ccc",
|
|
643
|
+
"className": "",
|
|
644
|
+
"x": 970,
|
|
645
|
+
"y": 400,
|
|
646
|
+
"wires": [["fn-apply-smart"]]
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"id": "widget-controls-charge-cap",
|
|
650
|
+
"type": "ui-switch",
|
|
651
|
+
"z": "tab-octopus-main",
|
|
652
|
+
"group": "ui-group-controls-ev",
|
|
653
|
+
"name": "Charge Cap",
|
|
654
|
+
"label": "Charge Cap",
|
|
655
|
+
"tooltip": "Limit smart charging to off-peak rates only (as in the Octopus app).",
|
|
656
|
+
"order": 4,
|
|
657
|
+
"width": "6",
|
|
658
|
+
"height": "1",
|
|
659
|
+
"passthru": false,
|
|
660
|
+
"topic": "set_charge_cap",
|
|
661
|
+
"topicType": "str",
|
|
662
|
+
"stateOn": true,
|
|
663
|
+
"stateOff": false,
|
|
664
|
+
"stateOnLabel": "On",
|
|
665
|
+
"stateOffLabel": "Off",
|
|
666
|
+
"colorOn": "#00897B",
|
|
667
|
+
"colorOff": "#ccc",
|
|
668
|
+
"className": "",
|
|
669
|
+
"x": 1180,
|
|
670
|
+
"y": 400,
|
|
671
|
+
"wires": [["fn-apply-charge-cap"]]
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"id": "widget-controls-boost",
|
|
675
|
+
"type": "ui-switch",
|
|
676
|
+
"z": "tab-octopus-main",
|
|
677
|
+
"group": "ui-group-controls-ev",
|
|
678
|
+
"name": "Boost Charge",
|
|
679
|
+
"label": "Boost Charge",
|
|
680
|
+
"tooltip": "Charge now, outside the Octopus plan. Turn off to cancel the boost. Octopus can refuse a boost, for example when the car is unplugged or full.",
|
|
681
|
+
"order": 5,
|
|
682
|
+
"width": "6",
|
|
683
|
+
"height": "1",
|
|
684
|
+
"passthru": false,
|
|
685
|
+
"topic": "set_boost",
|
|
686
|
+
"topicType": "str",
|
|
687
|
+
"stateOn": true,
|
|
688
|
+
"stateOff": false,
|
|
689
|
+
"stateOnLabel": "Boosting",
|
|
690
|
+
"stateOffLabel": "Off",
|
|
691
|
+
"colorOn": "#E65100",
|
|
692
|
+
"colorOff": "#ccc",
|
|
693
|
+
"className": "",
|
|
694
|
+
"x": 1180,
|
|
695
|
+
"y": 460,
|
|
696
|
+
"wires": [["fn-apply-boost"]]
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
"id": "widget-controls-refresh",
|
|
700
|
+
"type": "ui-button",
|
|
701
|
+
"z": "tab-octopus-main",
|
|
702
|
+
"group": "ui-group-controls-sys",
|
|
703
|
+
"name": "Refresh Now",
|
|
704
|
+
"label": "Refresh",
|
|
705
|
+
"tooltip": "Trigger an immediate API poll. Note: the node has no rate limit on Node-RED input messages.",
|
|
706
|
+
"order": 1,
|
|
707
|
+
"width": "3",
|
|
708
|
+
"height": "1",
|
|
709
|
+
"topic": "refresh",
|
|
710
|
+
"topicType": "str",
|
|
711
|
+
"payload": "{\"refresh\":true}",
|
|
712
|
+
"payloadType": "json",
|
|
713
|
+
"className": "",
|
|
714
|
+
"x": 970,
|
|
715
|
+
"y": 460,
|
|
716
|
+
"wires": [["node-octopus-main"]]
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"id": "widget-controls-timezone",
|
|
720
|
+
"type": "ui-text-input",
|
|
721
|
+
"z": "tab-octopus-main",
|
|
722
|
+
"group": "ui-group-controls-sys",
|
|
723
|
+
"name": "Timezone Override",
|
|
724
|
+
"label": "Timezone (e.g. Europe/London)",
|
|
725
|
+
"tooltip": "Override the detected timezone. Leave blank to use auto-detected. Press Enter to apply.",
|
|
726
|
+
"order": 2,
|
|
727
|
+
"width": "6",
|
|
728
|
+
"height": "1",
|
|
729
|
+
"topic": "set_timezone",
|
|
730
|
+
"topicType": "str",
|
|
731
|
+
"mode": "text",
|
|
732
|
+
"sendOnBlur": true,
|
|
733
|
+
"clearable": true,
|
|
734
|
+
"className": "",
|
|
735
|
+
"x": 970,
|
|
736
|
+
"y": 520,
|
|
737
|
+
"wires": [["fn-apply-timezone"]]
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"id": "widget-controls-status",
|
|
741
|
+
"type": "ui-text",
|
|
742
|
+
"z": "tab-octopus-main",
|
|
743
|
+
"group": "ui-group-controls-sys",
|
|
744
|
+
"name": "Current Confirmed Settings",
|
|
745
|
+
"label": "Current settings:",
|
|
746
|
+
"format": "{{msg.payload}}",
|
|
747
|
+
"layout": "row-spread",
|
|
748
|
+
"style": false,
|
|
749
|
+
"order": 3,
|
|
750
|
+
"width": "12",
|
|
751
|
+
"height": "1",
|
|
752
|
+
"className": "",
|
|
753
|
+
"x": 970,
|
|
754
|
+
"y": 580,
|
|
755
|
+
"wires": []
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"id": "widget-status-charging-now",
|
|
759
|
+
"type": "ui-text",
|
|
760
|
+
"z": "tab-octopus-main",
|
|
761
|
+
"group": "ui-group-status-main",
|
|
762
|
+
"name": "Charging Now",
|
|
763
|
+
"label": "Charging now:",
|
|
764
|
+
"format": "{{msg.payload.charging_now ? 'YES' : 'NO'}}",
|
|
765
|
+
"layout": "row-spread",
|
|
766
|
+
"style": false,
|
|
767
|
+
"order": 1,
|
|
768
|
+
"width": "3",
|
|
769
|
+
"height": "1",
|
|
770
|
+
"className": "",
|
|
771
|
+
"x": 970,
|
|
772
|
+
"y": 640,
|
|
773
|
+
"wires": []
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
"id": "widget-status-source",
|
|
777
|
+
"type": "ui-text",
|
|
778
|
+
"z": "tab-octopus-main",
|
|
779
|
+
"group": "ui-group-status-main",
|
|
780
|
+
"name": "Charge Source",
|
|
781
|
+
"label": "Source:",
|
|
782
|
+
"format": "{{msg.payload.next_source || '--'}}",
|
|
783
|
+
"layout": "row-spread",
|
|
784
|
+
"style": false,
|
|
785
|
+
"order": 2,
|
|
786
|
+
"width": "3",
|
|
787
|
+
"height": "1",
|
|
788
|
+
"className": "",
|
|
789
|
+
"x": 970,
|
|
790
|
+
"y": 700,
|
|
791
|
+
"wires": []
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"id": "widget-status-confirmed-limit",
|
|
795
|
+
"type": "ui-text",
|
|
796
|
+
"z": "tab-octopus-main",
|
|
797
|
+
"group": "ui-group-status-main",
|
|
798
|
+
"name": "Confirmed Limit",
|
|
799
|
+
"label": "Confirmed limit:",
|
|
800
|
+
"format": "{{msg.payload.confirmed_limit || '--'}}%",
|
|
801
|
+
"layout": "row-spread",
|
|
802
|
+
"style": false,
|
|
803
|
+
"order": 3,
|
|
804
|
+
"width": "3",
|
|
805
|
+
"height": "1",
|
|
806
|
+
"className": "",
|
|
807
|
+
"x": 970,
|
|
808
|
+
"y": 760,
|
|
809
|
+
"wires": []
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"id": "widget-status-confirmed-time",
|
|
813
|
+
"type": "ui-text",
|
|
814
|
+
"z": "tab-octopus-main",
|
|
815
|
+
"group": "ui-group-status-main",
|
|
816
|
+
"name": "Confirmed Ready Time",
|
|
817
|
+
"label": "Confirmed ready by:",
|
|
818
|
+
"format": "{{msg.payload.confirmed_time || '--'}}",
|
|
819
|
+
"layout": "row-spread",
|
|
820
|
+
"style": false,
|
|
821
|
+
"order": 4,
|
|
822
|
+
"width": "3",
|
|
823
|
+
"height": "1",
|
|
824
|
+
"className": "",
|
|
825
|
+
"x": 970,
|
|
826
|
+
"y": 820,
|
|
827
|
+
"wires": []
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"id": "widget-status-next-start",
|
|
831
|
+
"type": "ui-text",
|
|
832
|
+
"z": "tab-octopus-main",
|
|
833
|
+
"group": "ui-group-status-main",
|
|
834
|
+
"name": "Next Charge Start",
|
|
835
|
+
"label": "Next charge start:",
|
|
836
|
+
"format": "{{msg.payload.next_start_locale || '--'}}",
|
|
837
|
+
"layout": "row-spread",
|
|
838
|
+
"style": false,
|
|
839
|
+
"order": 5,
|
|
840
|
+
"width": "3",
|
|
841
|
+
"height": "1",
|
|
842
|
+
"className": "",
|
|
843
|
+
"x": 970,
|
|
844
|
+
"y": 880,
|
|
845
|
+
"wires": []
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"id": "widget-status-window",
|
|
849
|
+
"type": "ui-text",
|
|
850
|
+
"z": "tab-octopus-main",
|
|
851
|
+
"group": "ui-group-status-main",
|
|
852
|
+
"name": "Charging Window",
|
|
853
|
+
"label": "Window:",
|
|
854
|
+
"format": "{{msg.payload.window_start_locale || '--'}} → {{msg.payload.window_end_locale || '--'}}",
|
|
855
|
+
"layout": "row-spread",
|
|
856
|
+
"style": false,
|
|
857
|
+
"order": 6,
|
|
858
|
+
"width": "6",
|
|
859
|
+
"height": "1",
|
|
860
|
+
"className": "",
|
|
861
|
+
"x": 970,
|
|
862
|
+
"y": 940,
|
|
863
|
+
"wires": []
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"id": "widget-status-slots-template",
|
|
867
|
+
"type": "ui-template",
|
|
868
|
+
"z": "tab-octopus-main",
|
|
869
|
+
"group": "ui-group-status-slots",
|
|
870
|
+
"name": "Charging Slots",
|
|
871
|
+
"order": 1,
|
|
872
|
+
"width": "12",
|
|
873
|
+
"height": "4",
|
|
874
|
+
"className": "",
|
|
875
|
+
"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>",
|
|
876
|
+
"storeOutMessages": true,
|
|
877
|
+
"passthru": true,
|
|
878
|
+
"resendOnRefresh": true,
|
|
879
|
+
"templateScope": "local",
|
|
880
|
+
"eventsFromServer": false,
|
|
881
|
+
"x": 970,
|
|
882
|
+
"y": 1000,
|
|
883
|
+
"wires": [[]]
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
"id": "widget-status-vehicle-template",
|
|
887
|
+
"type": "ui-template",
|
|
888
|
+
"z": "tab-octopus-main",
|
|
889
|
+
"group": "ui-group-status-vehicle",
|
|
890
|
+
"name": "SmartFlex Vehicle",
|
|
891
|
+
"order": 1,
|
|
892
|
+
"width": "6",
|
|
893
|
+
"height": "5",
|
|
894
|
+
"className": "",
|
|
895
|
+
"template": "<template>\n <div style=\"font-size:0.9em;\">\n <div v-if=\"!msg.payload.vehicle_make && !msg.payload.device_state\" style=\"color:#888;\">\n No SmartFlex car or charge point found yet. The node reads it every 30 minutes.\n </div>\n <div v-else>\n <div style=\"font-weight:bold;\">{{ msg.payload.vehicle_make || '--' }} {{ msg.payload.vehicle_model || '' }}</div>\n <div>Battery: {{ msg.payload.vehicle_battery_kwh ?? '--' }} kWh | Charger: {{ msg.payload.charger_power_kw ?? '--' }} kW</div>\n <div>Device state: {{ msg.payload.device_state || '--' }}</div>\n <div>Boost: {{ msg.payload.boosting === true ? 'RUNNING' : (msg.payload.boosting === false ? 'Off' : '--') }}</div>\n <div v-if=\"msg.payload.boost_error\" style=\"color:#c62828;\">Last boost failed: {{ msg.payload.boost_error }}</div>\n <div style=\"margin-top:6px;\">\n Last session: {{ msg.payload.last_session_kwh ?? '--' }} kWh added, final charge {{ msg.payload.last_session_soc_final ?? '--' }}%\n <span v-if=\"msg.payload.last_session_problem\" style=\"color:#c62828;\">(problem reported)</span>\n </div>\n <table v-if=\"(msg.payload.charging_sessions || []).length\" style=\"width:100%; border-collapse:collapse; margin-top:6px;\">\n <thead>\n <tr style=\"background:#1565C0; color:#fff;\">\n <th style=\"padding:4px 8px; text-align:left;\">Start</th>\n <th style=\"padding:4px 8px; text-align:left;\">kWh</th>\n <th style=\"padding:4px 8px; text-align:left;\">Final %</th>\n <th style=\"padding:4px 8px; text-align:left;\">Type</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(s, i) in msg.payload.charging_sessions\" :key=\"i\" :style=\"{ background: i % 2 === 0 ? '#f5f5f5' : '#fff' }\">\n <td style=\"padding:4px 8px;\">{{ s.start ? new Date(s.start).toLocaleString() : '--' }}</td>\n <td style=\"padding:4px 8px;\">{{ s.kwh_added ?? '--' }}</td>\n <td style=\"padding:4px 8px;\">{{ s.soc_final ?? '--' }}</td>\n <td style=\"padding:4px 8px;\">{{ s.type || '--' }}</td>\n </tr>\n </tbody>\n </table>\n <div v-for=\"(a, i) in (msg.payload.device_alerts || [])\" :key=\"'alert-' + i\" style=\"margin-top:4px; color:#E65100;\">\n Alert: {{ a.message }}\n </div>\n <div v-if=\"msg.payload.smartflex_vehicle_error\" style=\"margin-top:4px; color:#c62828;\">\n Error: {{ msg.payload.smartflex_vehicle_error }}\n </div>\n </div>\n </div>\n</template>",
|
|
896
|
+
"storeOutMessages": true,
|
|
897
|
+
"passthru": true,
|
|
898
|
+
"resendOnRefresh": true,
|
|
899
|
+
"templateScope": "local",
|
|
900
|
+
"eventsFromServer": false,
|
|
901
|
+
"x": 970,
|
|
902
|
+
"y": 2260,
|
|
903
|
+
"wires": [[]]
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"id": "widget-tariff-import-gauge",
|
|
907
|
+
"type": "ui-gauge",
|
|
908
|
+
"z": "tab-octopus-main",
|
|
909
|
+
"group": "ui-group-tariff-current",
|
|
910
|
+
"name": "Import Rate Gauge",
|
|
911
|
+
"label": "Import rate (p/kWh)",
|
|
912
|
+
"order": 1,
|
|
913
|
+
"width": "3",
|
|
914
|
+
"height": "3",
|
|
915
|
+
"gtype": "gauge-half",
|
|
916
|
+
"gstyle": "needle",
|
|
917
|
+
"topic": "",
|
|
918
|
+
"topicType": "str",
|
|
919
|
+
"units": "p/kWh",
|
|
920
|
+
"format": "{{value}}",
|
|
921
|
+
"min": "0",
|
|
922
|
+
"max": "50",
|
|
923
|
+
"segments": [
|
|
924
|
+
{"color": "#00897B", "from": "0"},
|
|
925
|
+
{"color": "#FFA726", "from": "15"},
|
|
926
|
+
{"color": "#EF5350", "from": "30"}
|
|
927
|
+
],
|
|
928
|
+
"className": "",
|
|
929
|
+
"x": 970,
|
|
930
|
+
"y": 1060,
|
|
931
|
+
"wires": []
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
"id": "fn-extract-import-rate",
|
|
935
|
+
"type": "function",
|
|
936
|
+
"name": "Extract import rate for gauge",
|
|
937
|
+
"z": "tab-octopus-main",
|
|
938
|
+
"func": "msg.payload = msg.payload.applicable_rates_current_pence || 0;\nreturn msg;",
|
|
939
|
+
"outputs": 1,
|
|
940
|
+
"noerr": 0,
|
|
941
|
+
"initialize": "",
|
|
942
|
+
"finalize": "",
|
|
943
|
+
"libs": [],
|
|
944
|
+
"x": 760,
|
|
945
|
+
"y": 1060,
|
|
946
|
+
"wires": [["widget-tariff-import-gauge"]]
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
"id": "fn-extract-export-rate",
|
|
950
|
+
"type": "function",
|
|
951
|
+
"name": "Extract export rate for gauge",
|
|
952
|
+
"z": "tab-octopus-main",
|
|
953
|
+
"func": "msg.payload = msg.payload.electricity_export_rate_current_pence || 0;\nreturn msg;",
|
|
954
|
+
"outputs": 1,
|
|
955
|
+
"noerr": 0,
|
|
956
|
+
"initialize": "",
|
|
957
|
+
"finalize": "",
|
|
958
|
+
"libs": [],
|
|
959
|
+
"x": 760,
|
|
960
|
+
"y": 1120,
|
|
961
|
+
"wires": [["widget-tariff-export-gauge"]]
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"id": "fn-extract-complexity",
|
|
965
|
+
"type": "function",
|
|
966
|
+
"name": "Extract API complexity percent for gauge",
|
|
967
|
+
"z": "tab-octopus-main",
|
|
968
|
+
"func": "msg.payload = parseFloat(msg.payload.api_complexity_percent) || 0;\nreturn msg;",
|
|
969
|
+
"outputs": 1,
|
|
970
|
+
"noerr": 0,
|
|
971
|
+
"initialize": "",
|
|
972
|
+
"finalize": "",
|
|
973
|
+
"libs": [],
|
|
974
|
+
"x": 760,
|
|
975
|
+
"y": 1180,
|
|
976
|
+
"wires": [["widget-diag-complexity-gauge"]]
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
"id": "fn-extract-mini-kw",
|
|
980
|
+
"type": "function",
|
|
981
|
+
"name": "Extract Home Mini kW for gauge",
|
|
982
|
+
"z": "tab-octopus-main",
|
|
983
|
+
"func": "msg.payload = parseFloat(msg.payload.mini_demand_kw) || 0;\nreturn msg;",
|
|
984
|
+
"outputs": 1,
|
|
985
|
+
"noerr": 0,
|
|
986
|
+
"initialize": "",
|
|
987
|
+
"finalize": "",
|
|
988
|
+
"libs": [],
|
|
989
|
+
"x": 760,
|
|
990
|
+
"y": 1240,
|
|
991
|
+
"wires": [["widget-mini-gauge"]]
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
"id": "widget-tariff-export-gauge",
|
|
995
|
+
"type": "ui-gauge",
|
|
996
|
+
"z": "tab-octopus-main",
|
|
997
|
+
"group": "ui-group-tariff-current",
|
|
998
|
+
"name": "Export Rate Gauge",
|
|
999
|
+
"label": "Export rate (p/kWh)",
|
|
1000
|
+
"order": 2,
|
|
1001
|
+
"width": "3",
|
|
1002
|
+
"height": "3",
|
|
1003
|
+
"gtype": "gauge-half",
|
|
1004
|
+
"gstyle": "needle",
|
|
1005
|
+
"topic": "",
|
|
1006
|
+
"topicType": "str",
|
|
1007
|
+
"units": "p/kWh",
|
|
1008
|
+
"format": "{{value}}",
|
|
1009
|
+
"min": "0",
|
|
1010
|
+
"max": "30",
|
|
1011
|
+
"segments": [
|
|
1012
|
+
{"color": "#EF5350", "from": "0"},
|
|
1013
|
+
{"color": "#FFA726", "from": "10"},
|
|
1014
|
+
{"color": "#00897B", "from": "20"}
|
|
1015
|
+
],
|
|
1016
|
+
"className": "",
|
|
1017
|
+
"x": 970,
|
|
1018
|
+
"y": 1120,
|
|
1019
|
+
"wires": []
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"id": "widget-tariff-stats-table",
|
|
1023
|
+
"type": "ui-template",
|
|
1024
|
+
"z": "tab-octopus-main",
|
|
1025
|
+
"group": "ui-group-tariff-stats",
|
|
1026
|
+
"name": "24h Rate Statistics",
|
|
1027
|
+
"order": 1,
|
|
1028
|
+
"width": "12",
|
|
1029
|
+
"height": "3",
|
|
1030
|
+
"className": "",
|
|
1031
|
+
"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>",
|
|
1032
|
+
"storeOutMessages": true,
|
|
1033
|
+
"passthru": true,
|
|
1034
|
+
"resendOnRefresh": true,
|
|
1035
|
+
"templateScope": "local",
|
|
1036
|
+
"eventsFromServer": false,
|
|
1037
|
+
"x": 970,
|
|
1038
|
+
"y": 1180,
|
|
1039
|
+
"wires": [[]]
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
"id": "widget-tariff-bands-template",
|
|
1043
|
+
"type": "ui-template",
|
|
1044
|
+
"z": "tab-octopus-main",
|
|
1045
|
+
"group": "ui-group-tariff-bands",
|
|
1046
|
+
"name": "Tariff Rate Bands",
|
|
1047
|
+
"order": 1,
|
|
1048
|
+
"width": "12",
|
|
1049
|
+
"height": "3",
|
|
1050
|
+
"className": "",
|
|
1051
|
+
"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>",
|
|
1052
|
+
"storeOutMessages": true,
|
|
1053
|
+
"passthru": true,
|
|
1054
|
+
"resendOnRefresh": true,
|
|
1055
|
+
"templateScope": "local",
|
|
1056
|
+
"eventsFromServer": false,
|
|
1057
|
+
"x": 970,
|
|
1058
|
+
"y": 1240,
|
|
1059
|
+
"wires": [[]]
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"id": "widget-opt-schedule-template",
|
|
1063
|
+
"type": "ui-template",
|
|
1064
|
+
"z": "tab-octopus-main",
|
|
1065
|
+
"group": "ui-group-opt-schedule",
|
|
1066
|
+
"name": "Rate Schedule (applicable_rates)",
|
|
1067
|
+
"order": 1,
|
|
1068
|
+
"width": "12",
|
|
1069
|
+
"height": "6",
|
|
1070
|
+
"className": "",
|
|
1071
|
+
"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>",
|
|
1072
|
+
"storeOutMessages": true,
|
|
1073
|
+
"passthru": true,
|
|
1074
|
+
"resendOnRefresh": true,
|
|
1075
|
+
"templateScope": "local",
|
|
1076
|
+
"eventsFromServer": false,
|
|
1077
|
+
"x": 970,
|
|
1078
|
+
"y": 1300,
|
|
1079
|
+
"wires": [[]]
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
"id": "widget-opt-cheapest-window",
|
|
1083
|
+
"type": "ui-template",
|
|
1084
|
+
"z": "tab-octopus-main",
|
|
1085
|
+
"group": "ui-group-opt-samples",
|
|
1086
|
+
"name": "Cheapest Window Result [SAMPLE]",
|
|
1087
|
+
"order": 1,
|
|
1088
|
+
"width": "6",
|
|
1089
|
+
"height": "3",
|
|
1090
|
+
"className": "",
|
|
1091
|
+
"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>",
|
|
1092
|
+
"storeOutMessages": true,
|
|
1093
|
+
"passthru": true,
|
|
1094
|
+
"resendOnRefresh": true,
|
|
1095
|
+
"templateScope": "local",
|
|
1096
|
+
"eventsFromServer": false,
|
|
1097
|
+
"x": 970,
|
|
1098
|
+
"y": 1360,
|
|
1099
|
+
"wires": [[]]
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"id": "widget-opt-cheapest-now",
|
|
1103
|
+
"type": "ui-template",
|
|
1104
|
+
"z": "tab-octopus-main",
|
|
1105
|
+
"group": "ui-group-opt-samples",
|
|
1106
|
+
"name": "Is Cheapest Now Result [SAMPLE]",
|
|
1107
|
+
"order": 2,
|
|
1108
|
+
"width": "6",
|
|
1109
|
+
"height": "3",
|
|
1110
|
+
"className": "",
|
|
1111
|
+
"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>",
|
|
1112
|
+
"storeOutMessages": true,
|
|
1113
|
+
"passthru": true,
|
|
1114
|
+
"resendOnRefresh": true,
|
|
1115
|
+
"templateScope": "local",
|
|
1116
|
+
"eventsFromServer": false,
|
|
1117
|
+
"x": 970,
|
|
1118
|
+
"y": 1420,
|
|
1119
|
+
"wires": [[]]
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"id": "widget-account-balance",
|
|
1123
|
+
"type": "ui-text",
|
|
1124
|
+
"z": "tab-octopus-main",
|
|
1125
|
+
"group": "ui-group-account-main",
|
|
1126
|
+
"name": "Account Balance",
|
|
1127
|
+
"label": "Account balance:",
|
|
1128
|
+
"format": "£{{msg.payload.account_balance_pounds != null ? msg.payload.account_balance_pounds : '--'}}",
|
|
1129
|
+
"layout": "row-spread",
|
|
1130
|
+
"style": false,
|
|
1131
|
+
"order": 1,
|
|
1132
|
+
"width": "4",
|
|
1133
|
+
"height": "1",
|
|
1134
|
+
"className": "",
|
|
1135
|
+
"x": 970,
|
|
1136
|
+
"y": 1480,
|
|
1137
|
+
"wires": []
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
"id": "widget-account-octoplus",
|
|
1141
|
+
"type": "ui-text",
|
|
1142
|
+
"z": "tab-octopus-main",
|
|
1143
|
+
"group": "ui-group-account-main",
|
|
1144
|
+
"name": "Octoplus Status",
|
|
1145
|
+
"label": "Octoplus:",
|
|
1146
|
+
"format": "{{msg.payload.octoplus_enrolled ? 'Enrolled' : 'Not enrolled'}} | Points: {{msg.payload.octoplus_loyalty_points_user ?? '--'}}",
|
|
1147
|
+
"layout": "row-spread",
|
|
1148
|
+
"style": false,
|
|
1149
|
+
"order": 2,
|
|
1150
|
+
"width": "4",
|
|
1151
|
+
"height": "1",
|
|
1152
|
+
"className": "",
|
|
1153
|
+
"x": 970,
|
|
1154
|
+
"y": 1540,
|
|
1155
|
+
"wires": []
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"id": "widget-account-saving-session",
|
|
1159
|
+
"type": "ui-text",
|
|
1160
|
+
"z": "tab-octopus-main",
|
|
1161
|
+
"group": "ui-group-account-main",
|
|
1162
|
+
"name": "Saving Session",
|
|
1163
|
+
"label": "Saving session:",
|
|
1164
|
+
"format": "{{msg.payload.saving_session_active ? 'ACTIVE' : (msg.payload.saving_session_available ? 'Available' : 'None')}} | Points: {{msg.payload.saving_session_points ?? '--'}}",
|
|
1165
|
+
"layout": "row-spread",
|
|
1166
|
+
"style": false,
|
|
1167
|
+
"order": 3,
|
|
1168
|
+
"width": "4",
|
|
1169
|
+
"height": "1",
|
|
1170
|
+
"className": "",
|
|
1171
|
+
"x": 970,
|
|
1172
|
+
"y": 1600,
|
|
1173
|
+
"wires": []
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"id": "widget-account-free-elec",
|
|
1177
|
+
"type": "ui-text",
|
|
1178
|
+
"z": "tab-octopus-main",
|
|
1179
|
+
"group": "ui-group-account-main",
|
|
1180
|
+
"name": "Free Electricity",
|
|
1181
|
+
"label": "Free electricity:",
|
|
1182
|
+
"format": "{{msg.payload.free_electricity_active ? 'ACTIVE NOW' : (msg.payload.free_electricity_available ? 'Available' : 'None')}}",
|
|
1183
|
+
"layout": "row-spread",
|
|
1184
|
+
"style": false,
|
|
1185
|
+
"order": 4,
|
|
1186
|
+
"width": "4",
|
|
1187
|
+
"height": "1",
|
|
1188
|
+
"className": "",
|
|
1189
|
+
"x": 970,
|
|
1190
|
+
"y": 1660,
|
|
1191
|
+
"wires": []
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
"id": "widget-account-wof",
|
|
1195
|
+
"type": "ui-text",
|
|
1196
|
+
"z": "tab-octopus-main",
|
|
1197
|
+
"group": "ui-group-account-main",
|
|
1198
|
+
"name": "Wheel of Fortune Spins",
|
|
1199
|
+
"label": "WoF spins:",
|
|
1200
|
+
"format": "Electricity: {{msg.payload.wheel_of_fortune_electricity_spins ?? 0}} | Gas: {{msg.payload.wheel_of_fortune_gas_spins ?? 0}}",
|
|
1201
|
+
"layout": "row-spread",
|
|
1202
|
+
"style": false,
|
|
1203
|
+
"order": 5,
|
|
1204
|
+
"width": "4",
|
|
1205
|
+
"height": "1",
|
|
1206
|
+
"className": "",
|
|
1207
|
+
"x": 970,
|
|
1208
|
+
"y": 1720,
|
|
1209
|
+
"wires": []
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
"id": "widget-mini-gauge",
|
|
1213
|
+
"type": "ui-gauge",
|
|
1214
|
+
"z": "tab-octopus-main",
|
|
1215
|
+
"group": "ui-group-account-mini",
|
|
1216
|
+
"name": "Home Mini Demand",
|
|
1217
|
+
"label": "Live demand (kW)",
|
|
1218
|
+
"order": 1,
|
|
1219
|
+
"width": "6",
|
|
1220
|
+
"height": "4",
|
|
1221
|
+
"gtype": "gauge-half",
|
|
1222
|
+
"gstyle": "needle",
|
|
1223
|
+
"topic": "",
|
|
1224
|
+
"topicType": "str",
|
|
1225
|
+
"units": "kW",
|
|
1226
|
+
"format": "{{value}}",
|
|
1227
|
+
"min": "-10",
|
|
1228
|
+
"max": "10",
|
|
1229
|
+
"segments": [
|
|
1230
|
+
{"color": "#00897B", "from": "-10"},
|
|
1231
|
+
{"color": "#FFA726", "from": "3"},
|
|
1232
|
+
{"color": "#EF5350", "from": "7"}
|
|
1233
|
+
],
|
|
1234
|
+
"className": "",
|
|
1235
|
+
"x": 970,
|
|
1236
|
+
"y": 1780,
|
|
1237
|
+
"wires": []
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
"id": "widget-mini-read-at",
|
|
1241
|
+
"type": "ui-text",
|
|
1242
|
+
"z": "tab-octopus-main",
|
|
1243
|
+
"group": "ui-group-account-mini",
|
|
1244
|
+
"name": "Home Mini Read At",
|
|
1245
|
+
"label": "Last read:",
|
|
1246
|
+
"format": "{{msg.payload.mini_read_at ? new Date(msg.payload.mini_read_at).toLocaleTimeString() : '--'}}",
|
|
1247
|
+
"layout": "row-spread",
|
|
1248
|
+
"style": false,
|
|
1249
|
+
"order": 2,
|
|
1250
|
+
"width": "6",
|
|
1251
|
+
"height": "1",
|
|
1252
|
+
"className": "",
|
|
1253
|
+
"x": 970,
|
|
1254
|
+
"y": 1840,
|
|
1255
|
+
"wires": []
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
"id": "widget-diag-api-req",
|
|
1259
|
+
"type": "ui-text",
|
|
1260
|
+
"z": "tab-octopus-main",
|
|
1261
|
+
"group": "ui-group-diag-main",
|
|
1262
|
+
"name": "API Requests per Hour",
|
|
1263
|
+
"label": "API requests/hr:",
|
|
1264
|
+
"format": "{{msg.payload.api_requests_hour ?? '--'}}",
|
|
1265
|
+
"layout": "row-spread",
|
|
1266
|
+
"style": false,
|
|
1267
|
+
"order": 1,
|
|
1268
|
+
"width": "3",
|
|
1269
|
+
"height": "1",
|
|
1270
|
+
"className": "",
|
|
1271
|
+
"x": 970,
|
|
1272
|
+
"y": 1900,
|
|
1273
|
+
"wires": []
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
"id": "widget-diag-complexity-gauge",
|
|
1277
|
+
"type": "ui-gauge",
|
|
1278
|
+
"z": "tab-octopus-main",
|
|
1279
|
+
"group": "ui-group-diag-main",
|
|
1280
|
+
"name": "API Complexity %",
|
|
1281
|
+
"label": "API complexity usage",
|
|
1282
|
+
"order": 2,
|
|
1283
|
+
"width": "3",
|
|
1284
|
+
"height": "3",
|
|
1285
|
+
"gtype": "gauge-half",
|
|
1286
|
+
"gstyle": "needle",
|
|
1287
|
+
"topic": "",
|
|
1288
|
+
"topicType": "str",
|
|
1289
|
+
"units": "%",
|
|
1290
|
+
"format": "{{value}}",
|
|
1291
|
+
"min": "0",
|
|
1292
|
+
"max": "100",
|
|
1293
|
+
"segments": [
|
|
1294
|
+
{"color": "#00897B", "from": "0"},
|
|
1295
|
+
{"color": "#FFA726", "from": "50"},
|
|
1296
|
+
{"color": "#EF5350", "from": "80"}
|
|
1297
|
+
],
|
|
1298
|
+
"className": "",
|
|
1299
|
+
"x": 970,
|
|
1300
|
+
"y": 1960,
|
|
1301
|
+
"wires": []
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
"id": "widget-diag-next-poll",
|
|
1305
|
+
"type": "ui-text",
|
|
1306
|
+
"z": "tab-octopus-main",
|
|
1307
|
+
"group": "ui-group-diag-main",
|
|
1308
|
+
"name": "Next Poll",
|
|
1309
|
+
"label": "Next poll:",
|
|
1310
|
+
"format": "{{msg.payload.next_poll ? new Date(msg.payload.next_poll).toLocaleTimeString() : '--'}}",
|
|
1311
|
+
"layout": "row-spread",
|
|
1312
|
+
"style": false,
|
|
1313
|
+
"order": 3,
|
|
1314
|
+
"width": "3",
|
|
1315
|
+
"height": "1",
|
|
1316
|
+
"className": "",
|
|
1317
|
+
"x": 970,
|
|
1318
|
+
"y": 2020,
|
|
1319
|
+
"wires": []
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
"id": "widget-diag-update",
|
|
1323
|
+
"type": "ui-text",
|
|
1324
|
+
"z": "tab-octopus-main",
|
|
1325
|
+
"group": "ui-group-diag-main",
|
|
1326
|
+
"name": "Version / Update",
|
|
1327
|
+
"label": "Version:",
|
|
1328
|
+
"format": "{{msg.payload.installed_version || '--'}} {{msg.payload.update_available ? '→ ' + msg.payload.latest_version + ' available' : '(up to date)'}}",
|
|
1329
|
+
"layout": "row-spread",
|
|
1330
|
+
"style": false,
|
|
1331
|
+
"order": 4,
|
|
1332
|
+
"width": "6",
|
|
1333
|
+
"height": "1",
|
|
1334
|
+
"className": "",
|
|
1335
|
+
"x": 970,
|
|
1336
|
+
"y": 2080,
|
|
1337
|
+
"wires": []
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
"id": "widget-diag-timezone",
|
|
1341
|
+
"type": "ui-text",
|
|
1342
|
+
"z": "tab-octopus-main",
|
|
1343
|
+
"group": "ui-group-diag-main",
|
|
1344
|
+
"name": "Timezone Applied",
|
|
1345
|
+
"label": "Timezone:",
|
|
1346
|
+
"format": "{{msg.payload.timezone_applied || '--'}} (detected: {{msg.payload.timezone_detected || '--'}})",
|
|
1347
|
+
"layout": "row-spread",
|
|
1348
|
+
"style": false,
|
|
1349
|
+
"order": 5,
|
|
1350
|
+
"width": "6",
|
|
1351
|
+
"height": "1",
|
|
1352
|
+
"className": "",
|
|
1353
|
+
"x": 970,
|
|
1354
|
+
"y": 2140,
|
|
1355
|
+
"wires": []
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
"id": "widget-diag-errors-template",
|
|
1359
|
+
"type": "ui-template",
|
|
1360
|
+
"z": "tab-octopus-main",
|
|
1361
|
+
"group": "ui-group-diag-errors",
|
|
1362
|
+
"name": "Category Error List",
|
|
1363
|
+
"order": 1,
|
|
1364
|
+
"width": "12",
|
|
1365
|
+
"height": "5",
|
|
1366
|
+
"className": "",
|
|
1367
|
+
"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_rates_error', 'electricity_consumption_error',\n 'electricity_export_rate_error', 'applicable_rates_error',\n 'gas_rates_error', 'gas_consumption_error',\n 'account_error', 'octoplus_error', 'saving_sessions_error',\n 'free_electricity_error', 'wheel_of_fortune_error',\n 'home_mini_error', 'completed_dispatches_error', 'flex_planned_dispatches_error',\n 'smartflex_vehicle_error', 'smartflex_inverter_error', 'boost_error', 'update_check_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>",
|
|
1368
|
+
"storeOutMessages": true,
|
|
1369
|
+
"passthru": true,
|
|
1370
|
+
"resendOnRefresh": true,
|
|
1371
|
+
"templateScope": "local",
|
|
1372
|
+
"eventsFromServer": false,
|
|
1373
|
+
"x": 970,
|
|
1374
|
+
"y": 2200,
|
|
1375
|
+
"wires": [[]]
|
|
1376
|
+
}
|
|
1377
|
+
]
|