node-red-contrib-power-saver 3.2.2 → 3.3.2

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 (105) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +1 -1
  3. package/docs/.vuepress/clientAppEnhance.js +5 -0
  4. package/docs/.vuepress/components/BestSaveVerificator.vue +306 -0
  5. package/docs/.vuepress/components/DonateButtons.vue +87 -0
  6. package/docs/.vuepress/config.js +29 -5
  7. package/docs/.vuepress/dist/.nojekyll +0 -0
  8. package/docs/.vuepress/dist/404.html +5 -5
  9. package/docs/.vuepress/dist/assets/css/563.styles.99f4a8aa.css +1 -0
  10. package/docs/.vuepress/dist/assets/css/835.styles.c5afb22b.css +1 -0
  11. package/docs/.vuepress/dist/assets/css/{styles.e835bef6.css → styles.031dcf27.css} +2 -1
  12. package/docs/.vuepress/dist/assets/img/best-save-config.79a2f39a.png +0 -0
  13. package/docs/.vuepress/dist/assets/img/copy-payload-best-save.b9192985.png +0 -0
  14. package/docs/.vuepress/dist/assets/js/262.cf2c57d2.js +1 -0
  15. package/docs/.vuepress/dist/assets/js/{293.5e967839.js → 293.08ea5200.js} +0 -0
  16. package/docs/.vuepress/dist/assets/js/331.15ee3c51.js +1 -0
  17. package/docs/.vuepress/dist/assets/js/{491.c183eba3.js → 491.17a98f38.js} +0 -0
  18. package/docs/.vuepress/dist/assets/js/619.8ba1b1f6.js +2 -0
  19. package/docs/.vuepress/dist/assets/js/{812.79dad458.js.LICENSE.txt → 619.8ba1b1f6.js.LICENSE.txt} +0 -0
  20. package/docs/.vuepress/dist/assets/js/811.6a3392d5.js +1 -0
  21. package/docs/.vuepress/dist/assets/js/app.b705176c.js +1 -0
  22. package/docs/.vuepress/dist/assets/js/runtime~app.47f4f812.js +1 -0
  23. package/docs/.vuepress/dist/assets/js/{v-0607240a.661e1808.js → v-0607240a.a57c2199.js} +0 -0
  24. package/docs/.vuepress/dist/assets/js/{v-08683c60.a6b9cf5b.js → v-08683c60.ccafdcab.js} +0 -0
  25. package/docs/.vuepress/dist/assets/js/{v-0aca7ba6.b42fad7f.js → v-0aca7ba6.25903946.js} +0 -0
  26. package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.a6a015b4.js +1 -0
  27. package/docs/.vuepress/dist/assets/js/{v-1ad821fa.6e2194d0.js → v-1ad821fa.5978386f.js} +0 -0
  28. package/docs/.vuepress/dist/assets/js/{v-1e2b191e.98cc227b.js → v-1e2b191e.88dc5555.js} +0 -0
  29. package/docs/.vuepress/dist/assets/js/v-29504124.4aca27d5.js +1 -0
  30. package/docs/.vuepress/dist/assets/js/{v-30acb564.f2fcd69f.js → v-30acb564.529a3c16.js} +0 -0
  31. package/docs/.vuepress/dist/assets/js/v-4637f9e4.703b1d96.js +1 -0
  32. package/docs/.vuepress/dist/assets/js/v-510ed0d4.7b142a81.js +1 -0
  33. package/docs/.vuepress/dist/assets/js/{v-5954bcb2.182daf70.js → v-5954bcb2.937005d0.js} +0 -0
  34. package/docs/.vuepress/dist/assets/js/{v-5db8da3a.f2de6cb9.js → v-5db8da3a.3de3588d.js} +1 -1
  35. package/docs/.vuepress/dist/assets/js/{v-61f728ca.6fdbbb92.js → v-61f728ca.21d432fe.js} +1 -1
  36. package/docs/.vuepress/dist/assets/js/{v-677dfaed.0013f083.js → v-677dfaed.44a653b9.js} +0 -0
  37. package/docs/.vuepress/dist/assets/js/v-7446a652.74b21d0b.js +1 -0
  38. package/docs/.vuepress/dist/assets/js/v-7c87f26e.ee5be992.js +1 -0
  39. package/docs/.vuepress/dist/assets/js/{v-8daa1a0e.dde202c9.js → v-8daa1a0e.c63afc2b.js} +1 -1
  40. package/docs/.vuepress/dist/assets/js/{v-b4a42144.9e5f9728.js → v-b4a42144.733e4e7c.js} +0 -0
  41. package/docs/.vuepress/dist/assets/js/{v-e8c55052.8384b053.js → v-e8c55052.ab0a79ec.js} +0 -0
  42. package/docs/.vuepress/dist/assets/js/v-fffb8e28.525be02a.js +1 -0
  43. package/docs/.vuepress/dist/changelog/index.html +5 -5
  44. package/docs/.vuepress/dist/contribute/index.html +5 -5
  45. package/docs/.vuepress/dist/examples/example-next-schedule-entity.html +6 -6
  46. package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +6 -7
  47. package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +6 -6
  48. package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +6 -7
  49. package/docs/.vuepress/dist/examples/index.html +5 -5
  50. package/docs/.vuepress/dist/faq/best-save-viewer.html +15 -0
  51. package/docs/.vuepress/dist/faq/index.html +5 -5
  52. package/docs/.vuepress/dist/guide/index.html +6 -6
  53. package/docs/.vuepress/dist/index.html +5 -5
  54. package/docs/.vuepress/dist/nodes/index.html +5 -5
  55. package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +7 -7
  56. package/docs/.vuepress/dist/nodes/power-saver.html +5 -5
  57. package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +5 -5
  58. package/docs/.vuepress/dist/nodes/ps-general-add-tariff.html +5 -5
  59. package/docs/.vuepress/dist/nodes/ps-receive-price.html +8 -8
  60. package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +22 -8
  61. package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +17 -7
  62. package/docs/.vuepress/dist/nodes/strategy-input.html +5 -5
  63. package/docs/README.md +4 -1
  64. package/docs/changelog/README.md +23 -0
  65. package/docs/contribute/README.md +3 -3
  66. package/docs/examples/example-nordpool-current-state.md +0 -1
  67. package/docs/examples/example-tibber-mqtt.md +0 -1
  68. package/docs/faq/README.md +28 -1
  69. package/docs/faq/best-save-viewer.md +61 -0
  70. package/docs/images/best-save-config.png +0 -0
  71. package/docs/images/copy-payload-best-save.png +0 -0
  72. package/docs/nodes/ps-strategy-best-save.md +95 -8
  73. package/docs/nodes/ps-strategy-lowest-price.md +57 -0
  74. package/package.json +7 -3
  75. package/src/general-add-tariff-functions.js +0 -1
  76. package/src/general-add-tariff.js +2 -4
  77. package/src/handle-input.js +31 -9
  78. package/src/strategy-best-save.html +0 -21
  79. package/src/strategy-best-save.js +8 -11
  80. package/test/commands-input.test.js +47 -0
  81. package/test/data/best-save-result.json +1 -2
  82. package/test/data/current-undefined-prices.json +197 -0
  83. package/test/data/current-undefined-result.json +208 -0
  84. package/test/data/lowest-price-result-missing-end.json +2 -1
  85. package/test/data/reconfigResult.js +56 -294
  86. package/test/data/reconfigResult_old2.js +75 -0
  87. package/test/data/tibber-result-end-0-24h.json +1 -0
  88. package/test/data/tibber-result-end-0.json +1 -0
  89. package/test/send-config-input.test.js +3 -37
  90. package/test/strategy-best-save-test-utils.js +2 -1
  91. package/test/strategy-best-save.test.js +14 -8
  92. package/test/test-utils.js +1 -7
  93. package/test/utils.test.js +0 -33
  94. package/docs/.vuepress/dist/assets/img/best-save-config.93fa3c21.png +0 -0
  95. package/docs/.vuepress/dist/assets/js/812.79dad458.js +0 -2
  96. package/docs/.vuepress/dist/assets/js/app.46f7644a.js +0 -1
  97. package/docs/.vuepress/dist/assets/js/runtime~app.714a526c.js +0 -1
  98. package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.3b37457f.js +0 -1
  99. package/docs/.vuepress/dist/assets/js/v-4637f9e4.b320f5e8.js +0 -1
  100. package/docs/.vuepress/dist/assets/js/v-510ed0d4.9d35e3e3.js +0 -1
  101. package/docs/.vuepress/dist/assets/js/v-7446a652.d05e2648.js +0 -1
  102. package/docs/.vuepress/dist/assets/js/v-7c87f26e.1127dcf5.js +0 -1
  103. package/docs/.vuepress/dist/assets/js/v-fffb8e28.3406fd88.js +0 -1
  104. package/test/data/adjustedResult.js +0 -302
  105. package/test/data/adjustedResult_old.js +0 -154
