node-red-contrib-power-saver 3.0.7 → 3.1.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/docs/.vuepress/config.js +10 -2
- package/docs/.vuepress/dist/404.html +4 -4
- package/docs/.vuepress/dist/assets/img/best-save-config.93fa3c21.png +0 -0
- package/docs/.vuepress/dist/assets/img/lowest-price-config.6d66a8c2.png +0 -0
- package/docs/.vuepress/dist/assets/img/next-schedule-entity.4406856a.png +0 -0
- package/docs/.vuepress/dist/assets/img/next-schedule-flow.413ad62b.png +0 -0
- package/docs/.vuepress/dist/assets/img/next-schedule-sensor.eb896bdd.png +0 -0
- package/docs/.vuepress/dist/assets/js/app.5cf39ea6.js +1 -0
- package/docs/.vuepress/dist/assets/js/runtime~app.61982ee8.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-0607240a.661e1808.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-08683c60.844b04c7.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-0aca7ba6.b42fad7f.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.34230e16.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-1ad821fa.6e2194d0.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-30acb564.f2fcd69f.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-4637f9e4.38f66bbb.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-510ed0d4.67ecc9be.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-5954bcb2.182daf70.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-5db8da3a.f2de6cb9.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-61f728ca.6fdbbb92.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-677dfaed.0013f083.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-7c87f26e.1127dcf5.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-8daa1a0e.1f821c07.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-b4a42144.9e5f9728.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-e8c55052.cf8b0764.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-fffb8e28.cc5c1c74.js +1 -0
- package/docs/.vuepress/dist/changelog/index.html +4 -4
- package/docs/.vuepress/dist/contribute/index.html +4 -4
- package/docs/.vuepress/dist/examples/example-next-schedule-entity.html +25 -0
- package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +177 -157
- package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +5 -5
- package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +5 -5
- package/docs/.vuepress/dist/examples/index.html +4 -4
- package/docs/.vuepress/dist/guide/index.html +5 -5
- package/docs/.vuepress/dist/index.html +4 -4
- package/docs/.vuepress/dist/logo.png +0 -0
- package/docs/.vuepress/dist/nodes/index.html +4 -4
- package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +6 -6
- package/docs/.vuepress/dist/nodes/power-saver.html +4 -4
- package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +4 -4
- package/docs/.vuepress/dist/nodes/ps-receive-price.html +7 -7
- package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +5 -5
- package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +5 -5
- package/docs/.vuepress/dist/nodes/strategy-input.html +5 -5
- package/docs/.vuepress/public/logo.png +0 -0
- package/docs/README.md +7 -5
- package/docs/changelog/README.md +22 -5
- package/docs/contribute/README.md +1 -1
- package/docs/examples/README.md +4 -0
- package/docs/examples/example-next-schedule-entity.md +41 -0
- package/docs/examples/example-nordpool-current-state.md +172 -152
- package/docs/faq/README.md +23 -0
- package/docs/guide/README.md +16 -15
- package/docs/images/add-tariff-flow.png +0 -0
- package/docs/images/logo copy.png +0 -0
- package/docs/images/logo.png +0 -0
- package/docs/images/logo.psd +0 -0
- package/docs/images/mysterious-plan.png +0 -0
- package/docs/images/next-schedule-entity.png +0 -0
- package/docs/images/next-schedule-flow.png +0 -0
- package/docs/images/next-schedule-sensor.png +0 -0
- package/docs/images/node-ps-general-add-tariff.png +0 -0
- package/docs/images/node-red-icon-2.svg +30 -0
- package/docs/nodes/README.md +6 -0
- package/docs/nodes/old-power-saver-doc.md +6 -6
- package/docs/nodes/ps-elvia-add-tariff.md +1 -1
- package/docs/nodes/ps-general-add-tariff.md +49 -0
- package/docs/nodes/ps-receive-price.md +9 -5
- package/docs/nodes/ps-strategy-best-save.md +5 -1
- package/docs/nodes/ps-strategy-lowest-price.md +3 -3
- package/docs/nodes/strategy-input.md +1 -1
- package/package.json +3 -2
- package/src/elvia/elvia-add-tariff.js +7 -6
- package/src/general-add-tariff-functions.js +46 -0
- package/src/general-add-tariff.html +186 -0
- package/src/general-add-tariff.js +35 -0
- package/src/receive-price-functions.js +8 -0
- package/src/strategy-lowest-price.js +2 -1
- package/test/data/lowest-price-input-missing-end.json +197 -0
- package/test/data/lowest-price-result-missing-end.json +319 -0
- package/test/data/nordpool-3-days-prices.json +197 -0
- package/test/data/nordpool-3-days-result.json +439 -0
- package/test/data/nordpool-prices-in-payload.json +287 -0
- package/test/elvia.test.js +16 -2
- package/test/general-add-tariff-functions.test.js +104 -0
- package/test/general-add-tariff.test.js +183 -0
- package/test/receive-price.test.js +22 -0
- package/test/strategy-lowest-price.test.js +33 -0
- package/docs/.vuepress/dist/assets/js/app.342dc054.js +0 -1
- package/docs/.vuepress/dist/assets/js/runtime~app.0d53f24f.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-08683c60.07fe8291.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-0aca7ba6.aec5ba75.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.d008d8bc.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-1ad821fa.85407071.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-30acb564.73b8e29f.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-4637f9e4.22ab9413.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-510ed0d4.129ef915.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-5954bcb2.be07962c.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-5db8da3a.ac192f35.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-61f728ca.802ab15e.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-677dfaed.9bbbd037.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-7c87f26e.457a1a60.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-8daa1a0e.db8b59c6.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-b4a42144.6e0c5aa0.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-e8c55052.5f85b6cd.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-fffb8e28.e815e852.js +0 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_msgid": "45d6a7a32390154a",
|
|
3
|
+
"payload": {
|
|
4
|
+
"entity_id": "sensor.nordpool_kwh_oslo_nok_3_10_025",
|
|
5
|
+
"state": "2.171",
|
|
6
|
+
"attributes": {
|
|
7
|
+
"current_price": 2.171,
|
|
8
|
+
"average": 1.868,
|
|
9
|
+
"off peak 1": 1.619,
|
|
10
|
+
"off peak 2": 2.199,
|
|
11
|
+
"peak": 1.849,
|
|
12
|
+
"min": 1.605,
|
|
13
|
+
"max": 2.22,
|
|
14
|
+
"unit": "kWh",
|
|
15
|
+
"currency": "NOK",
|
|
16
|
+
"country": "Norway",
|
|
17
|
+
"region": "Oslo",
|
|
18
|
+
"low price": false,
|
|
19
|
+
"tomorrow_valid": true,
|
|
20
|
+
"today": [
|
|
21
|
+
1.639, 1.619, 1.609, 1.605, 1.605, 1.61, 1.641, 1.627, 1.685, 1.772, 1.794, 1.778, 1.812, 1.846, 1.873, 1.943,
|
|
22
|
+
1.972, 2.171, 2.22, 2.21, 2.22, 2.213, 2.192, 2.168
|
|
23
|
+
],
|
|
24
|
+
"tomorrow": [
|
|
25
|
+
2.086, 1.992, 1.951, 1.911, 2.058, 2.221, 2.875, 4.838, 5.338, 5.05, 4.603, 4.186, 3.567, 4.335, 4.987, 5.281,
|
|
26
|
+
5.424, 5.672, 5.739, 5.418, 3.303, 4.581, 3.114, 2.751
|
|
27
|
+
],
|
|
28
|
+
"raw_today": [
|
|
29
|
+
{
|
|
30
|
+
"start": "2021-12-19T00:00:00+01:00",
|
|
31
|
+
"end": "2021-12-19T01:00:00+01:00",
|
|
32
|
+
"value": 1.639
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"start": "2021-12-19T01:00:00+01:00",
|
|
36
|
+
"end": "2021-12-19T02:00:00+01:00",
|
|
37
|
+
"value": 1.619
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"start": "2021-12-19T02:00:00+01:00",
|
|
41
|
+
"end": "2021-12-19T03:00:00+01:00",
|
|
42
|
+
"value": 1.609
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"start": "2021-12-19T03:00:00+01:00",
|
|
46
|
+
"end": "2021-12-19T04:00:00+01:00",
|
|
47
|
+
"value": 1.605
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"start": "2021-12-19T04:00:00+01:00",
|
|
51
|
+
"end": "2021-12-19T05:00:00+01:00",
|
|
52
|
+
"value": 1.605
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"start": "2021-12-19T05:00:00+01:00",
|
|
56
|
+
"end": "2021-12-19T06:00:00+01:00",
|
|
57
|
+
"value": 1.61
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"start": "2021-12-19T06:00:00+01:00",
|
|
61
|
+
"end": "2021-12-19T07:00:00+01:00",
|
|
62
|
+
"value": 1.641
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"start": "2021-12-19T07:00:00+01:00",
|
|
66
|
+
"end": "2021-12-19T08:00:00+01:00",
|
|
67
|
+
"value": 1.627
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"start": "2021-12-19T08:00:00+01:00",
|
|
71
|
+
"end": "2021-12-19T09:00:00+01:00",
|
|
72
|
+
"value": 1.685
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"start": "2021-12-19T09:00:00+01:00",
|
|
76
|
+
"end": "2021-12-19T10:00:00+01:00",
|
|
77
|
+
"value": 1.772
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"start": "2021-12-19T10:00:00+01:00",
|
|
81
|
+
"end": "2021-12-19T11:00:00+01:00",
|
|
82
|
+
"value": 1.794
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"start": "2021-12-19T11:00:00+01:00",
|
|
86
|
+
"end": "2021-12-19T12:00:00+01:00",
|
|
87
|
+
"value": 1.778
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"start": "2021-12-19T12:00:00+01:00",
|
|
91
|
+
"end": "2021-12-19T13:00:00+01:00",
|
|
92
|
+
"value": 1.812
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"start": "2021-12-19T13:00:00+01:00",
|
|
96
|
+
"end": "2021-12-19T14:00:00+01:00",
|
|
97
|
+
"value": 1.846
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"start": "2021-12-19T14:00:00+01:00",
|
|
101
|
+
"end": "2021-12-19T15:00:00+01:00",
|
|
102
|
+
"value": 1.873
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"start": "2021-12-19T15:00:00+01:00",
|
|
106
|
+
"end": "2021-12-19T16:00:00+01:00",
|
|
107
|
+
"value": 1.943
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"start": "2021-12-19T16:00:00+01:00",
|
|
111
|
+
"end": "2021-12-19T17:00:00+01:00",
|
|
112
|
+
"value": 1.972
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"start": "2021-12-19T17:00:00+01:00",
|
|
116
|
+
"end": "2021-12-19T18:00:00+01:00",
|
|
117
|
+
"value": 2.171
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"start": "2021-12-19T18:00:00+01:00",
|
|
121
|
+
"end": "2021-12-19T19:00:00+01:00",
|
|
122
|
+
"value": 2.22
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"start": "2021-12-19T19:00:00+01:00",
|
|
126
|
+
"end": "2021-12-19T20:00:00+01:00",
|
|
127
|
+
"value": 2.21
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"start": "2021-12-19T20:00:00+01:00",
|
|
131
|
+
"end": "2021-12-19T21:00:00+01:00",
|
|
132
|
+
"value": 2.22
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"start": "2021-12-19T21:00:00+01:00",
|
|
136
|
+
"end": "2021-12-19T22:00:00+01:00",
|
|
137
|
+
"value": 2.213
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"start": "2021-12-19T22:00:00+01:00",
|
|
141
|
+
"end": "2021-12-19T23:00:00+01:00",
|
|
142
|
+
"value": 2.192
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"start": "2021-12-19T23:00:00+01:00",
|
|
146
|
+
"end": "2021-12-20T00:00:00+01:00",
|
|
147
|
+
"value": 2.168
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"raw_tomorrow": [
|
|
151
|
+
{
|
|
152
|
+
"start": "2021-12-20T00:00:00+01:00",
|
|
153
|
+
"end": "2021-12-20T01:00:00+01:00",
|
|
154
|
+
"value": 2.086
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"start": "2021-12-20T01:00:00+01:00",
|
|
158
|
+
"end": "2021-12-20T02:00:00+01:00",
|
|
159
|
+
"value": 1.992
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"start": "2021-12-20T02:00:00+01:00",
|
|
163
|
+
"end": "2021-12-20T03:00:00+01:00",
|
|
164
|
+
"value": 1.951
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"start": "2021-12-20T03:00:00+01:00",
|
|
168
|
+
"end": "2021-12-20T04:00:00+01:00",
|
|
169
|
+
"value": 1.911
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"start": "2021-12-20T04:00:00+01:00",
|
|
173
|
+
"end": "2021-12-20T05:00:00+01:00",
|
|
174
|
+
"value": 2.058
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"start": "2021-12-20T05:00:00+01:00",
|
|
178
|
+
"end": "2021-12-20T06:00:00+01:00",
|
|
179
|
+
"value": 2.221
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"start": "2021-12-20T06:00:00+01:00",
|
|
183
|
+
"end": "2021-12-20T07:00:00+01:00",
|
|
184
|
+
"value": 2.875
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"start": "2021-12-20T07:00:00+01:00",
|
|
188
|
+
"end": "2021-12-20T08:00:00+01:00",
|
|
189
|
+
"value": 4.838
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"start": "2021-12-20T08:00:00+01:00",
|
|
193
|
+
"end": "2021-12-20T09:00:00+01:00",
|
|
194
|
+
"value": 5.338
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"start": "2021-12-20T09:00:00+01:00",
|
|
198
|
+
"end": "2021-12-20T10:00:00+01:00",
|
|
199
|
+
"value": 5.05
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"start": "2021-12-20T10:00:00+01:00",
|
|
203
|
+
"end": "2021-12-20T11:00:00+01:00",
|
|
204
|
+
"value": 4.603
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"start": "2021-12-20T11:00:00+01:00",
|
|
208
|
+
"end": "2021-12-20T12:00:00+01:00",
|
|
209
|
+
"value": 4.186
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"start": "2021-12-20T12:00:00+01:00",
|
|
213
|
+
"end": "2021-12-20T13:00:00+01:00",
|
|
214
|
+
"value": 3.567
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"start": "2021-12-20T13:00:00+01:00",
|
|
218
|
+
"end": "2021-12-20T14:00:00+01:00",
|
|
219
|
+
"value": 4.335
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"start": "2021-12-20T14:00:00+01:00",
|
|
223
|
+
"end": "2021-12-20T15:00:00+01:00",
|
|
224
|
+
"value": 4.987
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"start": "2021-12-20T15:00:00+01:00",
|
|
228
|
+
"end": "2021-12-20T16:00:00+01:00",
|
|
229
|
+
"value": 5.281
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"start": "2021-12-20T16:00:00+01:00",
|
|
233
|
+
"end": "2021-12-20T17:00:00+01:00",
|
|
234
|
+
"value": 5.424
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"start": "2021-12-20T17:00:00+01:00",
|
|
238
|
+
"end": "2021-12-20T18:00:00+01:00",
|
|
239
|
+
"value": 5.672
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"start": "2021-12-20T18:00:00+01:00",
|
|
243
|
+
"end": "2021-12-20T19:00:00+01:00",
|
|
244
|
+
"value": 5.739
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"start": "2021-12-20T19:00:00+01:00",
|
|
248
|
+
"end": "2021-12-20T20:00:00+01:00",
|
|
249
|
+
"value": 5.418
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"start": "2021-12-20T20:00:00+01:00",
|
|
253
|
+
"end": "2021-12-20T21:00:00+01:00",
|
|
254
|
+
"value": 3.303
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"start": "2021-12-20T21:00:00+01:00",
|
|
258
|
+
"end": "2021-12-20T22:00:00+01:00",
|
|
259
|
+
"value": 4.581
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"start": "2021-12-20T22:00:00+01:00",
|
|
263
|
+
"end": "2021-12-20T23:00:00+01:00",
|
|
264
|
+
"value": 3.114
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"start": "2021-12-20T23:00:00+01:00",
|
|
268
|
+
"end": "2021-12-21T00:00:00+01:00",
|
|
269
|
+
"value": 2.751
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
"unit_of_measurement": "NOK/kWh",
|
|
273
|
+
"icon": "mdi:flash",
|
|
274
|
+
"friendly_name": "nordpool_kwh_oslo_nok_3_10_025"
|
|
275
|
+
},
|
|
276
|
+
"last_changed": "2021-12-19T16:00:00.099173+00:00",
|
|
277
|
+
"last_updated": "2021-12-19T16:00:00.099173+00:00",
|
|
278
|
+
"context": {
|
|
279
|
+
"id": "bd31b337e9271ec5ee5b8c1c170840c2",
|
|
280
|
+
"parent_id": null,
|
|
281
|
+
"user_id": null
|
|
282
|
+
},
|
|
283
|
+
"timeSinceChangedMs": 815634,
|
|
284
|
+
"original_state": "2.171"
|
|
285
|
+
},
|
|
286
|
+
"topic": ""
|
|
287
|
+
}
|
package/test/elvia.test.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const helper = require("node-red-node-test-helper");
|
|
2
2
|
const elviaAddTariff = require("../src/elvia/elvia-add-tariff.js");
|
|
3
|
+
const elviaConfig = require("../src/elvia/elvia-config.js");
|
|
3
4
|
const expect = require("expect");
|
|
4
5
|
|
|
5
6
|
helper.init(require.resolve("node-red"));
|
|
@@ -16,8 +17,21 @@ describe("ps-elvia-add-tariff node", function () {
|
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
it("should be loaded", function (done) {
|
|
19
|
-
const flow = [
|
|
20
|
-
|
|
20
|
+
const flow = [
|
|
21
|
+
// elviaConfig.credentials.elviaSubscriptionKey
|
|
22
|
+
{
|
|
23
|
+
id: "n1",
|
|
24
|
+
type: "ps-elvia-add-tariff",
|
|
25
|
+
name: "test name",
|
|
26
|
+
elviaConfig: "n2",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "n2",
|
|
30
|
+
type: "ps-elvia-config",
|
|
31
|
+
name: "test name",
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
helper.load([elviaAddTariff, elviaConfig], flow, function () {
|
|
21
35
|
const n1 = helper.getNode("n1");
|
|
22
36
|
expect(n1).toHaveProperty("name", "test name");
|
|
23
37
|
done();
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const expect = require("expect");
|
|
2
|
+
const { DateTime } = require("luxon");
|
|
3
|
+
const { addTariffToPrices, buildAllHours } = require("../src/general-add-tariff-functions");
|
|
4
|
+
|
|
5
|
+
describe("general-add-tariff-functions", () => {
|
|
6
|
+
it("can build all hours 6-22", () => {
|
|
7
|
+
const periods = [
|
|
8
|
+
{ start: "06", value: 10 },
|
|
9
|
+
{ start: "22", value: 11 },
|
|
10
|
+
];
|
|
11
|
+
const result = [];
|
|
12
|
+
fillResult(result, 0, 5, 11);
|
|
13
|
+
fillResult(result, 6, 21, 10);
|
|
14
|
+
fillResult(result, 22, 23, 11);
|
|
15
|
+
|
|
16
|
+
expect(buildAllHours(console, periods)).toEqual(result);
|
|
17
|
+
});
|
|
18
|
+
it("can build all hours 0-22", () => {
|
|
19
|
+
const periods = [
|
|
20
|
+
{ start: "00", value: 10 },
|
|
21
|
+
{ start: "22", value: 11 },
|
|
22
|
+
];
|
|
23
|
+
const result = [];
|
|
24
|
+
fillResult(result, 0, 21, 10);
|
|
25
|
+
fillResult(result, 22, 23, 11);
|
|
26
|
+
|
|
27
|
+
expect(buildAllHours(console, periods)).toEqual(result);
|
|
28
|
+
});
|
|
29
|
+
it("can build all hours 22-23", () => {
|
|
30
|
+
const periods = [
|
|
31
|
+
{ start: "00", value: 10 },
|
|
32
|
+
{ start: "23", value: 11 },
|
|
33
|
+
];
|
|
34
|
+
const result = [];
|
|
35
|
+
fillResult(result, 0, 22, 10);
|
|
36
|
+
fillResult(result, 23, 23, 11);
|
|
37
|
+
|
|
38
|
+
expect(buildAllHours(console, periods)).toEqual(result);
|
|
39
|
+
});
|
|
40
|
+
it("can add tariff to prices", () => {
|
|
41
|
+
const config = {
|
|
42
|
+
validFrom: "2021-12-01",
|
|
43
|
+
validTo: "2021-12-10",
|
|
44
|
+
periods: [
|
|
45
|
+
{ start: "06", value: 10 },
|
|
46
|
+
{ start: "22", value: 11 },
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
const values = [];
|
|
50
|
+
fillResult(values, 0, 5, 21);
|
|
51
|
+
fillResult(values, 6, 21, 20);
|
|
52
|
+
fillResult(values, 22, 23, 21);
|
|
53
|
+
const prices = values.map((_, i) => {
|
|
54
|
+
const start = DateTime.fromISO(config.validFrom).plus({ hours: i }).toISO();
|
|
55
|
+
return {
|
|
56
|
+
start,
|
|
57
|
+
value: 10,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const result = values.map((v, i) => {
|
|
61
|
+
const start = DateTime.fromISO(config.validFrom).plus({ hours: i }).toISO();
|
|
62
|
+
return {
|
|
63
|
+
start,
|
|
64
|
+
value: v,
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
addTariffToPrices(console, config, prices);
|
|
68
|
+
expect(prices).toEqual(result);
|
|
69
|
+
});
|
|
70
|
+
it("pass through when out of period", () => {
|
|
71
|
+
const config = {
|
|
72
|
+
validFrom: "2021-12-01",
|
|
73
|
+
validTo: "2021-12-10",
|
|
74
|
+
periods: [
|
|
75
|
+
{ start: "06", value: 10 },
|
|
76
|
+
{ start: "22", value: 11 },
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
const values = [];
|
|
80
|
+
fillResult(values, 0, 23, 10);
|
|
81
|
+
const prices = values.map((_, i) => {
|
|
82
|
+
const start = DateTime.fromISO(config.validFrom).plus({ days: 20, hours: i }).toISO();
|
|
83
|
+
return {
|
|
84
|
+
start,
|
|
85
|
+
value: 10,
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
const result = values.map((v, i) => {
|
|
89
|
+
const start = DateTime.fromISO(config.validFrom).plus({ days: 20, hours: i }).toISO();
|
|
90
|
+
return {
|
|
91
|
+
start,
|
|
92
|
+
value: v,
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
addTariffToPrices(console, config, prices);
|
|
96
|
+
expect(prices).toEqual(result);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
function fillResult(arr, from, to, value) {
|
|
101
|
+
for (let start = from; start <= to; start++) {
|
|
102
|
+
arr[start] = value;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
const helper = require("node-red-node-test-helper");
|
|
2
|
+
const addTariff = require("../src/general-add-tariff.js");
|
|
3
|
+
const expect = require("expect");
|
|
4
|
+
const cloneDeep = require("lodash.clonedeep");
|
|
5
|
+
|
|
6
|
+
const prices = {
|
|
7
|
+
source: "Test",
|
|
8
|
+
priceData: [
|
|
9
|
+
{
|
|
10
|
+
value: 0.2,
|
|
11
|
+
start: "2021-10-11T00:00:00.000+02:00",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: 0.3,
|
|
15
|
+
start: "2021-10-11T01:00:00.000+02:00",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: 0.1,
|
|
19
|
+
start: "2021-10-11T02:00:00.000+02:00",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 1.2345,
|
|
23
|
+
start: "2021-10-11T03:00:00.000+02:00",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: 2.1,
|
|
27
|
+
start: "2021-10-12T00:00:00.000+02:00",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 2.2,
|
|
31
|
+
start: "2021-10-12T01:00:00.000+02:00",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
helper.init(require.resolve("node-red"));
|
|
37
|
+
|
|
38
|
+
describe("general-add-tariff node", function () {
|
|
39
|
+
beforeEach(function (done) {
|
|
40
|
+
helper.startServer(done);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
afterEach(function (done) {
|
|
44
|
+
helper.unload().then(function () {
|
|
45
|
+
helper.stopServer(done);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("should be loaded", function (done) {
|
|
50
|
+
const flow = [{ id: "n1", type: "ps-general-add-tariff", name: "test name" }];
|
|
51
|
+
helper.load(addTariff, flow, function () {
|
|
52
|
+
const n1 = helper.getNode("n1");
|
|
53
|
+
expect(n1).toHaveProperty("name", "test name");
|
|
54
|
+
done();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("should add to price", function (done) {
|
|
59
|
+
const flow = [
|
|
60
|
+
{
|
|
61
|
+
id: "n1",
|
|
62
|
+
type: "ps-general-add-tariff",
|
|
63
|
+
name: "Add tariff",
|
|
64
|
+
wires: [["n2"]],
|
|
65
|
+
periods: [
|
|
66
|
+
{ start: "01", value: "0.50" },
|
|
67
|
+
{ start: "03", value: "0.80" },
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{ id: "n2", type: "helper" },
|
|
71
|
+
];
|
|
72
|
+
const result = cloneDeep(prices);
|
|
73
|
+
result.priceData[0].value = 1.0;
|
|
74
|
+
result.priceData[1].value = 0.8;
|
|
75
|
+
result.priceData[2].value = 0.6;
|
|
76
|
+
result.priceData[3].value = 2.0345;
|
|
77
|
+
result.priceData[4].value = 2.9;
|
|
78
|
+
result.priceData[5].value = 2.7;
|
|
79
|
+
helper.load(addTariff, flow, function () {
|
|
80
|
+
const n1 = helper.getNode("n1");
|
|
81
|
+
const n2 = helper.getNode("n2");
|
|
82
|
+
n2.on("input", function (msg) {
|
|
83
|
+
expect(msg).toHaveProperty("payload", result);
|
|
84
|
+
done();
|
|
85
|
+
});
|
|
86
|
+
n1.receive({ payload: prices });
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
it("should add to price when only first day is valid", function (done) {
|
|
90
|
+
const flow = [
|
|
91
|
+
{
|
|
92
|
+
id: "n1",
|
|
93
|
+
type: "ps-general-add-tariff",
|
|
94
|
+
name: "Add tariff",
|
|
95
|
+
wires: [["n2"]],
|
|
96
|
+
periods: [
|
|
97
|
+
{ start: "01", value: "0.50" },
|
|
98
|
+
{ start: "03", value: "0.80" },
|
|
99
|
+
],
|
|
100
|
+
validFrom: "2021-10-11",
|
|
101
|
+
validTo: "2021-10-11",
|
|
102
|
+
},
|
|
103
|
+
{ id: "n2", type: "helper" },
|
|
104
|
+
];
|
|
105
|
+
const result = cloneDeep(prices);
|
|
106
|
+
console.log(JSON.stringify(result, null, 2));
|
|
107
|
+
result.priceData[0].value = 1.0;
|
|
108
|
+
result.priceData[1].value = 0.8;
|
|
109
|
+
result.priceData[2].value = 0.6;
|
|
110
|
+
result.priceData[3].value = 2.0345;
|
|
111
|
+
result.priceData[4].value = 2.1;
|
|
112
|
+
result.priceData[5].value = 2.2;
|
|
113
|
+
helper.load(addTariff, flow, function () {
|
|
114
|
+
const n1 = helper.getNode("n1");
|
|
115
|
+
const n2 = helper.getNode("n2");
|
|
116
|
+
n2.on("input", function (msg) {
|
|
117
|
+
expect(msg).toHaveProperty("payload", result);
|
|
118
|
+
done();
|
|
119
|
+
});
|
|
120
|
+
n1.receive({ payload: prices });
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
it("should add to price when only last day is valid", function (done) {
|
|
124
|
+
const flow = [
|
|
125
|
+
{
|
|
126
|
+
id: "n1",
|
|
127
|
+
type: "ps-general-add-tariff",
|
|
128
|
+
name: "Add tariff",
|
|
129
|
+
wires: [["n2"]],
|
|
130
|
+
periods: [
|
|
131
|
+
{ start: "01", value: "0.50" },
|
|
132
|
+
{ start: "03", value: "0.80" },
|
|
133
|
+
],
|
|
134
|
+
validFrom: "2021-10-12",
|
|
135
|
+
},
|
|
136
|
+
{ id: "n2", type: "helper" },
|
|
137
|
+
];
|
|
138
|
+
const result = cloneDeep(prices);
|
|
139
|
+
result.priceData[0].value = 0.2;
|
|
140
|
+
result.priceData[1].value = 0.3;
|
|
141
|
+
result.priceData[2].value = 0.1;
|
|
142
|
+
result.priceData[3].value = 1.2345;
|
|
143
|
+
result.priceData[4].value = 2.9;
|
|
144
|
+
result.priceData[5].value = 2.7;
|
|
145
|
+
helper.load(addTariff, flow, function () {
|
|
146
|
+
const n1 = helper.getNode("n1");
|
|
147
|
+
const n2 = helper.getNode("n2");
|
|
148
|
+
n2.on("input", function (msg) {
|
|
149
|
+
expect(msg).toHaveProperty("payload", result);
|
|
150
|
+
done();
|
|
151
|
+
});
|
|
152
|
+
n1.receive({ payload: prices });
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
it("should add to price when only one period", function (done) {
|
|
156
|
+
const flow = [
|
|
157
|
+
{
|
|
158
|
+
id: "n1",
|
|
159
|
+
type: "ps-general-add-tariff",
|
|
160
|
+
name: "Add tariff",
|
|
161
|
+
wires: [["n2"]],
|
|
162
|
+
periods: [{ start: "01", value: "0.50" }],
|
|
163
|
+
},
|
|
164
|
+
{ id: "n2", type: "helper" },
|
|
165
|
+
];
|
|
166
|
+
const result = cloneDeep(prices);
|
|
167
|
+
result.priceData[0].value = 0.7;
|
|
168
|
+
result.priceData[1].value = 0.8;
|
|
169
|
+
result.priceData[2].value = 0.6;
|
|
170
|
+
result.priceData[3].value = 1.7345;
|
|
171
|
+
result.priceData[4].value = 2.6;
|
|
172
|
+
result.priceData[5].value = 2.7;
|
|
173
|
+
helper.load(addTariff, flow, function () {
|
|
174
|
+
const n1 = helper.getNode("n1");
|
|
175
|
+
const n2 = helper.getNode("n2");
|
|
176
|
+
n2.on("input", function (msg) {
|
|
177
|
+
expect(msg).toHaveProperty("payload", result);
|
|
178
|
+
done();
|
|
179
|
+
});
|
|
180
|
+
n1.receive({ payload: prices });
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
});
|
|
@@ -120,4 +120,26 @@ describe("receive-price node", function () {
|
|
|
120
120
|
n1.receive({ payload: nordpoolPrices.payload, data: nordpoolPrices.data });
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
|
+
it("should convert nordpool data in payload", function (done) {
|
|
124
|
+
const nordpoolPrices = require("./data/nordpool-prices-in-payload.json");
|
|
125
|
+
const flow = [
|
|
126
|
+
{
|
|
127
|
+
id: "n1",
|
|
128
|
+
type: "ps-receive-price",
|
|
129
|
+
name: "Receive prices",
|
|
130
|
+
wires: [["n2"]],
|
|
131
|
+
},
|
|
132
|
+
{ id: "n2", type: "helper" },
|
|
133
|
+
];
|
|
134
|
+
helper.load(receivePrices, flow, function () {
|
|
135
|
+
const n1 = helper.getNode("n1");
|
|
136
|
+
const n2 = helper.getNode("n2");
|
|
137
|
+
n2.on("input", function (msg) {
|
|
138
|
+
expect(msg.payload.priceData.length).toEqual(48);
|
|
139
|
+
expect(msg.payload.source).toEqual("Nordpool");
|
|
140
|
+
done();
|
|
141
|
+
});
|
|
142
|
+
n1.receive({ payload: nordpoolPrices.payload });
|
|
143
|
+
});
|
|
144
|
+
});
|
|
123
145
|
});
|
|
@@ -504,6 +504,39 @@ describe("ps-strategy-lowest-price node", function () {
|
|
|
504
504
|
n1.receive({ payload: makePayload(input, time) });
|
|
505
505
|
});
|
|
506
506
|
});
|
|
507
|
+
it("fix bug", function (done) {
|
|
508
|
+
const input = require("./data/lowest-price-input-missing-end.json");
|
|
509
|
+
const result = require("./data/lowest-price-result-missing-end.json");
|
|
510
|
+
const flow = [
|
|
511
|
+
{
|
|
512
|
+
id: "n1",
|
|
513
|
+
type: "ps-strategy-lowest-price",
|
|
514
|
+
name: "test name",
|
|
515
|
+
fromTime: "22",
|
|
516
|
+
toTime: "08",
|
|
517
|
+
hoursOn: 3,
|
|
518
|
+
doNotSplit: true,
|
|
519
|
+
sendCurrentValueWhenRescheduling: true,
|
|
520
|
+
outputIfNoSchedule: false,
|
|
521
|
+
outputOutsidePeriod: false,
|
|
522
|
+
wires: [["n3"], ["n4"], ["n2"]],
|
|
523
|
+
},
|
|
524
|
+
{ id: "n2", type: "helper" },
|
|
525
|
+
{ id: "n3", type: "helper" },
|
|
526
|
+
{ id: "n4", type: "helper" },
|
|
527
|
+
];
|
|
528
|
+
helper.load(lowestPrice, flow, function () {
|
|
529
|
+
const n1 = helper.getNode("n1");
|
|
530
|
+
const n2 = helper.getNode("n2");
|
|
531
|
+
n2.on("input", function (msg) {
|
|
532
|
+
expect(msg).toHaveProperty("payload", result.payload);
|
|
533
|
+
n1.warn.should.not.be.called;
|
|
534
|
+
done();
|
|
535
|
+
});
|
|
536
|
+
const time = DateTime.fromISO(prices.priceData[10].start);
|
|
537
|
+
n1.receive({ payload: makePayload(input, time) });
|
|
538
|
+
});
|
|
539
|
+
});
|
|
507
540
|
});
|
|
508
541
|
|
|
509
542
|
function makeFlow(hoursOn) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[143],{3131:(e,t,n)=>{n.d(t,{g:()=>s});var a=n(2009),d=n(6971),o=n(1598);const s=[a.Z,d.Z,o.Z]},9947:(e,t,n)=>{n.d(t,{p:()=>a});const a=[n(3051).Z]},4611:(e,t,n)=>{n.d(t,{l:()=>s});var a=n(8866),d=n(1263),o=n(6243);const s=[a.Z,d.Z,o.Z]},4150:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(6252);const d={404:(0,a.RC)((()=>n.e(491).then(n.bind(n,8491)))),Layout:(0,a.RC)((()=>n.e(293).then(n.bind(n,3293))))}},6056:(e,t,n)=>{n.d(t,{b:()=>d});var a=n(6252);const d={"v-8daa1a0e":(0,a.RC)((()=>n.e(509).then(n.bind(n,1829)))),"v-510ed0d4":(0,a.RC)((()=>n.e(495).then(n.bind(n,3619)))),"v-7c87f26e":(0,a.RC)((()=>n.e(889).then(n.bind(n,1787)))),"v-0aca7ba6":(0,a.RC)((()=>n.e(27).then(n.bind(n,1701)))),"v-61f728ca":(0,a.RC)((()=>n.e(283).then(n.bind(n,8156)))),"v-30acb564":(0,a.RC)((()=>n.e(901).then(n.bind(n,2870)))),"v-5db8da3a":(0,a.RC)((()=>n.e(625).then(n.bind(n,3350)))),"v-fffb8e28":(0,a.RC)((()=>n.e(807).then(n.bind(n,4595)))),"v-e8c55052":(0,a.RC)((()=>n.e(651).then(n.bind(n,4493)))),"v-b4a42144":(0,a.RC)((()=>n.e(407).then(n.bind(n,3838)))),"v-1ad821fa":(0,a.RC)((()=>n.e(22).then(n.bind(n,8718)))),"v-08683c60":(0,a.RC)((()=>n.e(332).then(n.bind(n,6250)))),"v-677dfaed":(0,a.RC)((()=>n.e(745).then(n.bind(n,1253)))),"v-0b5e3c8c":(0,a.RC)((()=>n.e(363).then(n.bind(n,6112)))),"v-4637f9e4":(0,a.RC)((()=>n.e(418).then(n.bind(n,1255)))),"v-5954bcb2":(0,a.RC)((()=>n.e(317).then(n.bind(n,8638)))),"v-3706649a":(0,a.RC)((()=>n.e(88).then(n.bind(n,8109))))}},9706:(e,t,n)=>{n.d(t,{T:()=>a});const a={"v-8daa1a0e":()=>n.e(509).then(n.bind(n,6464)).then((({data:e})=>e)),"v-510ed0d4":()=>n.e(495).then(n.bind(n,3707)).then((({data:e})=>e)),"v-7c87f26e":()=>n.e(889).then(n.bind(n,9459)).then((({data:e})=>e)),"v-0aca7ba6":()=>n.e(27).then(n.bind(n,7726)).then((({data:e})=>e)),"v-61f728ca":()=>n.e(283).then(n.bind(n,4773)).then((({data:e})=>e)),"v-30acb564":()=>n.e(901).then(n.bind(n,8835)).then((({data:e})=>e)),"v-5db8da3a":()=>n.e(625).then(n.bind(n,8682)).then((({data:e})=>e)),"v-fffb8e28":()=>n.e(807).then(n.bind(n,9570)).then((({data:e})=>e)),"v-e8c55052":()=>n.e(651).then(n.bind(n,3029)).then((({data:e})=>e)),"v-b4a42144":()=>n.e(407).then(n.bind(n,7952)).then((({data:e})=>e)),"v-1ad821fa":()=>n.e(22).then(n.bind(n,2336)).then((({data:e})=>e)),"v-08683c60":()=>n.e(332).then(n.bind(n,5845)).then((({data:e})=>e)),"v-677dfaed":()=>n.e(745).then(n.bind(n,7951)).then((({data:e})=>e)),"v-0b5e3c8c":()=>n.e(363).then(n.bind(n,3594)).then((({data:e})=>e)),"v-4637f9e4":()=>n.e(418).then(n.bind(n,3959)).then((({data:e})=>e)),"v-5954bcb2":()=>n.e(317).then(n.bind(n,1535)).then((({data:e})=>e)),"v-3706649a":()=>n.e(88).then(n.bind(n,1801)).then((({data:e})=>e))}},4634:(e,t,n)=>{n.d(t,{g:()=>d});var a=n(4802);const d=[["v-8daa1a0e","/","",["/index.html","/README.md"]],["v-510ed0d4","/changelog/","Change Log",["/changelog/index.html","/changelog/README.md"]],["v-7c87f26e","/contribute/","Contribute",["/contribute/index.html","/contribute/README.md"]],["v-0aca7ba6","/examples/","Examples",["/examples/index.html","/examples/README.md"]],["v-61f728ca","/examples/example-nordpool-current-state.html","Nord Pool and current state node",["/examples/example-nordpool-current-state","/examples/example-nordpool-current-state.md"]],["v-30acb564","/examples/example-nordpool-events-state.html","Nord Pool and events: state node",["/examples/example-nordpool-events-state","/examples/example-nordpool-events-state.md"]],["v-5db8da3a","/examples/example-tibber-mqtt.html","Tibber, a switch and MQTT",["/examples/example-tibber-mqtt","/examples/example-tibber-mqtt.md"]],["v-fffb8e28","/guide/","Guide",["/guide/index.html","/guide/README.md"]],["v-e8c55052","/nodes/","Nodes",["/nodes/index.html","/nodes/README.md"]],["v-b4a42144","/nodes/old-power-saver-doc.html","node-red-contrib-power-saver v2 (deprecated)",["/nodes/old-power-saver-doc","/nodes/old-power-saver-doc.md"]],["v-1ad821fa","/nodes/power-saver.html","power-saver",["/nodes/power-saver","/nodes/power-saver.md"]],["v-08683c60","/nodes/ps-elvia-add-tariff.html","ps-elvia-add-tariff",["/nodes/ps-elvia-add-tariff","/nodes/ps-elvia-add-tariff.md"]],["v-677dfaed","/nodes/ps-receive-price.html","ps-receive-price",["/nodes/ps-receive-price","/nodes/ps-receive-price.md"]],["v-0b5e3c8c","/nodes/ps-strategy-best-save.html","ps-strategy-best-save",["/nodes/ps-strategy-best-save","/nodes/ps-strategy-best-save.md"]],["v-4637f9e4","/nodes/ps-strategy-lowest-price.html","ps-strategy-lowest-price",["/nodes/ps-strategy-lowest-price","/nodes/ps-strategy-lowest-price.md"]],["v-5954bcb2","/nodes/strategy-input.html","Strategy input format",["/nodes/strategy-input","/nodes/strategy-input.md"]],["v-3706649a","/404.html","",["/404"]]].reduce(((e,[t,n,d,o])=>(e.push({name:t,path:n,component:a.Y,meta:{title:d}},...o.map((e=>({path:e,redirect:n})))),e)),[{name:"404",path:"/:catchAll(.*)",component:a.Y}])},5220:(e,t,n)=>{n.d(t,{H:()=>a});const a={base:"/node-red-contrib-power-saver/",lang:"en-US",title:"Power Saver",description:"A Node-RED note to save money on hourly changing power prices",head:[["script",{src:"https://c6.patreon.com/becomePatronButton.bundle.js"}],["link",{rel:"icon",href:"/euro.png"}]],locales:{}}},2232:(e,t,n)=>{n.d(t,{f:()=>a});const a={navbar:[{text:"Guide",link:"/guide/"},{text:"Nodes",link:"/nodes/"},{text:"Examples",link:"/examples/"},{text:"Contribute",link:"/contribute/"},{text:"Changes",link:"/changelog/"}],sidebar:{"/guide/":[{text:"Guide",children:["/guide/README.md"]}],"/nodes/":[{text:"Nodes",children:[{text:"Power Saver",link:"/nodes/power-saver.md"},{text:"Strategy nodes",children:["/nodes/ps-strategy-best-save.md","/nodes/ps-strategy-lowest-price.md"]},{text:"Utility nodes",children:["/nodes/ps-receive-price.md"]},{text:"Grid tariff nodes",children:["/nodes/ps-elvia-add-tariff.md"]}]},{text:"Data format",children:["/nodes/strategy-input.md"]}],"/examples/":[{text:"Examples",children:["/examples/example-nordpool-current-state.md","/examples/example-nordpool-events-state.md","/examples/example-tibber-mqtt.md"]}],"/contribute/":"auto","/changelog/":"auto"},locales:{"/":{selectLanguageName:"English"}},logo:null,darkMode:!0,repo:null,selectLanguageText:"Languages",selectLanguageAriaLabel:"Select language",sidebarDepth:2,editLink:!0,editLinkText:"Edit this page",lastUpdated:!0,lastUpdatedText:"Last Updated",contributors:!0,contributorsText:"Contributors",notFound:["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],backToHome:"Take me home",openInNewWindow:"open in new window",toggleDarkMode:"toggle dark mode",toggleSidebar:"toggle sidebar"}}},e=>{e.O(0,[460,812],(()=>(5698,e(e.s=5698)))),e.O()}]);
|