node-red-contrib-power-saver 3.0.9 → 3.0.10

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.
Files changed (61) hide show
  1. package/docs/.vuepress/config.js +4 -0
  2. package/docs/.vuepress/dist/404.html +2 -2
  3. package/docs/.vuepress/dist/assets/img/best-save-config.93fa3c21.png +0 -0
  4. package/docs/.vuepress/dist/assets/img/lowest-price-config.6d66a8c2.png +0 -0
  5. package/docs/.vuepress/dist/assets/js/app.3cfedce6.js +1 -0
  6. package/docs/.vuepress/dist/assets/js/runtime~app.f1d7fab8.js +1 -0
  7. package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.163b80fb.js +1 -0
  8. package/docs/.vuepress/dist/assets/js/v-4637f9e4.60300b77.js +1 -0
  9. package/docs/.vuepress/dist/assets/js/v-510ed0d4.b76b84de.js +1 -0
  10. package/docs/.vuepress/dist/assets/js/v-5954bcb2.9e6d2df1.js +1 -0
  11. package/docs/.vuepress/dist/assets/js/v-61f728ca.64fa763c.js +1 -0
  12. package/docs/.vuepress/dist/assets/js/v-677dfaed.b84f09f5.js +1 -0
  13. package/docs/.vuepress/dist/assets/js/{v-7c87f26e.457a1a60.js → v-7c87f26e.91c245da.js} +1 -1
  14. package/docs/.vuepress/dist/assets/js/v-8daa1a0e.66c9dbce.js +1 -0
  15. package/docs/.vuepress/dist/assets/js/v-b4a42144.d1856a24.js +1 -0
  16. package/docs/.vuepress/dist/assets/js/v-fffb8e28.9e0579a1.js +1 -0
  17. package/docs/.vuepress/dist/changelog/index.html +3 -3
  18. package/docs/.vuepress/dist/contribute/index.html +3 -3
  19. package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +175 -155
  20. package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +2 -2
  21. package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +2 -2
  22. package/docs/.vuepress/dist/examples/index.html +2 -2
  23. package/docs/.vuepress/dist/guide/index.html +4 -4
  24. package/docs/.vuepress/dist/index.html +3 -3
  25. package/docs/.vuepress/dist/logo.png +0 -0
  26. package/docs/.vuepress/dist/nodes/index.html +2 -2
  27. package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +5 -5
  28. package/docs/.vuepress/dist/nodes/power-saver.html +2 -2
  29. package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +2 -2
  30. package/docs/.vuepress/dist/nodes/ps-receive-price.html +5 -5
  31. package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +4 -4
  32. package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +4 -4
  33. package/docs/.vuepress/dist/nodes/strategy-input.html +4 -4
  34. package/docs/.vuepress/public/logo.png +0 -0
  35. package/docs/README.md +5 -3
  36. package/docs/changelog/README.md +9 -5
  37. package/docs/contribute/README.md +1 -1
  38. package/docs/guide/README.md +12 -10
  39. package/docs/images/logo copy.png +0 -0
  40. package/docs/images/logo.png +0 -0
  41. package/docs/images/logo.psd +0 -0
  42. package/docs/images/node-red-icon-2.svg +30 -0
  43. package/docs/nodes/old-power-saver-doc.md +6 -6
  44. package/docs/nodes/ps-receive-price.md +5 -5
  45. package/docs/nodes/ps-strategy-best-save.md +5 -1
  46. package/docs/nodes/ps-strategy-lowest-price.md +3 -3
  47. package/docs/nodes/strategy-input.md +1 -1
  48. package/package.json +1 -1
  49. package/src/elvia/elvia-add-tariff.js +7 -6
  50. package/test/elvia.test.js +16 -2
  51. package/docs/.vuepress/dist/assets/js/app.190d977f.js +0 -1
  52. package/docs/.vuepress/dist/assets/js/runtime~app.36bc5048.js +0 -1
  53. package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.d008d8bc.js +0 -1
  54. package/docs/.vuepress/dist/assets/js/v-4637f9e4.22ab9413.js +0 -1
  55. package/docs/.vuepress/dist/assets/js/v-510ed0d4.01d07aab.js +0 -1
  56. package/docs/.vuepress/dist/assets/js/v-5954bcb2.be07962c.js +0 -1
  57. package/docs/.vuepress/dist/assets/js/v-61f728ca.802ab15e.js +0 -1
  58. package/docs/.vuepress/dist/assets/js/v-677dfaed.9bbbd037.js +0 -1
  59. package/docs/.vuepress/dist/assets/js/v-8daa1a0e.db8b59c6.js +0 -1
  60. package/docs/.vuepress/dist/assets/js/v-b4a42144.6e0c5aa0.js +0 -1
  61. package/docs/.vuepress/dist/assets/js/v-fffb8e28.e815e852.js +0 -1
@@ -6,6 +6,10 @@ sidebar: "auto"
6
6
 
7
7
  List the most significant changes, starting in version 1.0.9.
8
8
 
9
+ ## 3.0.10
10
+
11
+ - Fix bug in ps-elvia-add-tariff so it connects to API.
12
+
9
13
  ## 3.0.9
10
14
 
11
15
  - Fix Nord Pool input for current state node, to read data when payload is set to entity.
@@ -21,7 +25,7 @@ List the most significant changes, starting in version 1.0.9.
21
25
 
22
26
  ## 3.0.6
23
27
 
24
- - Remove non-existant node from package.json.
28
+ - Remove non-existent node from package.json.
25
29
 
26
30
  ## 3.0.5
27
31
 
@@ -29,7 +33,7 @@ List the most significant changes, starting in version 1.0.9.
29
33
 
30
34
  ## 3.0.4
31
35
 
32
- - Remove `null`-values from Nordpool data for `tomorrow`.
36
+ - Remove `null`-values from Nord Pool data for `tomorrow`.
33
37
 
34
38
  ## 3.0.3
35
39
 
@@ -43,7 +47,7 @@ List the most significant changes, starting in version 1.0.9.
43
47
 
44
48
  ## 3.0.1
45
49
 
46
- - Fix so elvia subscripion key is stored as credential
50
+ - Fix so elvia subscription key is stored as credential
47
51
  - Fix bug on config for strategy nodes. Config was not saved properly.
48
52
  - Remove double output bug, and better handling when hoursOn > period
49
53
 
@@ -53,7 +57,7 @@ List the most significant changes, starting in version 1.0.9.
53
57
  - New node `ps-strategy-best-save` is replacing old node `Power Saver` together with the new `ps-receive-price` node.
54
58
  - Add new strategy node: `ps-strategy-lowest-price`.
55
59
  - Add new node: `ps-receive-price`.
56
- - Add gridd tariff for Elvia customers, using the `ps-elvia-add-tariff` node.
60
+ - Add grid tariff for Elvia customers, using the `ps-elvia-add-tariff` node.
57
61
  - New documentation.
58
62
  - Change node category to Power Saver.
59
63
 
@@ -77,7 +81,7 @@ List the most significant changes, starting in version 1.0.9.
77
81
 
78
82
  ## 2.0.2
79
83
 
80
- - Fix so Nordpool data can be read directly from the current state node
84
+ - Fix so Nord Pool data can be read directly from the current state node
81
85
 
82
86
  ## 2.0.1
83
87
 
@@ -32,7 +32,7 @@ It would be very nice to get more examples into the documentation. If you have m
32
32
 
33
33
  ## Bug reports
34
34
 