@@ -4,12 +4,12 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <meta name="generator" content="VuePress 2.0.0-beta.27">
7
- <link rel="icon" href="/euro.png"><title>ps-strategy-lowest-price | Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
8
- <link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.714a526c.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/css/styles.e835bef6.css" as="style"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/812.79dad458.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/app.46f7644a.js" as="script">
9
- <link rel="stylesheet" href="/node-red-contrib-power-saver/assets/css/styles.e835bef6.css">
7
+ <link rel="shortcut icon" type="image/x-icon" href="euro.png"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9857859182772006" crossorigin="anonymous"></script><title>ps-strategy-lowest-price | Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
8
+ <link rel="preload" href="/assets/js/runtime~app.47f4f812.js" as="script"><link rel="preload" href="/assets/css/styles.031dcf27.css" as="style"><link rel="preload" href="/assets/js/619.8ba1b1f6.js" as="script"><link rel="preload" href="/assets/js/app.b705176c.js" as="script">
9
+ <link rel="stylesheet" href="/assets/css/styles.031dcf27.css">
10
10
  </head>
11
11
  <body>
12
- <div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/node-red-contrib-power-saver/" class=""><!----><span class="site-name">Power Saver</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><p class="sidebar-heading sidebar-item active">Nodes</p><ul class=""><li><!--[--><a href="/node-red-contrib-power-saver/nodes/power-saver.md" class="nav-link sidebar-item" aria-label="Power Saver"><!--[--><!--]--> Power Saver <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><p class="sidebar-item active">Strategy nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-strategy-best-save.html" class="nav-link sidebar-item" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-item active" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#description" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Description"><!--[--><!--]--> Description <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#configuration" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Configuration"><!--[--><!--]--> Configuration <!--[--><!--]--></a><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#dynamic-config" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Dynamic config"><!--[--><!--]--> Dynamic config <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#input" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Input"><!--[--><!--]--> Input <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#output" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Output"><!--[--><!--]--> Output <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#tips-tricks" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Tips &amp; tricks"><!--[--><!--]--> Tips &amp; tricks <!--[--><!--]--></a><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#multiple-nodes-works-together" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Multiple nodes works together"><!--[--><!--]--> Multiple nodes works together <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html#highest-price" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Highest price"><!--[--><!--]--> Highest price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Utility nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-receive-price.html" class="nav-link sidebar-item" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Grid tariff nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-general-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-general-add-tariff"><!--[--><!--]--> ps-general-add-tariff <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-elvia-add-tariff"><!--[--><!--]--> ps-elvia-add-tariff <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--><!--[--><p class="sidebar-heading sidebar-item">Data format</p><ul class=""><li><!--[--><a href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="nav-link sidebar-item" aria-label="Strategy input format"><!--[--><!--]--> Strategy input format <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="ps-strategy-lowest-price" tabindex="-1"><a class="header-anchor" href="#ps-strategy-lowest-price" aria-hidden="true">#</a> ps-strategy-lowest-price</h1><p><img src="/node-red-contrib-power-saver/assets/img/node-ps-strategy-lowest-price.3a4ad347.png" alt="ps-strategy-lowest-price"></p><p>Strategy node to turn on power the hours when the price is lowest during a given period, and turn off the other hours.</p><h2 id="description" tabindex="-1"><a class="header-anchor" href="#description" aria-hidden="true">#</a> Description</h2><p>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.</p><h2 id="configuration" tabindex="-1"><a class="header-anchor" href="#configuration" aria-hidden="true">#</a> Configuration</h2><p><img src="/node-red-contrib-power-saver/assets/img/lowest-price-config.6d66a8c2.png" alt="Node Configuration"></p><table><thead><tr><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>From Time</td><td>The start time of the selected period.</td></tr><tr><td>To Time</td><td>The end time of the selected period.</td></tr><tr><td>Hours On</td><td>The number of hours that shall be turned on.</td></tr><tr><td>Consecutive On-Period</td><td>Check this if you need the on-period to be consecutive.</td></tr><tr><td>Send When Rescheduling</td><td>Check this to make sure on or off output is sent immediately after rescheduling.</td></tr><tr><td>If No Schedule, Send</td><td>What to do if there is no valid schedule any more (turn on or off).</td></tr><tr><td>Outside Period, Send</td><td>Select the value to send outside the selected period.</td></tr></tbody></table><p>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.</p><div class="custom-container tip"><p class="custom-container-title">Example with Consecutive On-Period</p><p>One example to need a consecutive on-period can be if you want to control the washing machine. Let&#39;s say it needs 3 hours, and you want it to run between 22:00 and 06:00. Set <code>From Time = 22:00</code>, <code>To Time = 06:00</code> and check the <code>Consecutive On-Period</code> flag. This will turn on the cheapest 3-hour period from 22:00 to 06:00.</p><p>NB! It is not recommended to run the washing machine when you are sleeping or away.</p></div><div class="custom-container tip"><p class="custom-container-title">Example with non-consecutive on-period</p><p>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 <code>From Time = 00:00</code>, <code>To Time = 00:00</code> and <strong>un-check</strong> the <code>Consecutive On-Period</code> flag. This will turn on the 4 cheapest hours during the whole day, and off the rest.</p><p>You can use any time for start and end, but it is a good idea to use <code>00:00</code>, since the prices normally comes for this period.</p></div><div class="custom-container warning"><p class="custom-container-title">Outside Period, Send</p><p>Unless the period you select is 24 hours (<code>From Time</code> and <code>To Time</code> are the same), it is important what value you choose for <code>Outside Period, Send</code>. This decides whether the output is on or off during the period that is outside the selected period.</p></div><div class="custom-container danger"><p class="custom-container-title">Schedule not calculated</p><p>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.</p></div><h3 id="dynamic-config" tabindex="-1"><a class="header-anchor" href="#dynamic-config" aria-hidden="true">#</a> Dynamic config</h3><p>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:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token property">&quot;payload&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
12
+ <div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/" class=""><!----><span class="site-name">Power Saver</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a href="/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/faq/" class="nav-link" aria-label="FAQ"><!--[--><!--]--> FAQ <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a href="/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/faq/" class="nav-link" aria-label="FAQ"><!--[--><!--]--> FAQ <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><p class="sidebar-heading sidebar-item active">Nodes</p><ul class=""><li><!--[--><a href="/nodes/power-saver.md" class="nav-link sidebar-item" aria-label="Power Saver"><!--[--><!--]--> Power Saver <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><p class="sidebar-item active">Strategy nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/nodes/ps-strategy-best-save.html" class="nav-link sidebar-item" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-item active" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#description" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Description"><!--[--><!--]--> Description <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#configuration" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Configuration"><!--[--><!--]--> Configuration <!--[--><!--]--></a><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#dynamic-config" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Dynamic config"><!--[--><!--]--> Dynamic config <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#dynamic-commands" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Dynamic commands"><!--[--><!--]--> Dynamic commands <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#input" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Input"><!--[--><!--]--> Input <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#output" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Output"><!--[--><!--]--> Output <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#tips-tricks" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Tips &amp; tricks"><!--[--><!--]--> Tips &amp; tricks <!--[--><!--]--></a><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#multiple-nodes-works-together" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Multiple nodes works together"><!--[--><!--]--> Multiple nodes works together <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/nodes/ps-strategy-lowest-price.html#highest-price" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Highest price"><!--[--><!--]--> Highest price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Utility nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/nodes/ps-receive-price.html" class="nav-link sidebar-item" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Grid tariff nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/nodes/ps-general-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-general-add-tariff"><!--[--><!--]--> ps-general-add-tariff <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/nodes/ps-elvia-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-elvia-add-tariff"><!--[--><!--]--> ps-elvia-add-tariff <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--><!--[--><p class="sidebar-heading sidebar-item">Data format</p><ul class=""><li><!--[--><a href="/nodes/strategy-input.html" class="nav-link sidebar-item" aria-label="Strategy input format"><!--[--><!--]--> Strategy input format <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="ps-strategy-lowest-price" tabindex="-1"><a class="header-anchor" href="#ps-strategy-lowest-price" aria-hidden="true">#</a> ps-strategy-lowest-price</h1><p><img src="/assets/img/node-ps-strategy-lowest-price.3a4ad347.png" alt="ps-strategy-lowest-price"></p><p>Strategy node to turn on power the hours when the price is lowest during a given period, and turn off the other hours.</p><h2 id="description" tabindex="-1"><a class="header-anchor" href="#description" aria-hidden="true">#</a> Description</h2><p>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.</p><h2 id="configuration" tabindex="-1"><a class="header-anchor" href="#configuration" aria-hidden="true">#</a> Configuration</h2><p><img src="/assets/img/lowest-price-config.6d66a8c2.png" alt="Node Configuration"></p><table><thead><tr><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>From Time</td><td>The start time of the selected period.</td></tr><tr><td>To Time</td><td>The end time of the selected period.</td></tr><tr><td>Hours On</td><td>The number of hours that shall be turned on.</td></tr><tr><td>Consecutive On-Period</td><td>Check this if you need the on-period to be consecutive.</td></tr><tr><td>Send When Rescheduling</td><td>Check this to make sure on or off output is sent immediately after rescheduling.</td></tr><tr><td>If No Schedule, Send</td><td>What to do if there is no valid schedule any more (turn on or off).</td></tr><tr><td>Outside Period, Send</td><td>Select the value to send outside the selected period.</td></tr></tbody></table><p>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.</p><div class="custom-container tip"><p class="custom-container-title">Example with Consecutive On-Period</p><p>One example to need a consecutive on-period can be if you want to control the washing machine. Let&#39;s say it needs 3 hours, and you want it to run between 22:00 and 06:00. Set <code>From Time = 22:00</code>, <code>To Time = 06:00</code> and check the <code>Consecutive On-Period</code> flag. This will turn on the cheapest 3-hour period from 22:00 to 06:00.</p><p>NB! It is not recommended to run the washing machine when you are sleeping or away.</p></div><div class="custom-container tip"><p class="custom-container-title">Example with non-consecutive on-period</p><p>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 <code>From Time = 00:00</code>, <code>To Time = 00:00</code> and <strong>un-check</strong> the <code>Consecutive On-Period</code> flag. This will turn on the 4 cheapest hours during the whole day, and off the rest.</p><p>You can use any time for start and end, but it is a good idea to use <code>00:00</code>, since the prices normally comes for this period.</p></div><div class="custom-container warning"><p class="custom-container-title">Outside Period, Send</p><p>Unless the period you select is 24 hours (<code>From Time</code> and <code>To Time</code> are the same), it is important what value you choose for <code>Outside Period, Send</code>. This decides whether the output is on or off during the period that is outside the selected period.</p></div><div class="custom-container danger"><p class="custom-container-title">Schedule not calculated</p><p>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.</p></div><h3 id="dynamic-config" tabindex="-1"><a class="header-anchor" href="#dynamic-config" aria-hidden="true">#</a> Dynamic config</h3><p>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:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token property">&quot;payload&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
13
13
  <span class="token property">&quot;config&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
14
14
  <span class="token property">&quot;fromTime&quot;</span> <span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span>
15
15
  <span class="token property">&quot;toTime&quot;</span> <span class="token operator">:</span> <span class="token number">16</span><span class="token punctuation">,</span>
@@ -20,7 +20,17 @@
20
20
  <span class="token property">&quot;outputOutsidePeriod&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span>
21
21
  <span class="token punctuation">}</span>
22
22
  <span class="token punctuation">}</span>
23
- </code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>All the variables in the config object are optional. You can send only those you want to change.</p><p>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.</p><p>When a config is sent like this, and without price data, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.</p><p>However, you can send config and price data in the same message. Then both will be used .</p><h2 id="input" tabindex="-1"><a class="header-anchor" href="#input" aria-hidden="true">#</a> Input</h2><p>The input is the <a href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="">common strategy input format</a></p><h2 id="output" tabindex="-1"><a class="header-anchor" href="#output" aria-hidden="true">#</a> Output</h2><p>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.</p><p>Example of output:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
23
+ </code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>All the variables in the config object are optional. You can send only those you want to change.</p><p>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.</p><p>When a config is sent like this, and without price data, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.</p><p>However, you can send config and price data in the same message. Then both will be used .</p><h3 id="dynamic-commands" tabindex="-1"><a class="header-anchor" href="#dynamic-commands" aria-hidden="true">#</a> Dynamic commands</h3><p>You can dynamically send some commands to the node via its input, by using a <code>commands</code> object in the payload as described below.</p><p>Commands can be sent together with config and/or price data, but the exact behavior is not defined.</p><h4 id="sendschedule" tabindex="-1"><a class="header-anchor" href="#sendschedule" aria-hidden="true">#</a> sendSchedule</h4><p>You can get the schedule sent to output 3 any time by sending a message like this to the node:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token property">&quot;payload&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
24
+ <span class="token property">&quot;commands&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
25
+ <span class="token property">&quot;sendSchedule&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
26
+ <span class="token punctuation">}</span>
27
+ <span class="token punctuation">}</span>
28
+ </code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>When you do this, the current schedule is actually recalculated based on the last received data, and then sent to output 3 the same way as when it was originally planned.</p><h4 id="reset" tabindex="-1"><a class="header-anchor" href="#reset" aria-hidden="true">#</a> reset</h4><p>You can reset data the node has saved in context by sending this message:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token property">&quot;payload&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
29
+ <span class="token property">&quot;commands&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
30
+ <span class="token property">&quot;reset&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
31
+ <span class="token punctuation">}</span>
32
+ <span class="token punctuation">}</span>
33
+ </code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>When you do this, all historical data the node has saved is deleted, including the current schedule, so the result will be that the node shows status &quot;No price data&quot;. When new price data is received, a schedule is calculated without considering any history.</p><p>The nodes config is not deleted, as the node depends on it to work.</p><div class="custom-container warning"><p class="custom-container-title">WARNING</p><p>This operation cannot be undone.</p><p>However, it is normally not a big loss, as you can just feed the node with new price data and start from scratch.</p></div><h2 id="input" tabindex="-1"><a class="header-anchor" href="#input" aria-hidden="true">#</a> Input</h2><p>The input is the <a href="/nodes/strategy-input.html" class="">common strategy input format</a></p><h2 id="output" tabindex="-1"><a class="header-anchor" href="#output" aria-hidden="true">#</a> Output</h2><p>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.</p><p>Example of output:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
24
34
  <span class="token property">&quot;schedule&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
