node-red-contrib-octopus-intelligent 1.3.3 → 1.5.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 +51 -0
- package/examples/ha-dashboard.yaml +159 -46
- package/examples/node-red-dashboard-flow.json +1199 -0
- package/lib/categories/applicable-rates.js +39 -3
- package/lib/categories/electricity.js +15 -2
- package/lib/http-get-json.js +22 -0
- package/lib/payload.js +12 -1
- package/lib/poll-tick.js +44 -0
- package/lib/scheduler.js +17 -3
- package/lib/update-check.js +38 -0
- package/octopus-intelligent.js +348 -379
- package/package.json +1 -1
|
@@ -0,0 +1,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| 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
|
+
"widget-status-charging-now",
|
|
309
|
+
"widget-status-source",
|
|
310
|
+
"widget-status-confirmed-limit",
|
|
311
|
+
"widget-status-confirmed-time",
|
|
312
|
+
"widget-status-next-start",
|
|
313
|
+
"widget-status-window",
|
|
314
|
+
"fn-extract-import-rate",
|
|
315
|
+
"fn-extract-export-rate",
|
|
316
|
+
"widget-tariff-stats-table",
|
|
317
|
+
"widget-tariff-bands-template",
|
|
318
|
+
"widget-opt-schedule-template",
|
|
319
|
+
"widget-status-slots-template",
|
|
320
|
+
"widget-account-balance",
|
|
321
|
+
"widget-account-octoplus",
|
|
322
|
+
"widget-account-saving-session",
|
|
323
|
+
"widget-account-free-elec",
|
|
324
|
+
"widget-account-wof",
|
|
325
|
+
"fn-extract-mini-kw",
|
|
326
|
+
"widget-mini-read-at",
|
|
327
|
+
"widget-diag-api-req",
|
|
328
|
+
"fn-extract-complexity",
|
|
329
|
+
"widget-diag-next-poll",
|
|
330
|
+
"widget-diag-update",
|
|
331
|
+
"widget-diag-timezone",
|
|
332
|
+
"widget-diag-errors-template"
|
|
333
|
+
]
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"id": "fn-controls-status",
|
|
338
|
+
"type": "function",
|
|
339
|
+
"name": "Extract current confirmed settings for Controls page",
|
|
340
|
+
"z": "tab-octopus-main",
|
|
341
|
+
"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;",
|
|
342
|
+
"outputs": 1,
|
|
343
|
+
"noerr": 0,
|
|
344
|
+
"initialize": "",
|
|
345
|
+
"finalize": "",
|
|
346
|
+
"libs": [],
|
|
347
|
+
"x": 760,
|
|
348
|
+
"y": 60,
|
|
349
|
+
"wires": [["widget-controls-status"]]
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"id": "fn-find-cheapest-window",
|
|
353
|
+
"type": "function",
|
|
354
|
+
"name": "find-cheapest-window [SAMPLE — edit freely]",
|
|
355
|
+
"z": "tab-octopus-main",
|
|
356
|
+
"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;",
|
|
357
|
+
"outputs": 1,
|
|
358
|
+
"noerr": 0,
|
|
359
|
+
"initialize": "",
|
|
360
|
+
"finalize": "",
|
|
361
|
+
"libs": [],
|
|
362
|
+
"x": 470,
|
|
363
|
+
"y": 160,
|
|
364
|
+
"wires": [["widget-opt-cheapest-window"]]
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"id": "fn-is-cheapest-now",
|
|
368
|
+
"type": "function",
|
|
369
|
+
"name": "is-cheapest-now [SAMPLE — edit freely]",
|
|
370
|
+
"z": "tab-octopus-main",
|
|
371
|
+
"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;",
|
|
372
|
+
"outputs": 1,
|
|
373
|
+
"noerr": 0,
|
|
374
|
+
"initialize": "",
|
|
375
|
+
"finalize": "",
|
|
376
|
+
"libs": [],
|
|
377
|
+
"x": 470,
|
|
378
|
+
"y": 220,
|
|
379
|
+
"wires": [["widget-opt-cheapest-now"]]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"id": "fn-apply-limit",
|
|
383
|
+
"type": "function",
|
|
384
|
+
"name": "Wrap limit as set_limit command",
|
|
385
|
+
"z": "tab-octopus-main",
|
|
386
|
+
"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 < 50 || val > 100) {\n node.warn('Invalid limit value: ' + msg.payload);\n return null;\n}\nmsg.payload = { set_limit: val };\nreturn msg;",
|
|
387
|
+
"outputs": 1,
|
|
388
|
+
"noerr": 0,
|
|
389
|
+
"initialize": "",
|
|
390
|
+
"finalize": "",
|
|
391
|
+
"libs": [],
|
|
392
|
+
"x": 760,
|
|
393
|
+
"y": 280,
|
|
394
|
+
"wires": [["node-octopus-main"]]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"id": "fn-apply-time",
|
|
398
|
+
"type": "function",
|
|
399
|
+
"name": "Wrap time as set_time command",
|
|
400
|
+
"z": "tab-octopus-main",
|
|
401
|
+
"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;",
|
|
402
|
+
"outputs": 1,
|
|
403
|
+
"noerr": 0,
|
|
404
|
+
"initialize": "",
|
|
405
|
+
"finalize": "",
|
|
406
|
+
"libs": [],
|
|
407
|
+
"x": 760,
|
|
408
|
+
"y": 340,
|
|
409
|
+
"wires": [["node-octopus-main"]]
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"id": "fn-apply-smart",
|
|
413
|
+
"type": "function",
|
|
414
|
+
"name": "Wrap smart charging toggle as set_smart_charging command",
|
|
415
|
+
"z": "tab-octopus-main",
|
|
416
|
+
"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;",
|
|
417
|
+
"outputs": 1,
|
|
418
|
+
"noerr": 0,
|
|
419
|
+
"initialize": "",
|
|
420
|
+
"finalize": "",
|
|
421
|
+
"libs": [],
|
|
422
|
+
"x": 760,
|
|
423
|
+
"y": 400,
|
|
424
|
+
"wires": [["node-octopus-main"]]
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"id": "fn-apply-timezone",
|
|
428
|
+
"type": "function",
|
|
429
|
+
"name": "Wrap timezone as set_timezone command",
|
|
430
|
+
"z": "tab-octopus-main",
|
|
431
|
+
"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;",
|
|
432
|
+
"outputs": 1,
|
|
433
|
+
"noerr": 0,
|
|
434
|
+
"initialize": "",
|
|
435
|
+
"finalize": "",
|
|
436
|
+
"libs": [],
|
|
437
|
+
"x": 760,
|
|
438
|
+
"y": 460,
|
|
439
|
+
"wires": [["node-octopus-main"]]
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"id": "inject-refresh",
|
|
443
|
+
"type": "inject",
|
|
444
|
+
"name": "Refresh (inject trigger)",
|
|
445
|
+
"z": "tab-octopus-main",
|
|
446
|
+
"props": [{"p": "payload"}],
|
|
447
|
+
"repeat": "",
|
|
448
|
+
"crontab": "",
|
|
449
|
+
"once": false,
|
|
450
|
+
"topic": "",
|
|
451
|
+
"payload": "{\"refresh\":true}",
|
|
452
|
+
"payloadType": "json",
|
|
453
|
+
"x": 200,
|
|
454
|
+
"y": 520,
|
|
455
|
+
"wires": [["node-octopus-main"]]
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"id": "widget-controls-limit",
|
|
459
|
+
"type": "ui-number-input",
|
|
460
|
+
"z": "tab-octopus-main",
|
|
461
|
+
"group": "ui-group-controls-ev",
|
|
462
|
+
"name": "Target Charge Limit",
|
|
463
|
+
"label": "Target limit (%)",
|
|
464
|
+
"tooltip": "Set the target charge limit (50–100, step 5). Click Apply after adjusting.",
|
|
465
|
+
"order": 1,
|
|
466
|
+
"width": "6",
|
|
467
|
+
"height": "1",
|
|
468
|
+
"topic": "set_limit",
|
|
469
|
+
"topicType": "str",
|
|
470
|
+
"min": "50",
|
|
471
|
+
"max": "100",
|
|
472
|
+
"step": "5",
|
|
473
|
+
"wrap": false,
|
|
474
|
+
"className": "",
|
|
475
|
+
"x": 970,
|
|
476
|
+
"y": 280,
|
|
477
|
+
"wires": [["fn-apply-limit"]]
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"id": "widget-controls-ready-time",
|
|
481
|
+
"type": "ui-dropdown",
|
|
482
|
+
"z": "tab-octopus-main",
|
|
483
|
+
"group": "ui-group-controls-ev",
|
|
484
|
+
"name": "Ready By Time",
|
|
485
|
+
"label": "Ready by",
|
|
486
|
+
"tooltip": "Time the car should be fully charged by. Click Apply after selecting.",
|
|
487
|
+
"order": 2,
|
|
488
|
+
"width": "6",
|
|
489
|
+
"height": "1",
|
|
490
|
+
"topic": "set_time",
|
|
491
|
+
"topicType": "str",
|
|
492
|
+
"options": [
|
|
493
|
+
{"label": "04:00", "value": "04:00"},
|
|
494
|
+
{"label": "04:30", "value": "04:30"},
|
|
495
|
+
{"label": "05:00", "value": "05:00"},
|
|
496
|
+
{"label": "05:30", "value": "05:30"},
|
|
497
|
+
{"label": "06:00", "value": "06:00"},
|
|
498
|
+
{"label": "06:30", "value": "06:30"},
|
|
499
|
+
{"label": "07:00", "value": "07:00"},
|
|
500
|
+
{"label": "07:30", "value": "07:30"},
|
|
501
|
+
{"label": "08:00", "value": "08:00"},
|
|
502
|
+
{"label": "08:30", "value": "08:30"},
|
|
503
|
+
{"label": "09:00", "value": "09:00"},
|
|
504
|
+
{"label": "09:30", "value": "09:30"},
|
|
505
|
+
{"label": "10:00", "value": "10:00"},
|
|
506
|
+
{"label": "10:30", "value": "10:30"},
|
|
507
|
+
{"label": "11:00", "value": "11:00"},
|
|
508
|
+
{"label": "11:30", "value": "11:30"}
|
|
509
|
+
],
|
|
510
|
+
"allowInput": false,
|
|
511
|
+
"className": "",
|
|
512
|
+
"x": 970,
|
|
513
|
+
"y": 340,
|
|
514
|
+
"wires": [["fn-apply-time"]]
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"id": "widget-controls-smart",
|
|
518
|
+
"type": "ui-switch",
|
|
519
|
+
"z": "tab-octopus-main",
|
|
520
|
+
"group": "ui-group-controls-ev",
|
|
521
|
+
"name": "Smart Charging",
|
|
522
|
+
"label": "Smart Charging",
|
|
523
|
+
"tooltip": "Enable or disable Octopus Intelligent smart charging.",
|
|
524
|
+
"order": 3,
|
|
525
|
+
"width": "6",
|
|
526
|
+
"height": "1",
|
|
527
|
+
"topic": "set_smart_charging",
|
|
528
|
+
"topicType": "str",
|
|
529
|
+
"stateOn": true,
|
|
530
|
+
"stateOff": false,
|
|
531
|
+
"stateOnLabel": "Enabled",
|
|
532
|
+
"stateOffLabel": "Disabled",
|
|
533
|
+
"colorOn": "#00897B",
|
|
534
|
+
"colorOff": "#ccc",
|
|
535
|
+
"className": "",
|
|
536
|
+
"x": 970,
|
|
537
|
+
"y": 400,
|
|
538
|
+
"wires": [["fn-apply-smart"]]
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"id": "widget-controls-refresh",
|
|
542
|
+
"type": "ui-button",
|
|
543
|
+
"z": "tab-octopus-main",
|
|
544
|
+
"group": "ui-group-controls-sys",
|
|
545
|
+
"name": "Refresh Now",
|
|
546
|
+
"label": "Refresh",
|
|
547
|
+
"tooltip": "Trigger an immediate API poll. Note: the node has no rate limit on Node-RED input messages.",
|
|
548
|
+
"order": 1,
|
|
549
|
+
"width": "3",
|
|
550
|
+
"height": "1",
|
|
551
|
+
"topic": "refresh",
|
|
552
|
+
"topicType": "str",
|
|
553
|
+
"payload": "{\"refresh\":true}",
|
|
554
|
+
"payloadType": "json",
|
|
555
|
+
"className": "",
|
|
556
|
+
"x": 970,
|
|
557
|
+
"y": 460,
|
|
558
|
+
"wires": [["node-octopus-main"]]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"id": "widget-controls-timezone",
|
|
562
|
+
"type": "ui-text-input",
|
|
563
|
+
"z": "tab-octopus-main",
|
|
564
|
+
"group": "ui-group-controls-sys",
|
|
565
|
+
"name": "Timezone Override",
|
|
566
|
+
"label": "Timezone (e.g. Europe/London)",
|
|
567
|
+
"tooltip": "Override the detected timezone. Leave blank to use auto-detected. Press Enter to apply.",
|
|
568
|
+
"order": 2,
|
|
569
|
+
"width": "6",
|
|
570
|
+
"height": "1",
|
|
571
|
+
"topic": "set_timezone",
|
|
572
|
+
"topicType": "str",
|
|
573
|
+
"mode": "text",
|
|
574
|
+
"sendOnBlur": true,
|
|
575
|
+
"clearable": true,
|
|
576
|
+
"className": "",
|
|
577
|
+
"x": 970,
|
|
578
|
+
"y": 520,
|
|
579
|
+
"wires": [["fn-apply-timezone"]]
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"id": "widget-controls-status",
|
|
583
|
+
"type": "ui-text",
|
|
584
|
+
"z": "tab-octopus-main",
|
|
585
|
+
"group": "ui-group-controls-sys",
|
|
586
|
+
"name": "Current Confirmed Settings",
|
|
587
|
+
"label": "Current settings:",
|
|
588
|
+
"format": "{{msg.payload}}",
|
|
589
|
+
"layout": "row-spread",
|
|
590
|
+
"style": false,
|
|
591
|
+
"order": 3,
|
|
592
|
+
"width": "12",
|
|
593
|
+
"height": "1",
|
|
594
|
+
"className": "",
|
|
595
|
+
"x": 970,
|
|
596
|
+
"y": 580,
|
|
597
|
+
"wires": []
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"id": "widget-status-charging-now",
|
|
601
|
+
"type": "ui-text",
|
|
602
|
+
"z": "tab-octopus-main",
|
|
603
|
+
"group": "ui-group-status-main",
|
|
604
|
+
"name": "Charging Now",
|
|
605
|
+
"label": "Charging now:",
|
|
606
|
+
"format": "{{msg.payload.charging_now ? 'YES' : 'NO'}}",
|
|
607
|
+
"layout": "row-spread",
|
|
608
|
+
"style": false,
|
|
609
|
+
"order": 1,
|
|
610
|
+
"width": "3",
|
|
611
|
+
"height": "1",
|
|
612
|
+
"className": "",
|
|
613
|
+
"x": 970,
|
|
614
|
+
"y": 640,
|
|
615
|
+
"wires": []
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"id": "widget-status-source",
|
|
619
|
+
"type": "ui-text",
|
|
620
|
+
"z": "tab-octopus-main",
|
|
621
|
+
"group": "ui-group-status-main",
|
|
622
|
+
"name": "Charge Source",
|
|
623
|
+
"label": "Source:",
|
|
624
|
+
"format": "{{msg.payload.next_source || '--'}}",
|
|
625
|
+
"layout": "row-spread",
|
|
626
|
+
"style": false,
|
|
627
|
+
"order": 2,
|
|
628
|
+
"width": "3",
|
|
629
|
+
"height": "1",
|
|
630
|
+
"className": "",
|
|
631
|
+
"x": 970,
|
|
632
|
+
"y": 700,
|
|
633
|
+
"wires": []
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"id": "widget-status-confirmed-limit",
|
|
637
|
+
"type": "ui-text",
|
|
638
|
+
"z": "tab-octopus-main",
|
|
639
|
+
"group": "ui-group-status-main",
|
|
640
|
+
"name": "Confirmed Limit",
|
|
641
|
+
"label": "Confirmed limit:",
|
|
642
|
+
"format": "{{msg.payload.confirmed_limit || '--'}}%",
|
|
643
|
+
"layout": "row-spread",
|
|
644
|
+
"style": false,
|
|
645
|
+
"order": 3,
|
|
646
|
+
"width": "3",
|
|
647
|
+
"height": "1",
|
|
648
|
+
"className": "",
|
|
649
|
+
"x": 970,
|
|
650
|
+
"y": 760,
|
|
651
|
+
"wires": []
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"id": "widget-status-confirmed-time",
|
|
655
|
+
"type": "ui-text",
|
|
656
|
+
"z": "tab-octopus-main",
|
|
657
|
+
"group": "ui-group-status-main",
|
|
658
|
+
"name": "Confirmed Ready Time",
|
|
659
|
+
"label": "Confirmed ready by:",
|
|
660
|
+
"format": "{{msg.payload.confirmed_time || '--'}}",
|
|
661
|
+
"layout": "row-spread",
|
|
662
|
+
"style": false,
|
|
663
|
+
"order": 4,
|
|
664
|
+
"width": "3",
|
|
665
|
+
"height": "1",
|
|
666
|
+
"className": "",
|
|
667
|
+
"x": 970,
|
|
668
|
+
"y": 820,
|
|
669
|
+
"wires": []
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"id": "widget-status-next-start",
|
|
673
|
+
"type": "ui-text",
|
|
674
|
+
"z": "tab-octopus-main",
|
|
675
|
+
"group": "ui-group-status-main",
|
|
676
|
+
"name": "Next Charge Start",
|
|
677
|
+
"label": "Next charge start:",
|
|
678
|
+
"format": "{{msg.payload.next_start_locale || '--'}}",
|
|
679
|
+
"layout": "row-spread",
|
|
680
|
+
"style": false,
|
|
681
|
+
"order": 5,
|
|
682
|
+
"width": "3",
|
|
683
|
+
"height": "1",
|
|
684
|
+
"className": "",
|
|
685
|
+
"x": 970,
|
|
686
|
+
"y": 880,
|
|
687
|
+
"wires": []
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"id": "widget-status-window",
|
|
691
|
+
"type": "ui-text",
|
|
692
|
+
"z": "tab-octopus-main",
|
|
693
|
+
"group": "ui-group-status-main",
|
|
694
|
+
"name": "Charging Window",
|
|
695
|
+
"label": "Window:",
|
|
696
|
+
"format": "{{msg.payload.window_start_locale || '--'}} → {{msg.payload.window_end_locale || '--'}}",
|
|
697
|
+
"layout": "row-spread",
|
|
698
|
+
"style": false,
|
|
699
|
+
"order": 6,
|
|
700
|
+
"width": "6",
|
|
701
|
+
"height": "1",
|
|
702
|
+
"className": "",
|
|
703
|
+
"x": 970,
|
|
704
|
+
"y": 940,
|
|
705
|
+
"wires": []
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"id": "widget-status-slots-template",
|
|
709
|
+
"type": "ui-template",
|
|
710
|
+
"z": "tab-octopus-main",
|
|
711
|
+
"group": "ui-group-status-slots",
|
|
712
|
+
"name": "Charging Slots",
|
|
713
|
+
"order": 1,
|
|
714
|
+
"width": "12",
|
|
715
|
+
"height": "4",
|
|
716
|
+
"className": "",
|
|
717
|
+
"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>",
|
|
718
|
+
"storeOutMessages": true,
|
|
719
|
+
"passthru": true,
|
|
720
|
+
"resendOnRefresh": true,
|
|
721
|
+
"templateScope": "local",
|
|
722
|
+
"eventsFromServer": false,
|
|
723
|
+
"x": 970,
|
|
724
|
+
"y": 1000,
|
|
725
|
+
"wires": [[]]
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
"id": "widget-tariff-import-gauge",
|
|
729
|
+
"type": "ui-gauge",
|
|
730
|
+
"z": "tab-octopus-main",
|
|
731
|
+
"group": "ui-group-tariff-current",
|
|
732
|
+
"name": "Import Rate Gauge",
|
|
733
|
+
"label": "Import rate (p/kWh)",
|
|
734
|
+
"order": 1,
|
|
735
|
+
"width": "3",
|
|
736
|
+
"height": "3",
|
|
737
|
+
"gtype": "gauge-half",
|
|
738
|
+
"gstyle": "needle",
|
|
739
|
+
"topic": "",
|
|
740
|
+
"topicType": "str",
|
|
741
|
+
"units": "p/kWh",
|
|
742
|
+
"format": "{{value}}",
|
|
743
|
+
"min": "0",
|
|
744
|
+
"max": "50",
|
|
745
|
+
"segments": [
|
|
746
|
+
{"color": "#00897B", "from": "0"},
|
|
747
|
+
{"color": "#FFA726", "from": "15"},
|
|
748
|
+
{"color": "#EF5350", "from": "30"}
|
|
749
|
+
],
|
|
750
|
+
"className": "",
|
|
751
|
+
"x": 970,
|
|
752
|
+
"y": 1060,
|
|
753
|
+
"wires": []
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"id": "fn-extract-import-rate",
|
|
757
|
+
"type": "function",
|
|
758
|
+
"name": "Extract import rate for gauge",
|
|
759
|
+
"z": "tab-octopus-main",
|
|
760
|
+
"func": "msg.payload = msg.payload.applicable_rates_current_pence || 0;\nreturn msg;",
|
|
761
|
+
"outputs": 1,
|
|
762
|
+
"noerr": 0,
|
|
763
|
+
"initialize": "",
|
|
764
|
+
"finalize": "",
|
|
765
|
+
"libs": [],
|
|
766
|
+
"x": 760,
|
|
767
|
+
"y": 1060,
|
|
768
|
+
"wires": [["widget-tariff-import-gauge"]]
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"id": "fn-extract-export-rate",
|
|
772
|
+
"type": "function",
|
|
773
|
+
"name": "Extract export rate for gauge",
|
|
774
|
+
"z": "tab-octopus-main",
|
|
775
|
+
"func": "msg.payload = msg.payload.electricity_export_rate_current_pence || 0;\nreturn msg;",
|
|
776
|
+
"outputs": 1,
|
|
777
|
+
"noerr": 0,
|
|
778
|
+
"initialize": "",
|
|
779
|
+
"finalize": "",
|
|
780
|
+
"libs": [],
|
|
781
|
+
"x": 760,
|
|
782
|
+
"y": 1120,
|
|
783
|
+
"wires": [["widget-tariff-export-gauge"]]
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"id": "fn-extract-complexity",
|
|
787
|
+
"type": "function",
|
|
788
|
+
"name": "Extract API complexity percent for gauge",
|
|
789
|
+
"z": "tab-octopus-main",
|
|
790
|
+
"func": "msg.payload = parseFloat(msg.payload.api_complexity_percent) || 0;\nreturn msg;",
|
|
791
|
+
"outputs": 1,
|
|
792
|
+
"noerr": 0,
|
|
793
|
+
"initialize": "",
|
|
794
|
+
"finalize": "",
|
|
795
|
+
"libs": [],
|
|
796
|
+
"x": 760,
|
|
797
|
+
"y": 1180,
|
|
798
|
+
"wires": [["widget-diag-complexity-gauge"]]
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"id": "fn-extract-mini-kw",
|
|
802
|
+
"type": "function",
|
|
803
|
+
"name": "Extract Home Mini kW for gauge",
|
|
804
|
+
"z": "tab-octopus-main",
|
|
805
|
+
"func": "msg.payload = parseFloat(msg.payload.mini_demand_kw) || 0;\nreturn msg;",
|
|
806
|
+
"outputs": 1,
|
|
807
|
+
"noerr": 0,
|
|
808
|
+
"initialize": "",
|
|
809
|
+
"finalize": "",
|
|
810
|
+
"libs": [],
|
|
811
|
+
"x": 760,
|
|
812
|
+
"y": 1240,
|
|
813
|
+
"wires": [["widget-mini-gauge"]]
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"id": "widget-tariff-export-gauge",
|
|
817
|
+
"type": "ui-gauge",
|
|
818
|
+
"z": "tab-octopus-main",
|
|
819
|
+
"group": "ui-group-tariff-current",
|
|
820
|
+
"name": "Export Rate Gauge",
|
|
821
|
+
"label": "Export rate (p/kWh)",
|
|
822
|
+
"order": 2,
|
|
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": "30",
|
|
833
|
+
"segments": [
|
|
834
|
+
{"color": "#EF5350", "from": "0"},
|
|
835
|
+
{"color": "#FFA726", "from": "10"},
|
|
836
|
+
{"color": "#00897B", "from": "20"}
|
|
837
|
+
],
|
|
838
|
+
"className": "",
|
|
839
|
+
"x": 970,
|
|
840
|
+
"y": 1120,
|
|
841
|
+
"wires": []
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"id": "widget-tariff-stats-table",
|
|
845
|
+
"type": "ui-template",
|
|
846
|
+
"z": "tab-octopus-main",
|
|
847
|
+
"group": "ui-group-tariff-stats",
|
|
848
|
+
"name": "24h Rate Statistics",
|
|
849
|
+
"order": 1,
|
|
850
|
+
"width": "12",
|
|
851
|
+
"height": "3",
|
|
852
|
+
"className": "",
|
|
853
|
+
"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>",
|
|
854
|
+
"storeOutMessages": true,
|
|
855
|
+
"passthru": true,
|
|
856
|
+
"resendOnRefresh": true,
|
|
857
|
+
"templateScope": "local",
|
|
858
|
+
"eventsFromServer": false,
|
|
859
|
+
"x": 970,
|
|
860
|
+
"y": 1180,
|
|
861
|
+
"wires": [[]]
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"id": "widget-tariff-bands-template",
|
|
865
|
+
"type": "ui-template",
|
|
866
|
+
"z": "tab-octopus-main",
|
|
867
|
+
"group": "ui-group-tariff-bands",
|
|
868
|
+
"name": "Tariff Rate Bands",
|
|
869
|
+
"order": 1,
|
|
870
|
+
"width": "12",
|
|
871
|
+
"height": "3",
|
|
872
|
+
"className": "",
|
|
873
|
+
"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>",
|
|
874
|
+
"storeOutMessages": true,
|
|
875
|
+
"passthru": true,
|
|
876
|
+
"resendOnRefresh": true,
|
|
877
|
+
"templateScope": "local",
|
|
878
|
+
"eventsFromServer": false,
|
|
879
|
+
"x": 970,
|
|
880
|
+
"y": 1240,
|
|
881
|
+
"wires": [[]]
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"id": "widget-opt-schedule-template",
|
|
885
|
+
"type": "ui-template",
|
|
886
|
+
"z": "tab-octopus-main",
|
|
887
|
+
"group": "ui-group-opt-schedule",
|
|
888
|
+
"name": "Rate Schedule (applicable_rates)",
|
|
889
|
+
"order": 1,
|
|
890
|
+
"width": "12",
|
|
891
|
+
"height": "6",
|
|
892
|
+
"className": "",
|
|
893
|
+
"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>",
|
|
894
|
+
"storeOutMessages": true,
|
|
895
|
+
"passthru": true,
|
|
896
|
+
"resendOnRefresh": true,
|
|
897
|
+
"templateScope": "local",
|
|
898
|
+
"eventsFromServer": false,
|
|
899
|
+
"x": 970,
|
|
900
|
+
"y": 1300,
|
|
901
|
+
"wires": [[]]
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"id": "widget-opt-cheapest-window",
|
|
905
|
+
"type": "ui-template",
|
|
906
|
+
"z": "tab-octopus-main",
|
|
907
|
+
"group": "ui-group-opt-samples",
|
|
908
|
+
"name": "Cheapest Window Result [SAMPLE]",
|
|
909
|
+
"order": 1,
|
|
910
|
+
"width": "6",
|
|
911
|
+
"height": "3",
|
|
912
|
+
"className": "",
|
|
913
|
+
"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>",
|
|
914
|
+
"storeOutMessages": true,
|
|
915
|
+
"passthru": true,
|
|
916
|
+
"resendOnRefresh": true,
|
|
917
|
+
"templateScope": "local",
|
|
918
|
+
"eventsFromServer": false,
|
|
919
|
+
"x": 970,
|
|
920
|
+
"y": 1360,
|
|
921
|
+
"wires": [[]]
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
"id": "widget-opt-cheapest-now",
|
|
925
|
+
"type": "ui-template",
|
|
926
|
+
"z": "tab-octopus-main",
|
|
927
|
+
"group": "ui-group-opt-samples",
|
|
928
|
+
"name": "Is Cheapest Now Result [SAMPLE]",
|
|
929
|
+
"order": 2,
|
|
930
|
+
"width": "6",
|
|
931
|
+
"height": "3",
|
|
932
|
+
"className": "",
|
|
933
|
+
"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>",
|
|
934
|
+
"storeOutMessages": true,
|
|
935
|
+
"passthru": true,
|
|
936
|
+
"resendOnRefresh": true,
|
|
937
|
+
"templateScope": "local",
|
|
938
|
+
"eventsFromServer": false,
|
|
939
|
+
"x": 970,
|
|
940
|
+
"y": 1420,
|
|
941
|
+
"wires": [[]]
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"id": "widget-account-balance",
|
|
945
|
+
"type": "ui-text",
|
|
946
|
+
"z": "tab-octopus-main",
|
|
947
|
+
"group": "ui-group-account-main",
|
|
948
|
+
"name": "Account Balance",
|
|
949
|
+
"label": "Account balance:",
|
|
950
|
+
"format": "£{{msg.payload.account_balance_pounds != null ? msg.payload.account_balance_pounds : '--'}}",
|
|
951
|
+
"layout": "row-spread",
|
|
952
|
+
"style": false,
|
|
953
|
+
"order": 1,
|
|
954
|
+
"width": "4",
|
|
955
|
+
"height": "1",
|
|
956
|
+
"className": "",
|
|
957
|
+
"x": 970,
|
|
958
|
+
"y": 1480,
|
|
959
|
+
"wires": []
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
"id": "widget-account-octoplus",
|
|
963
|
+
"type": "ui-text",
|
|
964
|
+
"z": "tab-octopus-main",
|
|
965
|
+
"group": "ui-group-account-main",
|
|
966
|
+
"name": "Octoplus Status",
|
|
967
|
+
"label": "Octoplus:",
|
|
968
|
+
"format": "{{msg.payload.octoplus_enrolled ? 'Enrolled' : 'Not enrolled'}} | Points: {{msg.payload.octoplus_loyalty_points_user ?? '--'}}",
|
|
969
|
+
"layout": "row-spread",
|
|
970
|
+
"style": false,
|
|
971
|
+
"order": 2,
|
|
972
|
+
"width": "4",
|
|
973
|
+
"height": "1",
|
|
974
|
+
"className": "",
|
|
975
|
+
"x": 970,
|
|
976
|
+
"y": 1540,
|
|
977
|
+
"wires": []
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"id": "widget-account-saving-session",
|
|
981
|
+
"type": "ui-text",
|
|
982
|
+
"z": "tab-octopus-main",
|
|
983
|
+
"group": "ui-group-account-main",
|
|
984
|
+
"name": "Saving Session",
|
|
985
|
+
"label": "Saving session:",
|
|
986
|
+
"format": "{{msg.payload.saving_session_active ? 'ACTIVE' : (msg.payload.saving_session_available ? 'Available' : 'None')}} | Points: {{msg.payload.saving_session_points ?? '--'}}",
|
|
987
|
+
"layout": "row-spread",
|
|
988
|
+
"style": false,
|
|
989
|
+
"order": 3,
|
|
990
|
+
"width": "4",
|
|
991
|
+
"height": "1",
|
|
992
|
+
"className": "",
|
|
993
|
+
"x": 970,
|
|
994
|
+
"y": 1600,
|
|
995
|
+
"wires": []
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"id": "widget-account-free-elec",
|
|
999
|
+
"type": "ui-text",
|
|
1000
|
+
"z": "tab-octopus-main",
|
|
1001
|
+
"group": "ui-group-account-main",
|
|
1002
|
+
"name": "Free Electricity",
|
|
1003
|
+
"label": "Free electricity:",
|
|
1004
|
+
"format": "{{msg.payload.free_electricity_active ? 'ACTIVE NOW' : (msg.payload.free_electricity_available ? 'Available' : 'None')}}",
|
|
1005
|
+
"layout": "row-spread",
|
|
1006
|
+
"style": false,
|
|
1007
|
+
"order": 4,
|
|
1008
|
+
"width": "4",
|
|
1009
|
+
"height": "1",
|
|
1010
|
+
"className": "",
|
|
1011
|
+
"x": 970,
|
|
1012
|
+
"y": 1660,
|
|
1013
|
+
"wires": []
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
"id": "widget-account-wof",
|
|
1017
|
+
"type": "ui-text",
|
|
1018
|
+
"z": "tab-octopus-main",
|
|
1019
|
+
"group": "ui-group-account-main",
|
|
1020
|
+
"name": "Wheel of Fortune Spins",
|
|
1021
|
+
"label": "WoF spins:",
|
|
1022
|
+
"format": "Electricity: {{msg.payload.wheel_of_fortune_electricity_spins ?? 0}} | Gas: {{msg.payload.wheel_of_fortune_gas_spins ?? 0}}",
|
|
1023
|
+
"layout": "row-spread",
|
|
1024
|
+
"style": false,
|
|
1025
|
+
"order": 5,
|
|
1026
|
+
"width": "4",
|
|
1027
|
+
"height": "1",
|
|
1028
|
+
"className": "",
|
|
1029
|
+
"x": 970,
|
|
1030
|
+
"y": 1720,
|
|
1031
|
+
"wires": []
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
"id": "widget-mini-gauge",
|
|
1035
|
+
"type": "ui-gauge",
|
|
1036
|
+
"z": "tab-octopus-main",
|
|
1037
|
+
"group": "ui-group-account-mini",
|
|
1038
|
+
"name": "Home Mini Demand",
|
|
1039
|
+
"label": "Live demand (kW)",
|
|
1040
|
+
"order": 1,
|
|
1041
|
+
"width": "6",
|
|
1042
|
+
"height": "4",
|
|
1043
|
+
"gtype": "gauge-half",
|
|
1044
|
+
"gstyle": "needle",
|
|
1045
|
+
"topic": "",
|
|
1046
|
+
"topicType": "str",
|
|
1047
|
+
"units": "kW",
|
|
1048
|
+
"format": "{{value}}",
|
|
1049
|
+
"min": "-10",
|
|
1050
|
+
"max": "10",
|
|
1051
|
+
"segments": [
|
|
1052
|
+
{"color": "#00897B", "from": "-10"},
|
|
1053
|
+
{"color": "#FFA726", "from": "3"},
|
|
1054
|
+
{"color": "#EF5350", "from": "7"}
|
|
1055
|
+
],
|
|
1056
|
+
"className": "",
|
|
1057
|
+
"x": 970,
|
|
1058
|
+
"y": 1780,
|
|
1059
|
+
"wires": []
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"id": "widget-mini-read-at",
|
|
1063
|
+
"type": "ui-text",
|
|
1064
|
+
"z": "tab-octopus-main",
|
|
1065
|
+
"group": "ui-group-account-mini",
|
|
1066
|
+
"name": "Home Mini Read At",
|
|
1067
|
+
"label": "Last read:",
|
|
1068
|
+
"format": "{{msg.payload.mini_read_at ? new Date(msg.payload.mini_read_at).toLocaleTimeString() : '--'}}",
|
|
1069
|
+
"layout": "row-spread",
|
|
1070
|
+
"style": false,
|
|
1071
|
+
"order": 2,
|
|
1072
|
+
"width": "6",
|
|
1073
|
+
"height": "1",
|
|
1074
|
+
"className": "",
|
|
1075
|
+
"x": 970,
|
|
1076
|
+
"y": 1840,
|
|
1077
|
+
"wires": []
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"id": "widget-diag-api-req",
|
|
1081
|
+
"type": "ui-text",
|
|
1082
|
+
"z": "tab-octopus-main",
|
|
1083
|
+
"group": "ui-group-diag-main",
|
|
1084
|
+
"name": "API Requests per Hour",
|
|
1085
|
+
"label": "API requests/hr:",
|
|
1086
|
+
"format": "{{msg.payload.api_requests_hour ?? '--'}}",
|
|
1087
|
+
"layout": "row-spread",
|
|
1088
|
+
"style": false,
|
|
1089
|
+
"order": 1,
|
|
1090
|
+
"width": "3",
|
|
1091
|
+
"height": "1",
|
|
1092
|
+
"className": "",
|
|
1093
|
+
"x": 970,
|
|
1094
|
+
"y": 1900,
|
|
1095
|
+
"wires": []
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"id": "widget-diag-complexity-gauge",
|
|
1099
|
+
"type": "ui-gauge",
|
|
1100
|
+
"z": "tab-octopus-main",
|
|
1101
|
+
"group": "ui-group-diag-main",
|
|
1102
|
+
"name": "API Complexity %",
|
|
1103
|
+
"label": "API complexity usage",
|
|
1104
|
+
"order": 2,
|
|
1105
|
+
"width": "3",
|
|
1106
|
+
"height": "3",
|
|
1107
|
+
"gtype": "gauge-half",
|
|
1108
|
+
"gstyle": "needle",
|
|
1109
|
+
"topic": "",
|
|
1110
|
+
"topicType": "str",
|
|
1111
|
+
"units": "%",
|
|
1112
|
+
"format": "{{value}}",
|
|
1113
|
+
"min": "0",
|
|
1114
|
+
"max": "100",
|
|
1115
|
+
"segments": [
|
|
1116
|
+
{"color": "#00897B", "from": "0"},
|
|
1117
|
+
{"color": "#FFA726", "from": "50"},
|
|
1118
|
+
{"color": "#EF5350", "from": "80"}
|
|
1119
|
+
],
|
|
1120
|
+
"className": "",
|
|
1121
|
+
"x": 970,
|
|
1122
|
+
"y": 1960,
|
|
1123
|
+
"wires": []
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"id": "widget-diag-next-poll",
|
|
1127
|
+
"type": "ui-text",
|
|
1128
|
+
"z": "tab-octopus-main",
|
|
1129
|
+
"group": "ui-group-diag-main",
|
|
1130
|
+
"name": "Next Poll",
|
|
1131
|
+
"label": "Next poll:",
|
|
1132
|
+
"format": "{{msg.payload.next_poll ? new Date(msg.payload.next_poll).toLocaleTimeString() : '--'}}",
|
|
1133
|
+
"layout": "row-spread",
|
|
1134
|
+
"style": false,
|
|
1135
|
+
"order": 3,
|
|
1136
|
+
"width": "3",
|
|
1137
|
+
"height": "1",
|
|
1138
|
+
"className": "",
|
|
1139
|
+
"x": 970,
|
|
1140
|
+
"y": 2020,
|
|
1141
|
+
"wires": []
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
"id": "widget-diag-update",
|
|
1145
|
+
"type": "ui-text",
|
|
1146
|
+
"z": "tab-octopus-main",
|
|
1147
|
+
"group": "ui-group-diag-main",
|
|
1148
|
+
"name": "Version / Update",
|
|
1149
|
+
"label": "Version:",
|
|
1150
|
+
"format": "{{msg.payload.installed_version || '--'}} {{msg.payload.update_available ? '→ ' + msg.payload.latest_version + ' available' : '(up to date)'}}",
|
|
1151
|
+
"layout": "row-spread",
|
|
1152
|
+
"style": false,
|
|
1153
|
+
"order": 4,
|
|
1154
|
+
"width": "6",
|
|
1155
|
+
"height": "1",
|
|
1156
|
+
"className": "",
|
|
1157
|
+
"x": 970,
|
|
1158
|
+
"y": 2080,
|
|
1159
|
+
"wires": []
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
"id": "widget-diag-timezone",
|
|
1163
|
+
"type": "ui-text",
|
|
1164
|
+
"z": "tab-octopus-main",
|
|
1165
|
+
"group": "ui-group-diag-main",
|
|
1166
|
+
"name": "Timezone Applied",
|
|
1167
|
+
"label": "Timezone:",
|
|
1168
|
+
"format": "{{msg.payload.timezone_applied || '--'}} (detected: {{msg.payload.timezone_detected || '--'}})",
|
|
1169
|
+
"layout": "row-spread",
|
|
1170
|
+
"style": false,
|
|
1171
|
+
"order": 5,
|
|
1172
|
+
"width": "6",
|
|
1173
|
+
"height": "1",
|
|
1174
|
+
"className": "",
|
|
1175
|
+
"x": 970,
|
|
1176
|
+
"y": 2140,
|
|
1177
|
+
"wires": []
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
"id": "widget-diag-errors-template",
|
|
1181
|
+
"type": "ui-template",
|
|
1182
|
+
"z": "tab-octopus-main",
|
|
1183
|
+
"group": "ui-group-diag-errors",
|
|
1184
|
+
"name": "Category Error List",
|
|
1185
|
+
"order": 1,
|
|
1186
|
+
"width": "12",
|
|
1187
|
+
"height": "5",
|
|
1188
|
+
"className": "",
|
|
1189
|
+
"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>",
|
|
1190
|
+
"storeOutMessages": true,
|
|
1191
|
+
"passthru": true,
|
|
1192
|
+
"resendOnRefresh": true,
|
|
1193
|
+
"templateScope": "local",
|
|
1194
|
+
"eventsFromServer": false,
|
|
1195
|
+
"x": 970,
|
|
1196
|
+
"y": 2200,
|
|
1197
|
+
"wires": [[]]
|
|
1198
|
+
}
|
|
1199
|
+
]
|