35
- If you find a bug, please describe it thouroghly and make a [GitHub issue](https://github.com/ottopaulsen/node-red-contrib-power-saver/issues). If the bug is related to the scheduling, **please provide the full output from output 3** on the strategy node.
35
+ If you find a bug, please describe it thoroughly and make a [GitHub issue](https://github.com/ottopaulsen/node-red-contrib-power-saver/issues). If the bug is related to the scheduling, **please provide the full output from output 3** on the strategy node.
36
36
 
37
37
  ## Ideas
38
38
 
@@ -6,8 +6,10 @@ sidebar: "auto"
6
6
 
7
7
  ## Introduction
8
8
 
9
- This is a collection of nodes you can use to save money on variable power prices. The solution can be used to control switches or other entities in a smart home system, and for example turn on when the price is low, and turn off when the price is high.
10
- There are different ways to calculate what hours to turn on and off, and these are impemented as **strategies nodes**. Each stragety node can be configured to fit different purposes.
9
+ This is a collection of nodes for the popular [Node-RED](https://nodered.org/) that you can use to save money on variable electricity prices. Node-RED is a widely used low-code programming tool that can be used together with many smart home solutions to create automations.
10
+
11
+ The solution can be used to control switches or other entities in a smart home system, and for example turn on when the price is low, and turn off when the price is high.
12
+ There are different ways to calculate what hours to turn on and off, and these are implemented as **strategies nodes**. Each strategy node can be configured to fit different purposes.
11
13
 
12
14
  The strategies need price data to work. These can be received from different sources, for example Tibber, Nord Pool or custom sources.
13
15
 
@@ -23,7 +25,7 @@ Example:
23
25
 
24
26
  ![Example flow](../images/example-flow-1.png)
25
27
 
26
- Here prices are received from Tibber, converted in the `ps-receive-price` node, then gridd tariff for Elvia is added before sent to the `ps-strategy-best-save` node. Output is sent to Home Assistant via two `call-service` nodes, and the schedule is sent to a debug node.
28
+ Here prices are received from Tibber, converted in the `ps-receive-price` node, then grid tariff for Elvia is added before sent to the `ps-strategy-best-save` node. Output is sent to Home Assistant via two `call-service` nodes, and the schedule is sent to a debug node.
27
29
 
28
30
  ::: tip Home Assistant
29
31
  The node collection fits very well with Home Assistant (HA), as Node-RED is frequently used for automations, and there also is an integration with Nord Pool, but there is no direct dependency to HA, so all nodes can be used also without HA.
@@ -48,7 +50,7 @@ This solution is useless without price data. In the nordics, there are at least
48
50
  - Tibber
49
51
  - Nord Pool
50
52
 
51
- The `ps-receive-price` node is designed to handle price input frome both these, and convert it to the format required by the strategy nodes.
53
+ The `ps-receive-price` node is designed to handle price input from both these, and convert it to the format required by the strategy nodes.
52
54
 
53
55
  If you are a Tibber customer, use the `tibber-query` node from the [Tibber API](https://flows.nodered.org/node/node-red-contrib-tibber-api) to receive price, with one of the following queries:
54
56
 
@@ -75,7 +77,7 @@ If you are a Tibber customer, use the `tibber-query` node from the [Tibber API](
75
77
 
76
78
  </CodeGroupItem>
77
79
 
78
- <CodeGroupItem title="Singel home" active>
80
+ <CodeGroupItem title="Single home" active>
79
81
 
80
82
  ```gql{3}
81
83
  {
@@ -120,15 +122,15 @@ If you use Home Assistant (HA), you can install the
120
122
  that provides a _sensor_ that gives price per hour for today and tomorrow.
121
123
  Data can be sent from both the `current state` node or the `events: state` node.
122
124
 
123
- [See example with Nordpool and `current state` node](../images/example-nordpool-current-state.md)
125
+ [See example with Nord Pool and `current state` node](../examples/example-nordpool-current-state.md)
124
126
 
125
- [See example with Nordpool and `events: state` node](../images/example-nordpool-events-state.md)
127
+ [See example with Nord Pool and `events: state` node](../examples/example-nordpool-events-state.md)
126
128
 
127
129
  ### Add grid tariff
128
130
 
129
131
  When also the grid tariff changes per hour, it must be added to the electricity price in order to get the calculations right.
130
132
 
131
- After the the `ps-receive-price` node, add a `ps-xxx-add-tariff` node to add grid tariff. What node to choose depends on what grid you get electricity through. The followinggrids are supported:
133
+ After the the `ps-receive-price` node, add a `ps-xxx-add-tariff` node to add grid tariff. What node to choose depends on what grid you get electricity through. The following grids are supported:
132
134
 
133
135
  | Grid supplier | Node |
134
136
  | ------------- | --------------------- |
@@ -178,14 +180,14 @@ Example using Home Assistant:
178
180
  There are many ways you can use the output:
179
181
 
180
182
  - Turn on/off a switch
181
- - Set a termostat up, down or to specific values
183
+ - Set a thermostat up, down or to specific values
182
184
  - Change setting of a dimmer
183
185
  - Send a notification
184
186
  :::
185
187
 
186
188
  ### Display schedule
187
189
 
188
- **Output 3** can be used to print or dispay the calculated schedule. If you just want to see it, send it to a debug node. You can also use it to display the result as graphs in HA.
190
+ **Output 3** can be used to print or display the calculated schedule. If you just want to see it, send it to a debug node. You can also use it to display the result as graphs in HA.
189
191
 
190
192
  For users of Magic Mirror and Tibber, the `ps-best-save` node can send its schedule to the MMM-Tibber module. See more details in the `ps-best-save` node documentation.
191
193
 
Binary file
Binary file
Binary file
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+ <svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="512" width="512" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 511.99999 511.99999">
4
+ <metadata>
5
+ <rdf:RDF>
6
+ <cc:Work rdf:about="">
7
+ <dc:format>image/svg+xml</dc:format>
8
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
9
+ <dc:title/>
10
+ </cc:Work>
11
+ </rdf:RDF>
12
+ </metadata>
13
+ <g transform="translate(0 -540.36)">
14
+ <rect style="color:#000000" height="392" width="512" y="540.36" x=".000013828" fill="#8f0000"/>
15
+ <rect ry="0" height="108.23" width="500.23" stroke="#fff" y="938.25" x="5.886" stroke-width="11.772" fill="#fff"/>
16
+ <g transform="matrix(4 0 0 4 -162 -450.91)">
17
+ <path style="color-rendering:auto;text-decoration-color:#000000;color:#000000;isolation:auto;mix-blend-mode:normal;shape-rendering:auto;solid-color:#000000;block-progression:tb;text-decoration-line:none;image-rendering:auto;white-space:normal;text-indent:0;text-transform:none;text-decoration-style:solid" d="m122.88 305.82c-2.3846 0-4.3789 2.0376-4.3789 4.4222v0.77344c-2.2304 0.10995-4.0388 0.5467-5.3281 1.4316-1.5951 1.0948-2.4675 2.582-3.1816 3.877-0.71415 1.295-1.2996 2.4093-2.1504 3.1894-0.72545 0.66525-1.7997 1.1216-3.4512 1.3301-0.21359-2.192-2.0615-3.9512-4.3052-3.9512h-17.167c-2.3846 0-4.4165 1.965-4.4165 4.3496v4.2422c0 2.3846 2.0319 4.3516 4.4165 4.3516h17.167c2.3846 0 4.3872-1.9669 4.3872-4.3516v-1.6133c9.7257 0.15307 12.467 2.6032 15.594 5.3379 3.0006 2.6241 6.6658 5.3789 15.436 5.4948v0.73633c0 2.3846 2.0695 4.3799 4.4541 4.3799h17.092c2.3846 0 4.4541-1.9952 4.4541-4.3799v-4.2422c0-2.3846-2.0695-4.3779-4.4541-4.3779h-17.092c-2.3846 0-4.4541 1.9933-4.4541 4.3779v0.58594c-8.0984-0.0599-10.486-2.1557-13.498-4.7897-2.5035-2.1893-5.6398-4.5852-11.947-5.5859 1.176-1.1795 1.8834-2.5192 2.5137-3.6621 0.67724-1.228 1.2899-2.2006 2.2695-2.873 0.76303-0.52371 1.9757-0.83922 3.6621-0.93945v0.55078c0 2.3846 1.9943 4.3356 4.3789 4.3356h17.242c2.3846 0 4.3789-1.951 4.3789-4.3356v-4.2422c0-2.3846-1.9943-4.4222-4.3789-4.4222zm0 3h17.242c0.80513 0 1.3789 0.6171 1.3789 1.4222v4.2422c0 0.80514-0.57378 1.3356-1.3789 1.3356h-17.242c-0.80513 0-1.3789-0.53045-1.3789-1.3356v-4.2422c0-0.80513 0.57378-1.4222 1.3789-1.4222zm-39.962 11.016h17.167c0.80513 0 1.4165 0.60112 1.4165 1.4062v4.2422c0 0.80513-0.61138 1.4082-1.4165 1.4082h-17.167c-0.80513 0-1.4165-0.60307-1.4165-1.4082v-4.2422c0-0.80513 0.61137-1.4062 1.4165-1.4062zm57.038 9.984h17.092c0.80513 0 1.4541 0.5728 1.4541 1.3779v4.168c0 0.80513-0.64898 1.4541-1.4541 1.4541h-17.092c-0.80513 0-1.4541-0.64897-1.4541-1.4541v-4.168c0-0.80513 0.64897-1.3779 1.4541-1.3779z" fill="#fff"/>
18
+ </g>
19
+ <g transform="matrix(1.0024 0 0 1.0024 .26914 -2.6855)" fill="#8f0000">
20
+ <path d="m90.51 954.73v8.4388l-7.9801 1.4384v59.934h-13.931l-28.465-46.989-0.49878 0.048v37.111l7.9805 1.4384v8.3908h-28.929v-8.3908l7.4319-1.4384v-50.105l-7.4319-1.4384v-8.4388h7.4319 14.001l28.302 46.989 0.14384-0.048v-37.063l-6.983-1.4384v-8.4388h20.971 7.9586z"/>
21
+ <path d="m94.501 998.12q0-11.603 6.4729-18.987 6.5209-7.4319 17.98-7.4319 11.507 0 17.98 7.3839 6.5209 7.3839 6.5209 19.035v1.0069q0 11.699-6.5209 19.083-6.4729 7.3359-17.884 7.3359-11.555 0-18.076-7.3359-6.4729-7.384-6.4729-19.083v-1.0069zm14.001 1.0069q0 7.0963 2.4933 11.411 2.4933 4.2674 8.0552 4.2674 5.4181 0 7.9114-4.3153 2.5412-4.3153 2.5412-11.364v-1.0069q0-6.9044-2.5412-11.268-2.5412-4.3632-8.0072-4.3632t-7.9593 4.3632-2.4933 11.268v1.0069z"/>
22
+ <path d="m183.77 1018.2c-1.6302 2.3973-3.5641 4.2193-5.8017 5.466-2.2056 1.2466-4.7308 1.8797-7.5757 1.8797-6.393 0-11.364-2.3432-14.912-7.0101-3.5161-4.6669-5.1162-10.836-5.1162-18.508v-1.0069c0-8.1833 1.6161-14.784 5.1642-19.802 3.5481-5.0185 8.5348-7.5278 14.96-7.5278 2.5892 0 4.9226 0.57537 7.0003 1.7261 2.0777 1.1188 4.2289 2.7171 5.7952 4.7948v-18.604l-7.9806-1.4384v-8.4388h7.6513 14.295v64.969l5.9854 1.4384v8.4102h-18.41l-1.0548-6.3484zm-19.44-18.172c0 4.5391 0.62786 8.1191 2.1302 10.74 1.5343 2.5891 4.0276 3.8837 7.4798 3.8837 2.0457 0 3.8198-0.4155 5.3222-1.2466 1.5023-0.8311 3.0626-2.0298 4.0216-3.5961v-22.008c-0.95893-1.6622-2.5192-2.9408-4.0216-3.8358-1.4704-0.927-3.2125-1.3905-5.2263-1.3905-3.4203 0-5.9135 1.5183-7.4798 4.555s-2.2261 7.0003-2.2261 11.891v1.0069z"/>
23
+ <path d="m232.87 1025.5c-7.48 0-13.457-2.3974-17.932-7.1921-4.4751-4.7947-6.7127-10.884-6.7127-18.268v-1.9179c0-7.7033 2.1097-14.048 6.3291-19.035 4.2513-4.9865 9.941-7.4419 17.069-7.41 7.0007 0 12.435 2.0878 16.302 6.3072 3.8678 4.2194 6.4539 9.93 6.188 17.117v7.5004h-31.36l-0.0959 0.4109c0.25573 3.4203 1.3905 6.2332 3.4043 8.4388 2.0457 2.2056 4.8107 3.3084 8.2949 3.3084 3.1006 0 5.6738-0.3037 7.7196-0.911 2.0457-0.6393 4.2833-1.6303 6.7127-2.9728l3.7879 8.6306c-2.1417 1.6941-4.9226 3.1166-8.3429 4.2673-3.3883 1.1507-7.1763 1.7261-11.364 1.7261zm-1.2466-43.057c-2.5892 0-4.635 0.99093-6.1373 2.9728s-2.4293 4.587-2.781 7.8154l0.14385 0.39233h17.299v-1.3992c0-2.9727-0.83677-5.3381-2.2432-7.0962-1.3745-1.7901-3.4682-2.6851-6.2811-2.6851z"/>
24
+ <path d="m291.02 1000.6h-26.934v-10.973h26.934z"/>
25
+ <path d="m330.82 954.73c7.9273 0 14.145 1.822 18.652 5.466 4.5071 3.6121 6.3914 8.6152 6.3914 15.008 0 3.5161-0.57382 6.5684-2.4598 9.1576-1.8859 2.5892-4.6509 4.6829-8.2949 6.2811 4.1235 1.2147 7.0802 3.2445 8.8703 6.0894 1.822 2.8129 2.8819 6.3133 2.8819 10.501v3.5481c0 1.5343 0.15475 2.733 0.76208 3.5961 0.60734 0.8311 1.6142 1.3265 3.0207 1.4863l1.2051 0.2398v8.4387h-6.7191c-4.571 0-7.7835-1.2306-9.6375-3.6919s-2.5972-5.6419-2.5972-9.5416v-3.9796c0-3.3883-1.0948-6.0414-2.9168-7.9593-1.7901-1.9499-4.3313-2.9727-7.6237-3.0686h-11.406v18.412l6.9825 1.4384v8.3908h-28.929v-8.3908l7.9805-1.4384v-50.105l-7.9805-1.4384v-8.4388h7.8932 23.926zm-9.9252 30.782h9.6854c3.8997 0 6.8245-0.8311 8.7744-2.4933s2.9248-4.0596 2.9248-7.1921c0-3.1326-0.97493-5.6259-2.9248-7.4798-1.9179-1.8859-4.7628-2.8289-8.5347-2.8289h-9.8718v19.994z"/>
26
+ <path d="m411.73 993.62h-22.944v19.951h22.163l0.62332-7.9805h10.181v18.942h-54.914v-8.3908l7.9806-1.4384v-50.105l-7.9806-1.4384v-8.4451h7.5735 47.245v18.954h-10.277l-0.62332-7.9806h-21.972v16.959h22.944v10.973z"/>
27
+ <path d="m461.1 954.75c8.5347 0 15.567 2.7087 21.097 8.1747 5.5299 5.4341 8.3382 12.392 8.3382 20.927v11.555c0 8.5667-2.8082 15.593-8.3382 21.027-5.5299 5.4021-12.562 8.1031-21.097 8.1031h-31.416v-8.3908l6.983-1.5117v-50.105l-6.983-1.3652v-8.4145l7.4424-0.0733 23.974 0.0754zm-10.468 10.737v48.283l9.7484 0.026c5.0185 0.013 8.9502-1.6942 11.795-5.0825 2.8449-3.3883 4.3934-7.7938 4.3934-13.26v-11.651c0-5.4021-1.5486-9.8189-4.3934-13.207-2.8449-3.3883-6.7765-5.0824-11.795-5.0824l-9.7484-0.0262z"/>
28
+ </g>
29
+ </g>
30
+ </svg>
@@ -10,7 +10,7 @@ You can use it to control for example a heater, a water heater or any other powe
10
10
 
11
11
  The node takes power prices per hour as input, and sends output to turn a switch on or off based on the power price. It also outputs the schedule that is planned, as well as how much you save per kWh for each of the hours that are turned off, assuming that the same power is used as soon as the power is turned on.
12
12
 
13
- Power prices may be received from Tibber, Nordpool or any other source that gives price per hour for today and optionally tomorrow. It is primarily made to be used together with Home Assistant (HA), but there is no dependency to HA, so it can just as well be used by itself.
13
+ Power prices may be received from Tibber, Nord Pool or any other source that gives price per hour for today and optionally tomorrow. It is primarily made to be used together with Home Assistant (HA), but there is no dependency to HA, so it can just as well be used by itself.
14
14
 
15
15
  The node can also be used in combination with MagicMirror with the MMM-MQTT and MMM-Tibber modules, in order to get the savings displayed on the MM screen in the MMM-Tibber module.
16
16
 
@@ -38,7 +38,7 @@ Make sure that you upgrade now and then to get the latest version. See [changelo
38
38
  - Nordpool
39
39
  - Other sources in a specific JSON format
40
40
 
41
- Choose the one that fits you best. Of course, all inputs are JSON, but the Tibber and Nordpool alternatives are designed to connect directly to those sources with a minimum effort.
41
+ Choose the one that fits you best. Of course, all inputs are JSON, but the Tibber and Nord Pool alternatives are designed to connect directly to those sources with a minimum effort.
42
42
 
43
43
  From version 2.1.0, you can also send a config object as input for dynamically changing the node config.
44
44
 
@@ -73,17 +73,17 @@ Send the result from the `tibber-query` node with the query above directly to th
73
73
 
74
74
  ### Nordpool input
75
75
 
76
- This is especially designed to work for Home Assistant (HA), and the [Nordpool custom component](https://github.com/custom-components/nordpool). The Nordpool component provides a _sensor_ that gives price per hour for today and tomorrow (after 13:00). Send the output from this sensor directly to the `power-saver` node. Make sure this is done whenever the node is updated, as well as when the system starts up.
76
+ This is especially designed to work for Home Assistant (HA), and the [Nord Pool custom component](https://github.com/custom-components/nordpool). The Nord Pool component provides a _sensor_ that gives price per hour for today and tomorrow (after 13:00). Send the output from this sensor directly to the `power-saver` node. Make sure this is done whenever the node is updated, as well as when the system starts up.
77
77
 
78
78
  Data can be sent from both the `current state` node or the `events: state` node.
79
79
 
80
- [See example with Nordpool and `current state` node](doc/example-nordpool-current-state.md)
80
+ [See example with Nord Pool and `current state` node](doc/example-nordpool-current-state.md)
81
81
 
82
- [See example with Nordpool and `events: state` node](doc/example-nordpool-events-state.md)
82
+ [See example with Nord Pool and `events: state` node](doc/example-nordpool-events-state.md)
83
83
 
84
84
  ### Other input
85
85
 
86
- If you cannot use any of the two above (Tibber or Nordpool), create the input to the node with the payload containing JSON like this:
86
+ If you cannot use any of the two above (Tibber or Nord Pool), create the input to the node with the payload containing JSON like this:
87
87
 
88
88
  ```json
89
89
  {
@@ -55,11 +55,11 @@ If you are a Tibber customer, you can use the `tibber-query` node from the [`nod
55
55
 
56
56
  Send the result from the `tibber-query` node with the query above directly to the `ps-receive-price` node. Make sure it is refreshed when new prices are ready. Prices for the next day are normally ready at 13:00, but refreshing every hour can be a good idea.
57
57
 
58
- [See example with Tibber, a switch and MQTT](doc/example-tibber-mqtt.md)
58
+ [See example with Tibber, a switch and MQTT](../examples/example-tibber-mqtt.md)
59
59
 
60
60
  ::: danger Warning
61
61
  The query above returns an array with all houses you have in your Tibber account.
62
- It willl work only if the house you want is the first house in the array, for example if you have only one house.
62
+ It will work only if the house you want is the first house in the array, for example if you have only one house.
63
63
  If that is not the case, you must use the query below.
64
64
  :::
65
65
 
@@ -67,7 +67,7 @@ If that is not the case, you must use the query below.
67
67
 
68
68
  If the above query does not give you the house you want as the first in the result array, you can use the following method. In this method you need run one query in order to find the id of the house you want the prices for first, and then use the id in the real query.
69
69
 
70
- Go to the [Tibber Deeloper pages](https://developer.tibber.com/), sign in, and go to the [API Explorer](https://developer.tibber.com/explorer). Load your personal token, then run the following query:
70
+ Go to the [Tibber Developer pages](https://developer.tibber.com/), sign in, and go to the [API Explorer](https://developer.tibber.com/explorer). Load your personal token, then run the following query:
71
71
 
72
72
  ```gql
73
73
  {
@@ -129,9 +129,9 @@ Data can be sent from both the `current state` node or the `events: state` node.
129
129
  When using the `current state` node, configure the output properties to set `msg.payload` to `entity`.
130
130
  :::
131
131
 
132
- [See example with Nord Pool and `current state` node](doc/example-nordpool-current-state.md)
132
+ [See example with Nord Pool and `current state` node](../examples/example-nordpool-current-state.md)
133
133
 
134
- [See example with Nord Pool and `events: state` node](doc/example-nordpool-events-state.md)
134
+ [See example with Nord Pool and `events: state` node](../examples/example-nordpool-events-state.md)
135
135
 
136
136
  ### Other input
137
137
 
@@ -12,7 +12,7 @@ The picture at the bottom of the page, under [Integration with MagicMirror](#int
12
12
 
13
13
  ## Configuration
14
14
 
15
- ![Best Save Config](/best-save-config.png)
15
+ ![Best Save Config](../images/best-save-config.png)
16
16
 
17
17
  | Value | Description |
18
18
  | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -27,6 +27,10 @@ The picture at the bottom of the page, under [Integration with MagicMirror](#int
27
27
  NB! The `Min recover` only has effect if the previous save-period is of length `Max per sequence`. If the save-period is shorter, the following on-period may be as short as one hour.
28
28
  :::
29
29
 
30
+ ::: tip Legionella
31
+ Many people ask if there is a danger that legionella bacteria will grow and become dangerous when the temperature of the water heater is lowered. As long as the water is heated to at least 65 °C every day, or at least every week, the risk of infection is not considered significant, according to the norwegian [FHI](https://www.fhi.no/nettpub/legionellaveilederen/).
32
+ :::
33
+
30
34
  ### Dynamic config
31
35
 
32
36
  It is possible to change config dynamically by sending a config message to the node. The config messages has a payload with a config object like this example:
@@ -10,11 +10,11 @@ Strategy node to turn on power the hours when the price is lowest during a given
10
10
 
11
11
  ## Description
12
12
 
13
- The node can work on a specific period from 1 to 24 hours during a 24 hour period. Inside this period, you can decide how many hours that shall be on. The rest of the period will be off. Outside the peiod, you can select that the output shall be either on or off. You can also decide that the hours on shall be consequtive (one continuous period) or spread around in multiple on-periods.
13
+ The node can work on a specific period from 1 to 24 hours during a 24 hour period. Inside this period, you can decide how many hours that shall be on. The rest of the period will be off. Outside the period, you can select that the output shall be either on or off. You can also decide that the hours on shall be consecutive (one continuous period) or spread around in multiple on-periods.
14
14
 
15
15
  ## Configuration
16
16
 
17
- ![Node Configuration](/lowest-price-config.png)
17
+ ![Node Configuration](../images/lowest-price-config.png)
18
18
 
19
19
  | Value | Description |
20
20
  | ---------------------- | -------------------------------------------------------------------------------- |
@@ -26,7 +26,7 @@ The node can work on a specific period from 1 to 24 hours during a 24 hour perio
26
26
  | If No Schedule, Send | What to do if there is no valid schedule any more (turn on or off). |
27
27
  | Outside Period, Send | Select the value to send outside the selected period. |
28
28
 
29
- If you want to use a period of 24 hours, set the From Time and To Time to the same value. The time you select is signficant in the way that it decides which 24 hours that are considered when finding the hours with lowest price.
29
+ If you want to use a period of 24 hours, set the From Time and To Time to the same value. The time you select is significant in the way that it decides which 24 hours that are considered when finding the hours with lowest price.
30
30
 
31
31
  ::: tip Example with Consecutive On-Period
32
32
  One example to need a consecutive on-period can be if you want to control the washing machine. Let's say it needs 3 hours, and you want it to run between 22:00 and 06:00. Set `From Time = 22:00`, `To Time = 06:00` and check the `Consecutive On-Period` flag. This will turn on the cheapest 3-hour period from 22:00 to 06:00.
@@ -1,6 +1,6 @@
1
1
  # Strategy input format
2
2
 
3
- The common input for strategy nodes is a payload with a `priceData` array containing an object for each hour. Each object has a `value` wich is the price, and a `start` wich is the start time for the hour.
3
+ The common input for strategy nodes is a payload with a `priceData` array containing an object for each hour. Each object has a `value` which is the price, and a `start` which is the start time for the hour.
4
4
 
5
5
  Example:
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-power-saver",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "A module for Node-RED that you can use to turn on and off a switch based on power prices",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -6,25 +6,26 @@ module.exports = function (RED) {
6
6
  function PsElviaAddTariffNode(config) {
7
7
  RED.nodes.createNode(this, config);
8
8
  this.elviaConfig = RED.nodes.getNode(config.elviaConfig);
9
+ const key = this.elviaConfig.credentials.elviaSubscriptionKey;
9
10
  this.tariffKey = config.tariffKey;
10
11
  this.range = config.range;
11
12
  const node = this;
12
-
13
- const configList = node.context().global.get("elviaConfigList") || [];
14
- const key = configList.find((c) => c.id == node.elviaConfig.id)?.elviaSubscriptionKey;
15
13
  ping(node, key);
16
14
 
17
15
  node.on("input", function (msg) {
18
16
  const prices = msg.payload.priceData;
17
+ if (!prices) {
18
+ node.warn(
19
+ "No price data received on input. Did you use the ps-receive-price node or convert to correct format otherwise?"
20
+ );
21
+ return;
22
+ }
19
23
  const fromTime = prices[0].start.substr(0, 19);
20
24
  const toTime = DateTime.fromISO(prices[prices.length - 1].start)
21
25
  .plus({ hours: 1 })
22
26
  .toISO()
23
27
  .substr(0, 19);
24
28
 
25
- const configList = node.context().global.get("elviaConfigList") || [];
26
- const key = configList.find((c) => c.id == node.elviaConfig.id)?.elviaSubscriptionKey;
27
-
28
29
  getTariffForPeriod(node, key, node.tariffKey, fromTime, toTime).then((json) => {
29
30
  const tariff = json;
30
31
  const priceInfo = tariff.gridTariff.tariffPrice.priceInfo;
@@ -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 = [{ id: "n1", type: "ps-elvia-add-tariff", name: "test name" }];
20
- helper.load(elviaAddTariff, flow, function () {
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();
@@ -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,727)))),"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:[["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()}]);
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e,r,a,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e].call(a.exports,a,a.exports,n),a.exports}n.m=t,e=[],n.O=(r,a,t,o)=>{if(!a){var d=1/0;for(v=0;v<e.length;v++){for(var[a,t,o]=e[v],i=!0,c=0;c<a.length;c++)(!1&o||d>=o)&&Object.keys(n.O).every((e=>n.O[e](a[c])))?a.splice(c--,1):(i=!1,o<d&&(d=o));if(i){e.splice(v--,1);var s=t();void 0!==s&&(r=s)}}return r}o=o||0;for(var v=e.length;v>0&&e[v-1][2]>o;v--)e[v]=e[v-1];e[v]=[a,t,o]},n.d=(e,r)=>{for(var a in r)n.o(r,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,a)=>(n.f[a](e,r),r)),[])),n.u=e=>"assets/js/"+({22:"v-1ad821fa",27:"v-0aca7ba6",88:"v-3706649a",283:"v-61f728ca",317:"v-5954bcb2",332:"v-08683c60",363:"v-0b5e3c8c",407:"v-b4a42144",418:"v-4637f9e4",495:"v-510ed0d4",509:"v-8daa1a0e",625:"v-5db8da3a",651:"v-e8c55052",745:"v-677dfaed",807:"v-fffb8e28",889:"v-7c87f26e",901:"v-30acb564"}[e]||e)+"."+{22:"85407071",27:"aec5ba75",88:"d7f73384",283:"802ab15e",293:"5e967839",317:"be07962c",332:"07fe8291",363:"d008d8bc",407:"6e0c5aa0",418:"22ab9413",491:"c183eba3",495:"01d07aab",509:"db8b59c6",625:"ac192f35",651:"5f85b6cd",745:"9bbbd037",807:"e815e852",889:"457a1a60",901:"73b8e29f"}[e]+".js",n.miniCssF=e=>{},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},a="node-red-contrib-power-saver:",n.l=(e,t,o,d)=>{if(r[e])r[e].push(t);else{var i,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),v=0;v<s.length;v++){var b=s[v];if(b.getAttribute("src")==e||b.getAttribute("data-webpack")==a+o){i=b;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,n.nc&&i.setAttribute("nonce",n.nc),i.setAttribute("data-webpack",a+o),i.src=e),r[e]=[t];var l=(a,t)=>{i.onerror=i.onload=null,clearTimeout(f);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(t))),a)return a(t)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/node-red-contrib-power-saver/",(()=>{var e={523:0,460:0};n.f.j=(r,a)=>{var t=n.o(e,r)?e[r]:void 0;if(0!==t)if(t)a.push(t[2]);else if(/^(460|523)$/.test(r))e[r]=0;else{var o=new Promise(((a,o)=>t=e[r]=[a,o]));a.push(t[2]=o);var d=n.p+n.u(r),i=new Error;n.l(d,(a=>{if(n.o(e,r)&&(0!==(t=e[r])&&(e[r]=void 0),t)){var o=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+d+")",i.name="ChunkLoadError",i.type=o,i.request=d,t[1](i)}}),"chunk-"+r,r)}},n.O.j=r=>0===e[r];var r=(r,a)=>{var t,o,[d,i,c]=a,s=0;if(d.some((r=>0!==e[r]))){for(t in i)n.o(i,t)&&(n.m[t]=i[t]);if(c)var v=c(n)}for(r&&r(a);s<d.length;s++)o=d[s],n.o(e,o)&&e[o]&&e[o][0](),e[d[s]]=0;return n.O(v)},a=self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[];a.forEach(r.bind(null,0)),a.push=r.bind(null,a.push.bind(a))})()})();
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[363],{3594:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-0b5e3c8c",path:"/nodes/ps-strategy-best-save.html",title:"ps-strategy-best-save",lang:"en-US",frontmatter:{},excerpt:"",headers:[{level:2,title:"Description",slug:"description",children:[]},{level:2,title:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Input",slug:"input",children:[]},{level:2,title:"Output",slug:"output",children:[{level:3,title:"Output 1",slug:"output-1",children:[]},{level:3,title:"Output 2",slug:"output-2",children:[]},{level:3,title:"Output 3",slug:"output-3",children:[]}]},{level:2,title:"Algorithm",slug:"algorithm",children:[]},{level:2,title:"Integration with MagicMirror",slug:"integration-with-magicmirror",children:[]}],filePathRelative:"nodes/ps-strategy-best-save.md",git:{updatedTime:1639315027e3,contributors:[{name:"Otto Paulsen",email:"ottpau@gmail.com",commits:1}]}}},6112:(e,n,s)=>{s.r(n),s.d(n,{default:()=>ae});var a=s(6252),t=s(7188);const o=(0,a._)("h1",{id:"ps-strategy-best-save",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#ps-strategy-best-save","aria-hidden":"true"},"#"),(0,a.Uk)(" ps-strategy-best-save")],-1),r=(0,a._)("p",null,[(0,a._)("img",{src:t,alt:"ps-strategy-best-save"})],-1),l=(0,a._)("p",null,"Strategy node to postpone power consumption until the price is lower.",-1),i=(0,a._)("h2",{id:"description",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),(0,a.Uk)(" Description")],-1),u=(0,a._)("p",null,"This strategy turns off the hours where the price difference is largest compared to the next hour that is on. The idea is that the power you are not using when the switch is turned off, will be used immediately when the switch is turned on. This would fit well for turning off a water heater or another thermostat controlled heater.",-1),p=(0,a._)("p",null,[(0,a.Uk)("The picture at the bottom of the page, under "),(0,a._)("a",{href:"#integration-with-magicmirror"},"Integration with MagicMirror"),(0,a.Uk)(", illustrates this by the purple strokes, taking the price from the top of the price curve to the level of the first hour after the save-period.")],-1),c=(0,a._)("h2",{id:"configuration",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#configuration","aria-hidden":"true"},"#"),(0,a.Uk)(" Configuration")],-1),_=(0,a._)("p",null,[(0,a._)("img",{src:"/best-save-config.png",alt:"Best Save Config"})],-1),h=(0,a._)("table",null,[(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Value"),(0,a._)("th",null,"Description")])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,"Max per sequence"),(0,a._)("td",null,"Maximum number of hours to turn off in a sequence.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Min recover"),(0,a._)("td",null,"Minimum hours to turn on immediately after a period when turned off the maximum number of hours that is allowed to be turned off")]),(0,a._)("tr",null,[(0,a._)("td",null,"Min saving"),(0,a._)("td",null,"Minimum amount to save per kWh in order to bother turning it off. It is recommended to have some amount here, e.g. 2 cents / 2 øre. No point in saving 0.001, is it?")]),(0,a._)("tr",null,[(0,a._)("td",null,"Schedule for"),(0,a._)("td",null,"Select to schedule for the whole data set or only from the current hour.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Send when rescheduling"),(0,a._)("td",null,"Check this to make sure on or off output is sent immediately after rescheduling")]),(0,a._)("tr",null,[(0,a._)("td",null,"If no schedule, send"),(0,a._)("td",null,"What to do if there is no valid schedule any more (turn on or off).")])])],-1),k=(0,a._)("div",{class:"custom-container warning"},[(0,a._)("p",{class:"custom-container-title"},"Min recover"),(0,a._)("p",null,[(0,a.Uk)("NB! The "),(0,a._)("code",null,"Min recover"),(0,a.Uk)(" only has effect if the previous save-period is of length "),(0,a._)("code",null,"Max per sequence"),(0,a.Uk)(". If the save-period is shorter, the following on-period may be as short as one hour.")])],-1),d=(0,a._)("h3",{id:"dynamic-config",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#dynamic-config","aria-hidden":"true"},"#"),(0,a.Uk)(" Dynamic config")],-1),b=(0,a._)("p",null,"It is possible to change config dynamically by sending a config message to the node. The config messages has a payload with a config object like this example:",-1),m=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token property"},'"payload"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"maxHoursToSaveInSequence"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"4"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minHoursOnAfterMaxSequenceSaved"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"2"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minSaving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.02"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"scheduleOnlyFromCurrentTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br")])],-1),g=(0,a._)("p",null,"All the variables in the config object are optional. You can send only those you want to change.",-1),f=(0,a._)("p",null,"The config sent like this will be valid until a new config is sent the same way, or until the flow is restarted. On a restart, the original config set up in the node will be used.",-1),U=(0,a._)("p",null,"When a config is sent like this, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.",-1),y=(0,a._)("h2",{id:"input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#input","aria-hidden":"true"},"#"),(0,a.Uk)(" Input")],-1),v=(0,a.Uk)("The input is the "),w=(0,a.Uk)("common strategy input format"),M=(0,a._)("h2",{id:"output",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output","aria-hidden":"true"},"#"),(0,a.Uk)(" Output")],-1),x=(0,a._)("p",null,"There are three outputs. You use only those you need for your purpose.",-1),T=(0,a._)("h3",{id:"output-1",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-1","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 1")],-1),q=(0,a._)("p",null,[(0,a.Uk)("A payload with the word "),(0,a._)("code",null,"true"),(0,a.Uk)(" is sent to output 1 whenever the power / switch shall be turned on.")],-1),I=(0,a._)("h3",{id:"output-2",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-2","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 2")],-1),S=(0,a._)("p",null,[(0,a.Uk)("A payload with the word "),(0,a._)("code",null,"false"),(0,a.Uk)(" is sent to output 2 whenever the power / switch shall be turned off.")],-1),O=(0,a._)("h3",{id:"output-3",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-3","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 3")],-1),W=(0,a._)("p",null,"When a valid input is received, and the schedule is recalculated, the resulting schedule, as well as some other information, is sent to output 3. You can use this to see the plan and verify that it meets your expectations. You can also use it to display the schedule in any way you like.",-1),A=(0,a._)("p",null,"Example of output:",-1),C=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"schedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T00:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T01:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hours"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.2584"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T00:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.2034"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.055"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T01:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.2054"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T02:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"source"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"Nord Pool"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"maxHoursToSaveInSequence"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minHoursOnAfterMaxSequenceSaved"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"1"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minSaving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.001"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"12"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"13"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"14"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"15"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"16"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"17"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"18"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"19"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"20"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"21"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"22"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"23"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"24"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"25"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"26"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"27"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"28"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"29"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"30"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"31"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"32"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"33"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"34"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"35"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"36"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"37"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"38"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"39"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"40"),(0,a._)("br")])],-1),j=(0,a._)("p",null,[(0,a.Uk)("The "),(0,a._)("code",null,"schedule"),(0,a.Uk)(" array shows every time the switch is turned on or off. The "),(0,a._)("code",null,"hours"),(0,a.Uk)(" array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.")],-1),D=(0,a._)("h2",{id:"algorithm",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#algorithm","aria-hidden":"true"},"#"),(0,a.Uk)(" Algorithm")],-1),N=(0,a._)("p",null,"The calculation that decides what hours to turn off works as follows:",-1),H=(0,a._)("ol",null,[(0,a._)("li",null,"A matrix (x * y) is created where x is the number of hours we have price information for, and y is the configured maximum number of hours to turn off in a sequence."),(0,a._)("li",null,"The matrix is filled with how much you save by turning off hour x for y hours."),(0,a._)("li",null,"The matrix is processed calculating all possibilities for turning off a number of hours in a sequence and by that saving money. In this process all non-saving sequences are discarded. Also, if the average saving per hour is less than what you have configured as minimum amount to save per kWh, the sequence is discarded."),(0,a._)("li",null,"The remaining sequences are sorted by how much that is saved, in descending order."),(0,a._)("li",null,'Next, a table with one value per hour is created, with all hours in state "on".'),(0,a._)("li",null,"Then the saving sequences is applied one by one, turning off the hours in each sequence, discarding sequences that lead to any violation of the rules set by the config."),(0,a._)("li",null,"When all sequences are processed, the resulting table shows a pretty good savings plan, that in most cases would be the optimal plan.")],-1),R=(0,a._)("p",null,'I say "in most cases", because there is a chance that a group of two or more sequences combined can give a better plan than a single sequence preceeding those two, but where the selection of the one sequence causes the group to be discarded. If anyone encounters this situation, I would be happy to receive the price data set, and try to improve the algorithm even further.',-1),Y=(0,a._)("h2",{id:"integration-with-magicmirror",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#integration-with-magicmirror","aria-hidden":"true"},"#"),(0,a.Uk)(" Integration with MagicMirror")],-1),P=(0,a.Uk)("Are you using "),V={href:"https://magicmirror.builders/",target:"_blank",rel:"noopener noreferrer"},B=(0,a.Uk)("MagicMirror"),L=(0,a.Uk)("? Are you also using "),Z={href:"https://tibber.com/",target:"_blank",rel:"noopener noreferrer"},E=(0,a.Uk)("Tibber"),F=(0,a.Uk)("? If so, there is a module for MM called "),z={href:"https://github.com/ottopaulsen/MMM-Tibber",target:"_blank",rel:"noopener noreferrer"},G=(0,a.Uk)("MMM-Tibber"),J=(0,a.Uk)(", that easily can be used to show savings from this node."),K=(0,a._)("p",null,[(0,a._)("img",{src:"https://github.com/ottopaulsen/MMM-Tibber/blob/master/doc/MMM-Tibber-screenshot-savings-graph.png?raw=true",alt:"Show savings in MMM-Tibber"})],-1),Q=(0,a._)("p",null,"The purple lines show savings per kWh.",-1),X=(0,a.Uk)("Read more about this in the "),$={href:"https://github.com/ottopaulsen/MMM-Tibber#show-savings",target:"_blank",rel:"noopener noreferrer"},ee=(0,a.Uk)("MMM-Tibber documentation"),ne=(0,a.Uk)("."),se={},ae=(0,s(3744).Z)(se,[["render",function(e,n){const s=(0,a.up)("RouterLink"),t=(0,a.up)("OutboundLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[o,r,l,i,u,p,c,_,h,k,d,b,m,g,f,U,y,(0,a._)("p",null,[v,(0,a.Wm)(s,{to:"/nodes/strategy-input.html"},{default:(0,a.w5)((()=>[w])),_:1})]),M,x,T,q,I,S,O,W,A,C,j,D,N,H,R,Y,(0,a._)("p",null,[P,(0,a._)("a",V,[B,(0,a.Wm)(t)]),L,(0,a._)("a",Z,[E,(0,a.Wm)(t)]),F,(0,a._)("a",z,[G,(0,a.Wm)(t)]),J]),K,Q,(0,a._)("p",null,[X,(0,a._)("a",$,[ee,(0,a.Wm)(t)]),ne])],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}},7188:(e,n,s)=>{e.exports=s.p+"assets/img/node-ps-strategy-best-save.392292d5.png"}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[418],{3959:(n,e,s)=>{s.r(e),s.d(e,{data:()=>a});const a={key:"v-4637f9e4",path:"/nodes/ps-strategy-lowest-price.html",title:"ps-strategy-lowest-price",lang:"en-US",frontmatter:{next:"./ps-receive-price.md"},excerpt:"",headers:[{level:2,title:"Description",slug:"description",children:[]},{level:2,title:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Input",slug:"input",children:[]},{level:2,title:"Output",slug:"output",children:[]},{level:2,title:"Tips & tricks",slug:"tips-tricks",children:[{level:3,title:"Multiple nodes works together",slug:"multiple-nodes-works-together",children:[]},{level:3,title:"Highest price",slug:"highest-price",children:[]}]}],filePathRelative:"nodes/ps-strategy-lowest-price.md",git:{updatedTime:1639315027e3,contributors:[{name:"Otto Paulsen",email:"ottpau@gmail.com",commits:1}]}}},1255:(n,e,s)=>{s.r(e),s.d(e,{default:()=>E});var a=s(6252),t=s(6110);const o=(0,a._)("h1",{id:"ps-strategy-lowest-price",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#ps-strategy-lowest-price","aria-hidden":"true"},"#"),(0,a.Uk)(" ps-strategy-lowest-price")],-1),l=(0,a._)("p",null,[(0,a._)("img",{src:t,alt:"ps-strategy-lowest-price"})],-1),r=(0,a._)("p",null,"Strategy node to turn on power the hours when the price is lowest during a given period, and turn off the other hours.",-1),p=(0,a._)("h2",{id:"description",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),(0,a.Uk)(" Description")],-1),c=(0,a._)("p",null,"The node can work on a specific period from 1 to 24 hours during a 24 hour period. Inside this period, you can decide how many hours that shall be on. The rest of the period will be off. Outside the peiod, you can select that the output shall be either on or off. You can also decide that the hours on shall be consequtive (one continuous period) or spread around in multiple on-periods.",-1),i=(0,a._)("h2",{id:"configuration",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#configuration","aria-hidden":"true"},"#"),(0,a.Uk)(" Configuration")],-1),u=(0,a._)("p",null,[(0,a._)("img",{src:"/lowest-price-config.png",alt:"Node Configuration"})],-1),_=(0,a._)("table",null,[(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Value"),(0,a._)("th",null,"Description")])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,"From Time"),(0,a._)("td",null,"The start time of the selected period.")]),(0,a._)("tr",null,[(0,a._)("td",null,"To Time"),(0,a._)("td",null,"The end time of the selected period.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Hours On"),(0,a._)("td",null,"The number of hours that shall be turned on.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Consecutive On-Period"),(0,a._)("td",null,"Check this if you need the on-period to be consecutive.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Send When Rescheduling"),(0,a._)("td",null,"Check this to make sure on or off output is sent immediately after rescheduling.")]),(0,a._)("tr",null,[(0,a._)("td",null,"If No Schedule, Send"),(0,a._)("td",null,"What to do if there is no valid schedule any more (turn on or off).")]),(0,a._)("tr",null,[(0,a._)("td",null,"Outside Period, Send"),(0,a._)("td",null,"Select the value to send outside the selected period.")])])],-1),k=(0,a._)("p",null,"If you want to use a period of 24 hours, set the From Time and To Time to the same value. The time you select is signficant in the way that it decides which 24 hours that are considered when finding the hours with lowest price.",-1),d=(0,a._)("div",{class:"custom-container tip"},[(0,a._)("p",{class:"custom-container-title"},"Example with Consecutive On-Period"),(0,a._)("p",null,[(0,a.Uk)("One example to need a consecutive on-period can be if you want to control the washing machine. Let's say it needs 3 hours, and you want it to run between 22:00 and 06:00. Set "),(0,a._)("code",null,"From Time = 22:00"),(0,a.Uk)(", "),(0,a._)("code",null,"To Time = 06:00"),(0,a.Uk)(" and check the "),(0,a._)("code",null,"Consecutive On-Period"),(0,a.Uk)(" flag. This will turn on the cheapest 3-hour period from 22:00 to 06:00.")]),(0,a._)("p",null,"NB! It is not recommended to run the washing machine when you are sleeping or away.")],-1),h=(0,a._)("div",{class:"custom-container tip"},[(0,a._)("p",{class:"custom-container-title"},"Example with non-consecutive on-period"),(0,a._)("p",null,[(0,a.Uk)("If you have heating cables in the driveway, you may need them to be on only for a few hours every day, for example 4 hours, but it may not be important when this is. Then set "),(0,a._)("code",null,"From Time = 00:00"),(0,a.Uk)(", "),(0,a._)("code",null,"To Time = 00:00"),(0,a.Uk)(" and "),(0,a._)("strong",null,"un-check"),(0,a.Uk)(" the "),(0,a._)("code",null,"Consecutive On-Period"),(0,a.Uk)(" flag. This will turn on the 4 cheapest hours during the whole day, and off the rest.")]),(0,a._)("p",null,[(0,a.Uk)("You can use any time for start and end, but it is a good idea to use "),(0,a._)("code",null,"00:00"),(0,a.Uk)(", since the prices normally comes for this period.")])],-1),b=(0,a._)("div",{class:"custom-container warning"},[(0,a._)("p",{class:"custom-container-title"},"Outside Period, Send"),(0,a._)("p",null,[(0,a.Uk)("Unless the period you select is 24 hours ("),(0,a._)("code",null,"From Time"),(0,a.Uk)(" and "),(0,a._)("code",null,"To Time"),(0,a.Uk)(" are the same), it is important what value you choose for "),(0,a._)("code",null,"Outside Period, Send"),(0,a.Uk)(". This decides whether the output is on or off during the period that is outside the selected period.")])],-1),m=(0,a._)("div",{class:"custom-container danger"},[(0,a._)("p",{class:"custom-container-title"},"Schedule not calculated"),(0,a._)("p",null,"If you select a period for example from 10:00 to 02:00, it may not be possible to calculate before the period starts. This is because electricity prices for the next day (in the Nord Pool area) normally are received around 13:00. The node cannot calculate the period until it has price data for the whole period.")],-1),U=(0,a._)("h3",{id:"dynamic-config",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#dynamic-config","aria-hidden":"true"},"#"),(0,a.Uk)(" Dynamic config")],-1),g=(0,a._)("p",null,"It is possible to change config dynamically by sending a config message to the node. The config messages has a payload with a config object like this example:",-1),f=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token property"},'"payload"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"fromTime"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"10"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"toTime"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"16"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hoursOn"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"doNotSplit"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputOutsidePeriod"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br")])],-1),y=(0,a._)("p",null,"All the variables in the config object are optional. You can send only those you want to change.",-1),w=(0,a._)("p",null,"The config sent like this will be valid until a new config is sent the same way, or until the flow is restarted. On a restart, the original config set up in the node will be used.",-1),v=(0,a._)("p",null,"When a config is sent like this, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.",-1),T=(0,a._)("h2",{id:"input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#input","aria-hidden":"true"},"#"),(0,a.Uk)(" Input")],-1),x=(0,a.Uk)("The input is the "),O=(0,a.Uk)("common strategy input format"),C=(0,a._)("h2",{id:"output",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output","aria-hidden":"true"},"#"),(0,a.Uk)(" Output")],-1),S=(0,a._)("p",null,"When a valid input is received, and the schedule is recalculated, the resulting schedule, as well as some other information, is sent to output 3. You can use this to see the plan and verify that it meets your expectations. You can also use it to display the schedule in any way you like.",-1),I=(0,a._)("p",null,"Example of output:",-1),P=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"schedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T00:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T04:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T10:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T18:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T04:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T10:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T18:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hours"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.4778"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T00:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.4828"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T01:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token comment"},"//..."),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.6514"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T23:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"source"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"Tibber"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"fromTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"04"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"toTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"18"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hoursOn"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"06"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"doNotSplit"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputOutsidePeriod"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"12"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"13"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"14"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"15"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"16"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"17"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"18"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"19"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"20"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"21"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"22"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"23"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"24"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"25"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"26"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"27"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"28"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"29"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"30"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"31"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"32"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"33"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"34"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"35"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"36"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"37"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"38"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"39"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"40"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"41"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"42"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"43"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"44"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"45"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"46"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"47"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"48"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"49"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"50"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"51"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"52"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"53"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"54"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"55"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"56"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"57"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"58"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"59"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"60"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"61"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"62"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"63"),(0,a._)("br")])],-1),j=(0,a._)("p",null,[(0,a.Uk)("The "),(0,a._)("code",null,"schedule"),(0,a.Uk)(" array shows every time the switch is turned on or off. The "),(0,a._)("code",null,"hours"),(0,a.Uk)(" array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.")],-1),N=(0,a._)("h2",{id:"tips-tricks",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#tips-tricks","aria-hidden":"true"},"#"),(0,a.Uk)(" Tips & tricks")],-1),W=(0,a._)("h3",{id:"multiple-nodes-works-together",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#multiple-nodes-works-together","aria-hidden":"true"},"#"),(0,a.Uk)(" Multiple nodes works together")],-1),Y=(0,a._)("p",null,"You can use multiple nodes simultanously, for different periods, if you want more hours on one part of the day than another part, or to make sure there are at least some hours on during each period.",-1),D=(0,a._)("h3",{id:"highest-price",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#highest-price","aria-hidden":"true"},"#"),(0,a.Uk)(" Highest price")],-1),F=(0,a._)("p",null,[(0,a.Uk)("If you want to find the "),(0,a._)("code",null,"x"),(0,a.Uk)(" hours with the highest prices, do as follows:")],-1),H=(0,a._)("ol",null,[(0,a._)("li",null,[(0,a.Uk)("Calculate "),(0,a._)("code",null,"y"),(0,a.Uk)(" as the total number of hours in the period. For example, if the period is from "),(0,a._)("code",null,"08:00"),(0,a.Uk)(" to "),(0,a._)("code",null,"20:00"),(0,a.Uk)(", then "),(0,a._)("code",null,"y = 12"),(0,a.Uk)(".")]),(0,a._)("li",null,[(0,a.Uk)("Configure "),(0,a._)("code",null,"Hours On = y - x"),(0,a.Uk)(", so if "),(0,a._)("code",null,"x = 4"),(0,a.Uk)(", then "),(0,a._)("code",null,"Hours On = 12 - 4 = 8"),(0,a.Uk)(".")]),(0,a._)("li",null,[(0,a.Uk)("Use "),(0,a._)("strong",null,"Output 2"),(0,a.Uk)(" to get a signal when you have the hours with the highest prices. Just remember that the value sent to output 2 is "),(0,a._)("code",null,"false"),(0,a.Uk)(", not "),(0,a._)("code",null,"true"),(0,a.Uk)(" as it is on output 1.")])],-1),R={},E=(0,s(3744).Z)(R,[["render",function(n,e){const s=(0,a.up)("RouterLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[o,l,r,p,c,i,u,_,k,d,h,b,m,U,g,f,y,w,v,T,(0,a._)("p",null,[x,(0,a.Wm)(s,{to:"/nodes/strategy-input.html"},{default:(0,a.w5)((()=>[O])),_:1})]),C,S,I,P,j,N,W,Y,D,F,H],64)}]])},3744:(n,e)=>{e.Z=(n,e)=>{const s=n.__vccOpts||n;for(const[n,a]of e)s[n]=a;return s}},6110:(n,e,s)=>{n.exports=s.p+"assets/img/node-ps-strategy-lowest-price.3a4ad347.png"}}]);