25
35
  <span class="token punctuation">{</span>
26
36
  <span class="token property">&quot;time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-12-10T00:00:00.000+01:00&quot;</span><span class="token punctuation">,</span>
@@ -85,7 +95,7 @@
85
95
  <span class="token property">&quot;time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T23:45:12.123+02:00&quot;</span><span class="token punctuation">,</span>
86
96
  <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token string">&quot;3.1.2&quot;</span>
87
97
  <span class="token punctuation">}</span>
88
- </code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br></div></div><p>The <code>schedule</code> array shows every time the switch is turned on or off. The <code>hours</code> 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.</p><h2 id="tips-tricks" tabindex="-1"><a class="header-anchor" href="#tips-tricks" aria-hidden="true">#</a> Tips &amp; tricks</h2><h3 id="multiple-nodes-works-together" tabindex="-1"><a class="header-anchor" href="#multiple-nodes-works-together" aria-hidden="true">#</a> Multiple nodes works together</h3><p>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.</p><h3 id="highest-price" tabindex="-1"><a class="header-anchor" href="#highest-price" aria-hidden="true">#</a> Highest price</h3><p>If you want to find the <code>x</code> hours with the highest prices, do as follows:</p><ol><li>Calculate <code>y</code> as the total number of hours in the period. For example, if the period is from <code>08:00</code> to <code>20:00</code>, then <code>y = 12</code>.</li><li>Configure <code>Hours On = y - x</code>, so if <code>x = 4</code>, then <code>Hours On = 12 - 4 = 8</code>.</li><li>Use <strong>Output 2</strong> to get a signal when you have the hours with the highest prices. Just remember that the value sent to output 2 is <code>false</code>, not <code>true</code> as it is on output 1.</li></ol><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">1/7/2022, 9:09:31 PM</span></div><!----></footer><nav class="page-nav"><p class="inner"><span class="prev"> ← <a href="/node-red-contrib-power-saver/nodes/ps-strategy-best-save.html" class="nav-link" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a></span><span class="next"><a href="/node-red-contrib-power-saver/nodes/ps-receive-price.html" class="nav-link" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
89
- <script src="/node-red-contrib-power-saver/assets/js/runtime~app.714a526c.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/812.79dad458.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/app.46f7644a.js" defer></script>
98
+ </code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br></div></div><p>The <code>schedule</code> array shows every time the switch is turned on or off. The <code>hours</code> 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.</p><h2 id="tips-tricks" tabindex="-1"><a class="header-anchor" href="#tips-tricks" aria-hidden="true">#</a> Tips &amp; tricks</h2><h3 id="multiple-nodes-works-together" tabindex="-1"><a class="header-anchor" href="#multiple-nodes-works-together" aria-hidden="true">#</a> Multiple nodes works together</h3><p>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.</p><h3 id="highest-price" tabindex="-1"><a class="header-anchor" href="#highest-price" aria-hidden="true">#</a> Highest price</h3><p>If you want to find the <code>x</code> hours with the highest prices, do as follows:</p><ol><li>Calculate <code>y</code> as the total number of hours in the period. For example, if the period is from <code>08:00</code> to <code>20:00</code>, then <code>y = 12</code>.</li><li>Configure <code>Hours On = y - x</code>, so if <code>x = 4</code>, then <code>Hours On = 12 - 4 = 8</code>.</li><li>Use <strong>Output 2</strong> to get a signal when you have the hours with the highest prices. Just remember that the value sent to output 2 is <code>false</code>, not <code>true</code> as it is on output 1.</li></ol><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">1/16/2022, 10:44:21 PM</span></div><!----></footer><nav class="page-nav"><p class="inner"><span class="prev"> ← <a href="/nodes/ps-strategy-best-save.html" class="nav-link" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a></span><span class="next"><a href="/nodes/ps-receive-price.html" class="nav-link" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
99
+ <script src="/assets/js/runtime~app.47f4f812.js" defer></script><script src="/assets/js/619.8ba1b1f6.js" defer></script><script src="/assets/js/app.b705176c.js" defer></script>
90
100
  </body>
91
101
  </html>
@@ -4,12 +4,12 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <meta name="generator" content="VuePress 2.0.0-beta.27">
7
- <link rel="icon" href="/euro.png"><title>Strategy input format | Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
8
- <link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.714a526c.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/css/styles.e835bef6.css" as="style"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/812.79dad458.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/app.46f7644a.js" as="script">
9
- <link rel="stylesheet" href="/node-red-contrib-power-saver/assets/css/styles.e835bef6.css">
7
+ <link rel="shortcut icon" type="image/x-icon" href="euro.png"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9857859182772006" crossorigin="anonymous"></script><title>Strategy input format | Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
8
+ <link rel="preload" href="/assets/js/runtime~app.47f4f812.js" as="script"><link rel="preload" href="/assets/css/styles.031dcf27.css" as="style"><link rel="preload" href="/assets/js/619.8ba1b1f6.js" as="script"><link rel="preload" href="/assets/js/app.b705176c.js" as="script">
9
+ <link rel="stylesheet" href="/assets/css/styles.031dcf27.css">
10
10
  </head>
11
11
  <body>
12
- <div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/node-red-contrib-power-saver/" class=""><!----><span class="site-name">Power Saver</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><p class="sidebar-heading sidebar-item">Nodes</p><ul class=""><li><!--[--><a href="/node-red-contrib-power-saver/nodes/power-saver.md" class="nav-link sidebar-item" aria-label="Power Saver"><!--[--><!--]--> Power Saver <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><p class="sidebar-item">Strategy nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-strategy-best-save.html" class="nav-link sidebar-item" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html" class="nav-link sidebar-item" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Utility nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-receive-price.html" class="nav-link sidebar-item" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Grid tariff nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-general-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-general-add-tariff"><!--[--><!--]--> ps-general-add-tariff <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-elvia-add-tariff"><!--[--><!--]--> ps-elvia-add-tariff <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--><!--[--><p class="sidebar-heading sidebar-item active">Data format</p><ul class=""><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-item active" aria-label="Strategy input format"><!--[--><!--]--> Strategy input format <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="strategy-input-format" tabindex="-1"><a class="header-anchor" href="#strategy-input-format" aria-hidden="true">#</a> Strategy input format</h1><p>The common input for strategy nodes is a payload with a <code>priceData</code> array containing an object for each hour. Each object has a <code>value</code> which is the price, and a <code>start</code> which is the start time for the hour.</p><p>Example:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
12
+ <div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/" class=""><!----><span class="site-name">Power Saver</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a href="/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/faq/" class="nav-link" aria-label="FAQ"><!--[--><!--]--> FAQ <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a href="/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/faq/" class="nav-link" aria-label="FAQ"><!--[--><!--]--> FAQ <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://github.com/ottopaulsen/node-red-contrib-power-saver" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><p class="sidebar-heading sidebar-item">Nodes</p><ul class=""><li><!--[--><a href="/nodes/power-saver.md" class="nav-link sidebar-item" aria-label="Power Saver"><!--[--><!--]--> Power Saver <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><p class="sidebar-item">Strategy nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/nodes/ps-strategy-best-save.html" class="nav-link sidebar-item" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/nodes/ps-strategy-lowest-price.html" class="nav-link sidebar-item" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Utility nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/nodes/ps-receive-price.html" class="nav-link sidebar-item" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Grid tariff nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/nodes/ps-general-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-general-add-tariff"><!--[--><!--]--> ps-general-add-tariff <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/nodes/ps-elvia-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-elvia-add-tariff"><!--[--><!--]--> ps-elvia-add-tariff <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--><!--[--><p class="sidebar-heading sidebar-item active">Data format</p><ul class=""><li><!--[--><a aria-current="page" href="/nodes/strategy-input.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-item active" aria-label="Strategy input format"><!--[--><!--]--> Strategy input format <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="strategy-input-format" tabindex="-1"><a class="header-anchor" href="#strategy-input-format" aria-hidden="true">#</a> Strategy input format</h1><p>The common input for strategy nodes is a payload with a <code>priceData</code> array containing an object for each hour. Each object has a <code>value</code> which is the price, and a <code>start</code> which is the start time for the hour.</p><p>Example:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
13
13
  <span class="token property">&quot;priceData&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
14
14
  <span class="token punctuation">{</span>
15
15
  <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">0.9544</span><span class="token punctuation">,</span>
@@ -35,6 +35,6 @@
35
35
  <span class="token punctuation">]</span>
36
36
  <span class="token punctuation">}</span>
37
37
  </code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br></div></div><p>This format is used for:</p><ul><li>Output of the <code>ps-receive-price</code> node</li><li>Input and output of the <code>ps-xxx-add-tariff</code> nodes</li><li>Input for the strategy nodes (<code>ps-strategy-xxx-xxx</code>)</li></ul><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">12/20/2021, 10:10:18 PM</span></div><!----></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
38
- <script src="/node-red-contrib-power-saver/assets/js/runtime~app.714a526c.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/812.79dad458.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/app.46f7644a.js" defer></script>
38
+ <script src="/assets/js/runtime~app.47f4f812.js" defer></script><script src="/assets/js/619.8ba1b1f6.js" defer></script><script src="/assets/js/app.b705176c.js" defer></script>
39
39
  </body>
40
40
  </html>
package/docs/README.md CHANGED
@@ -27,8 +27,11 @@ features:
27
27
  details: Use Home Assistant with Node-RED and control switches via service calls.
28
28
  - title: Tibber and Nord Pool
29
29
  details: Painlessly use prices received from Tibber or Nord Pool.
30
- footer: Created by Otto Paulsen<br/><br/><a href="https://www.patreon.com/bePatron?u=65948417" data-patreon-widget-type="become-patron-button">Become a Patron!</a>
30
+ footer: Created by Otto Paulsen
31
+
31
32
  footerHtml: true
32
33
  ---
33
34
 
34
35
  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.
36
+
37
+ <DonateButtons/>
@@ -6,6 +6,29 @@ sidebar: "auto"
6
6
 
7
7
  List the most significant changes, starting in version 1.0.9.
8
8
 
9
+ ## 3.3.2
10
+
11
+ - Add command sendOutput.
12
+
13
+ ## 3.3.1
14
+
15
+ - Move doc to [power-saver.smoky.no](power-saver.smoky.no)
16
+ - Make tool to test the result of the best save node: [Best Save Viewer](power-saver.smoky.no/faq/best-save-viewer.html)
17
+
18
+ ## 3.3.0
19
+
20
+ - Remove the config option to schedule from the current hour. The feature did not work, and it was not clear how it should work.
21
+ - Added a dynamic command feature to make it possible to dynamically
22
+ 1. Tell the node to send the schedule to output 3.
23
+ 2. Reset saved data making the next schedule to start without historical data.
24
+ - Fix node status so it says "No price data" when there is no price data available.
25
+ - Added an FAQ section to the doc.
26
+
27
+ ## 3.2.3
28
+
29
+ - Remove unused imports
30
+ - Fix doc deployment issue
31
+
9
32
  ## 3.2.2
10
33
 
11
34
  - New attempt to solve the problem with multiple outputs at the same time.
@@ -4,13 +4,13 @@ sidebar: "auto"
4
4
 
5
5
  # Contribute
6
6
 
7
- ## Patreon
7
+ ## Donate
8
8
 
9
9
  Developing software is time consuming. This solution has taken the better part of all my free time for about 3 quarters of a year. Getting something back would make it easier to also spend future time on this.
10
10
 
11
- I am trying out Patreon to see if it is possible to get something back for the work I do. The software is open source, and you can use it for free, but if you feel it has value, you can support the development by becoming a patron, paying a monthly fee of your choice.
11
+ I am trying out Patreon and PayPals "Donate" to see if it is possible to get something back for the work I do. The software is open source, and you can use it for free, but if you feel it has value, you can support the development by donating or becoming a patron, paying a fee of your choice.
12
12
 
13
- <a href="https://www.patreon.com/bePatron?u=65948417" data-patreon-widget-type="become-patron-button">Become a Patron!</a>
13
+ <DonateButtons></DonateButtons>
14
14
 
15
15
  ## Code
16
16
 
@@ -154,7 +154,6 @@ In this example, data is read from the Nord Pool sensor in HA via the `current s
154
154
  "minSaving": "0.03",
155
155
  "sendCurrentValueWhenRescheduling": true,
156
156
  "outputIfNoSchedule": "true",
157
- "scheduleOnlyFromCurrentTime": "false",
158
157
  "x": 630,
159
158
  "y": 380,
160
159
  "wires": [
@@ -120,7 +120,6 @@ In this example, data is read from Tibber and used to turn on/off a switch, sche
120
120
  "minSaving": "0.05",
121
121
  "sendCurrentValueWhenRescheduling": true,
122
122
  "outputIfNoSchedule": "true",
123
- "scheduleOnlyFromCurrentTime": "false",
124
123
  "x": 490,
125
124
  "y": 160,
126
125
  "wires": [["467a5fe.d0bbba", "5e485ff7.db156"], ["9c978d1c.ee76", "467a5fe.d0bbba"], ["42d8b632.402e38"]]
@@ -1,5 +1,28 @@
1
+ ---
2
+ sidebar:
3
+ - /faq/README.md
4
+ - /faq/best-save-viewer.md
5
+ ---
6
+
1
7
  # FAQ
2
8
 
9
+ ## How can I contribute?
10
+
11
+ You can donate:
12
+
13
+ <DonateButtons/>
14
+
15
+ or take a look at the [contribute page](../contribute/README.md)
16
+
17
+ ## Why is the best save schedule like this?
18
+
19
+ There may be many reasons for the best save node planning like it does. Here are some considerations:
20
+
21
+ - It is turning off only if it can save the `Min saving` amount in average per kWh per hour for the hours turned off, compared to the next hour that is on.
22
+ - It will not turn off more than `Max per sequence` hours, so it may have to stay on through the most expensive hours, if there are more than the configured number of hours until the price is low enough.
23
+
24
+ In order to understand how the node works, try out the [Best Save Viewer](./best-save-viewer.md)
25
+
3
26
  ## Why does the Best Save node not turn off the most expensive hours?
4
27
 
5
28
  Here is an example:
@@ -12,7 +35,7 @@ Why does it not save the most expensive period?
12
35
 
13
36
  If you move the saving-period 4-5 hours earlier, the most expensive hours would have been saved. Why is this not better?
14
37
 
15
- Remember that the power that is not used during the saving-period, will be used immediately after. At least, that is the idea, and the normal behaviour if the power consumer is a water heater or another heater controlled by a thermostat. So, then the power would be used one of the blue hours in stead of the green cheaper hour.
38
+ Remember that the power that is not used during the saving-period, will be used immediately after. At least, that is the idea, and the normal behavior if the power consumer is a water heater or another heater controlled by a thermostat. So, then the power would be used one of the blue hours in stead of the green cheaper hour.
16
39
 
17
40
  Also remember that when saving, you do not save the full price. You only save what is the difference between the price during the saved hours and the price the hour immediately after.
18
41
 
@@ -21,3 +44,7 @@ So the best saving is found where this difference is the largest, and that is no
21
44
  Of course, if you expand the saving period from 5 to 10 hours you would save even more, but that would be a different case, and you can do that if it is ok for you to turn off for that long time.
22
45
 
23
46
  Another alternative is to reduce the minimum saving from 0.05 to 0.001. Then the 3 first red hours would be turned off, but the last red would have to be on, in order to get one hour on until the next 5-hour period off. This would however not save you for much money, since the hour that is on is almost as expensive as the hours you would turn off.
47
+
48
+ ## Can we get Legionella bacteria when turning off the water heater?
49
+
50
+ 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/).
@@ -0,0 +1,61 @@
1
+ ---
2
+ sidebar: auto
3
+ ---
4
+
5
+ # Best Save Viewer
6
+
7
+ ## Tool
8
+
9
+ Below is a tool you can use to look at how the Best Save node is working.
10
+ In order to use it, you must copy the payload from output 3 on the node:
11
+
12
+ ![Copy payload](../images/copy-payload-best-save.png)
13
+
14
+ Then paste it here and see the result below:
15
+
16
+ <BestSaveVerificator/>
17
+
18
+ ## Explanation
19
+
20
+ ### Config
21
+
22
+ This is the configuration you have used.
23
+
24
+ ### Meta data
25
+
26
+ Other information about the calculation etc.
27
+
28
+ ### Days
29
+
30
+ Here you can see some summary and average for each date in the data set. Hover over the column title for explanation.
31
+
32
+ ### Hours
33
+
34
+ Here is your dta represented per hour, as well as potential savings calculated by the tool. Negative numbers are hidden, but you can select to show them.
35
+
36
+ #### Input data
37
+
38
+ This is the data per hour that you used as input.
39
+
40
+ #### Saving if turned off x hours
41
+
42
+ There are the same number of columns as you have configured as `Max in sequence`.
43
+ The cells show how much you will save per hWh by turning that hour off for `x` hours,
44
+ starting at that hour. It is the difference between the price at that hour and the price x hours later. Click on a cell to see the cells used in the calculation.
45
+
46
+ #### Saving for sequence of x hours
47
+
48
+ These cells show how much you can save per kWh in average per hour by turning off a sequence of x hours starting at that hour. Click on a cell to see the cells used in the calculation.
49
+
50
+ Above the table you can select to see the average per hour or the su for all saved hours.
51
+
52
+ If the average per hour is less than what you have configured as `Minimum saving`, the number is red, and that sequence will not be used.
53
+
54
+ If the number is black, it could be used, but only if all other criteria are satisfied, and only if it saves more than any other combination.
55
+
56
+ ## Something seems wrong
57
+
58
+ The tool is not using the same code as the node, so in case there is a bg in the node (or in the tool) the numbers may not match.
59
+
60
+ <hr/>
61
+ <DonateButtons/>
Binary file