node-red-contrib-power-saver 3.3.2 → 3.4.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 (137) hide show
  1. package/.firebase/hosting.ZG9jcy8udnVlcHJlc3MvZGlzdA.cache +94 -0
  2. package/.firebaserc +5 -0
  3. package/.github/workflows/firebase-hosting-merge.yml +20 -0
  4. package/.github/workflows/firebase-hosting-pull-request.yml +17 -0
  5. package/README.md +1 -1
  6. package/docs/.vuepress/components/BestSaveVerificator.vue +3 -3
  7. package/docs/.vuepress/config.js +15 -1
  8. package/docs/.vuepress/dist/404.html +23 -5
  9. package/docs/.vuepress/dist/assets/css/896.styles.21a80cb6.css +1 -0
  10. package/docs/.vuepress/dist/assets/css/styles.1c48cbd0.css +10 -0
  11. package/docs/.vuepress/dist/assets/img/heat-capacitor-temperatureVsPrice.6e74905b.png +0 -0
  12. package/docs/.vuepress/dist/assets/img/node-ps-strategy-heat-capacitor-cascade-control.2e75ed9e.png +0 -0
  13. package/docs/.vuepress/dist/assets/img/node-ps-strategy-heat-capacitor-simple-flow-example.29d9bf59.png +0 -0
  14. package/docs/.vuepress/dist/assets/img/oven-setpoint-calculation.5bda0eec.png +0 -0
  15. package/docs/.vuepress/dist/assets/img/overshoot-time.b3b5d70e.png +0 -0
  16. package/docs/.vuepress/dist/assets/js/229.5c5378fa.js +1 -0
  17. package/docs/.vuepress/dist/assets/js/331.872104cd.js +1 -0
  18. package/docs/.vuepress/dist/assets/js/405.f4edd94d.js +2 -0
  19. package/docs/.vuepress/dist/assets/js/{619.8ba1b1f6.js.LICENSE.txt → 405.f4edd94d.js.LICENSE.txt} +0 -0
  20. package/docs/.vuepress/dist/assets/js/490.1e639e05.js +1 -0
  21. package/docs/.vuepress/dist/assets/js/{491.17a98f38.js → 491.bd938119.js} +1 -1
  22. package/docs/.vuepress/dist/assets/js/555.d8963d84.js +1 -0
  23. package/docs/.vuepress/dist/assets/js/{811.6a3392d5.js → 811.5f659592.js} +0 -0
  24. package/docs/.vuepress/dist/assets/js/app.dfdee6f9.js +1 -0
  25. package/docs/.vuepress/dist/assets/js/runtime~app.f6ac32d7.js +1 -0
  26. package/docs/.vuepress/dist/assets/js/v-0607240a.0193a377.js +1 -0
  27. package/docs/.vuepress/dist/assets/js/v-08683c60.52e94cb6.js +1 -0
  28. package/docs/.vuepress/dist/assets/js/v-0aca7ba6.cac5d4b9.js +1 -0
  29. package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.18561f6e.js +1 -0
  30. package/docs/.vuepress/dist/assets/js/v-1ad821fa.6697a349.js +1 -0
  31. package/docs/.vuepress/dist/assets/js/v-1b3a0ab8.c6c4e19b.js +1 -0
  32. package/docs/.vuepress/dist/assets/js/v-1e2b191e.07b8ab21.js +1 -0
  33. package/docs/.vuepress/dist/assets/js/v-29504124.00be7399.js +1 -0
  34. package/docs/.vuepress/dist/assets/js/v-30acb564.28af12af.js +1 -0
  35. package/docs/.vuepress/dist/assets/js/{v-3706649a.d7f73384.js → v-3706649a.c76d575b.js} +1 -1
  36. package/docs/.vuepress/dist/assets/js/v-4637f9e4.d334c29a.js +1 -0
  37. package/docs/.vuepress/dist/assets/js/v-4c28314d.8cbb0f9d.js +1 -0
  38. package/docs/.vuepress/dist/assets/js/v-510ed0d4.c04bc2e4.js +1 -0
  39. package/docs/.vuepress/dist/assets/js/{v-5954bcb2.937005d0.js → v-5954bcb2.dff3fc67.js} +1 -1
  40. package/docs/.vuepress/dist/assets/js/v-5db8da3a.e5e6d7a6.js +1 -0
  41. package/docs/.vuepress/dist/assets/js/v-61f728ca.81968036.js +1 -0
  42. package/docs/.vuepress/dist/assets/js/v-677dfaed.c159b0f4.js +1 -0
  43. package/docs/.vuepress/dist/assets/js/v-7446a652.8fc2c591.js +1 -0
  44. package/docs/.vuepress/dist/assets/js/v-7c87f26e.8ed52391.js +1 -0
  45. package/docs/.vuepress/dist/assets/js/v-84304104.f3f07ed3.js +1 -0
  46. package/docs/.vuepress/dist/assets/js/{v-8daa1a0e.c63afc2b.js → v-8daa1a0e.ed84ca09.js} +1 -1
  47. package/docs/.vuepress/dist/assets/js/{v-b4a42144.733e4e7c.js → v-b4a42144.9a2a0c9f.js} +1 -1
  48. package/docs/.vuepress/dist/assets/js/v-e8c55052.b7d52fc6.js +1 -0
  49. package/docs/.vuepress/dist/assets/js/v-fffb8e28.d09ab959.js +1 -0
  50. package/docs/.vuepress/dist/changelog/index.html +23 -5
  51. package/docs/.vuepress/dist/contribute/index.html +23 -5
  52. package/docs/.vuepress/dist/examples/example-cascade-temperature-control.html +304 -0
  53. package/docs/.vuepress/dist/examples/example-heat-capacitor.html +247 -0
  54. package/docs/.vuepress/dist/examples/example-next-schedule-entity.html +27 -9
  55. package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +24 -6
  56. package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +24 -6
  57. package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +24 -6
  58. package/docs/.vuepress/dist/examples/index.html +23 -5
  59. package/docs/.vuepress/dist/faq/best-save-viewer.html +23 -5
  60. package/docs/.vuepress/dist/faq/index.html +23 -5
  61. package/docs/.vuepress/dist/guide/index.html +24 -6
  62. package/docs/.vuepress/dist/index.html +23 -5
  63. package/docs/.vuepress/dist/nodes/index.html +23 -5
  64. package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +25 -7
  65. package/docs/.vuepress/dist/nodes/power-saver.html +23 -5
  66. package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +23 -5
  67. package/docs/.vuepress/dist/nodes/ps-general-add-tariff.html +23 -5
  68. package/docs/.vuepress/dist/nodes/ps-receive-price.html +26 -8
  69. package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +32 -9
  70. package/docs/.vuepress/dist/nodes/ps-strategy-heat-capacitor.html +260 -0
  71. package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +30 -7
  72. package/docs/.vuepress/dist/nodes/strategy-input.html +24 -6
  73. package/docs/README.md +1 -1
  74. package/docs/changelog/README.md +14 -0
  75. package/docs/contribute/README.md +8 -0
  76. package/docs/examples/README.md +8 -2
  77. package/docs/examples/example-cascade-temperature-control.md +346 -0
  78. package/docs/examples/example-heat-capacitor.md +271 -0
  79. package/docs/images/heat-capacitor-temperatureVsPrice.png +0 -0
  80. package/docs/images/node-ps-strategy-heat-capacitor-cascade-control.png +0 -0
  81. package/docs/images/node-ps-strategy-heat-capacitor-simple-flow-example.png +0 -0
  82. package/docs/images/node-ps-strategy-heat-capacitor.png +0 -0
  83. package/docs/images/oven-setpoint-calculation.png +0 -0
  84. package/docs/images/overshoot-time.png +0 -0
  85. package/docs/images/temperature-manipulation-config.png +0 -0
  86. package/docs/nodes/README.md +7 -1
  87. package/docs/nodes/ps-strategy-heat-capacitor.md +346 -0
  88. package/examples/add-general-tariff.json +103 -0
  89. package/examples/best-save-for-water-heater.json +140 -0
  90. package/examples/elvia-add-tariff.json +99 -0
  91. package/examples/elvia-get-tariff-types.json +58 -0
  92. package/examples/elvia-get-tariff.json +60 -0
  93. package/examples/heat-capacitor-for-room-heating.json +186 -0
  94. package/examples/lowest-price-for-heating-cables.json +159 -0
  95. package/firebase.json +6 -0
  96. package/package.json +17 -9
  97. package/public/404.html +33 -0
  98. package/public/index.html +89 -0
  99. package/src/elvia/elvia-tariff.js +2 -1
  100. package/src/handle-input.js +6 -3
  101. package/src/strategy-heat-capacitor-functions.js +246 -0
  102. package/src/strategy-heat-capacitor.html +85 -0
  103. package/src/strategy-heat-capacitor.js +125 -0
  104. package/test/data/converted-prices.json +1 -1
  105. package/test/data/multiple-trades.json +53 -0
  106. package/test/data/tibber-decreasing-24h.json +101 -0
  107. package/test/data/tibber-decreasing2-24h.json +101 -0
  108. package/test/strategy-heat-capacitor-node.test.js +183 -0
  109. package/test/strategy-heat-capacitor.test.js +103 -0
  110. package/test/strategy-lowest-price-functions.test.js +1 -1
  111. package/test/utils.test.js +0 -2
  112. package/docs/.vuepress/dist/.nojekyll +0 -0
  113. package/docs/.vuepress/dist/assets/css/563.styles.99f4a8aa.css +0 -1
  114. package/docs/.vuepress/dist/assets/css/styles.031dcf27.css +0 -9
  115. package/docs/.vuepress/dist/assets/js/262.cf2c57d2.js +0 -1
  116. package/docs/.vuepress/dist/assets/js/293.08ea5200.js +0 -1
  117. package/docs/.vuepress/dist/assets/js/331.15ee3c51.js +0 -1
  118. package/docs/.vuepress/dist/assets/js/619.8ba1b1f6.js +0 -2
  119. package/docs/.vuepress/dist/assets/js/app.b705176c.js +0 -1
  120. package/docs/.vuepress/dist/assets/js/runtime~app.47f4f812.js +0 -1
  121. package/docs/.vuepress/dist/assets/js/v-0607240a.a57c2199.js +0 -1
  122. package/docs/.vuepress/dist/assets/js/v-08683c60.ccafdcab.js +0 -1
  123. package/docs/.vuepress/dist/assets/js/v-0aca7ba6.25903946.js +0 -1
  124. package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.a6a015b4.js +0 -1
  125. package/docs/.vuepress/dist/assets/js/v-1ad821fa.5978386f.js +0 -1
  126. package/docs/.vuepress/dist/assets/js/v-1e2b191e.88dc5555.js +0 -1
  127. package/docs/.vuepress/dist/assets/js/v-29504124.4aca27d5.js +0 -1
  128. package/docs/.vuepress/dist/assets/js/v-30acb564.529a3c16.js +0 -1
  129. package/docs/.vuepress/dist/assets/js/v-4637f9e4.703b1d96.js +0 -1
  130. package/docs/.vuepress/dist/assets/js/v-510ed0d4.7b142a81.js +0 -1
  131. package/docs/.vuepress/dist/assets/js/v-5db8da3a.3de3588d.js +0 -1
  132. package/docs/.vuepress/dist/assets/js/v-61f728ca.21d432fe.js +0 -1
  133. package/docs/.vuepress/dist/assets/js/v-677dfaed.44a653b9.js +0 -1
  134. package/docs/.vuepress/dist/assets/js/v-7446a652.74b21d0b.js +0 -1
  135. package/docs/.vuepress/dist/assets/js/v-7c87f26e.ee5be992.js +0 -1
  136. package/docs/.vuepress/dist/assets/js/v-e8c55052.ab0a79ec.js +0 -1
  137. package/docs/.vuepress/dist/assets/js/v-fffb8e28.525be02a.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[254],{8800:(s,n,a)=>{a.r(n),a.d(n,{data:()=>t});const t={key:"v-84304104",path:"/examples/example-cascade-temperature-control.html",title:"Cascade temperature control",lang:"en-US",frontmatter:{},excerpt:"",headers:[{level:2,title:"Description",slug:"description",children:[{level:3,title:"An example",slug:"an-example",children:[]}]},{level:2,title:"Requirements",slug:"requirements",children:[]},{level:2,title:"Instructions",slug:"instructions",children:[]},{level:2,title:"Flow",slug:"flow",children:[]}],git:{updatedTime:1644664796e3},filePathRelative:"examples/example-cascade-temperature-control.md"}},7994:(s,n,a)=>{a.r(n),a.d(n,{default:()=>r});var t=a(6252),p=a(6953),o=a(3450),e=a(3007);const u=(0,t.uE)('<h1 id="cascade-temperature-control" tabindex="-1"><a class="header-anchor" href="#cascade-temperature-control" aria-hidden="true">#</a> Cascade temperature control</h1><h2 id="description" tabindex="-1"><a class="header-anchor" href="#description" aria-hidden="true">#</a> Description</h2><p>The controller changes the setpoint of climate entities to regulate the temperature of room with increased responsiveness, accuracy, and stability.</p><h3 id="an-example" tabindex="-1"><a class="header-anchor" href="#an-example" aria-hidden="true">#</a> An example</h3><p>A room has a temperature sensor and en electric heater. Given a setpoint temperature, the controller can make the sensor match the given value by adjusting the temperature settings of the electric heater. This type of control usually reacts faster and is more accurate then the alternative of simply changing the temperature settings of the heater. The flow requires that node-red, home assistant, and the connection to the climate entity are stable.</p><p><img src="'+p+'" alt="cascade_flow"></p><p><img src="https://deltamotion.com/support/webhelp/rmctools/Controller_Features/Control_Modes/Advanced_Control/CascadeLoop.png" alt="cascade_example"></p><p>The example utilizes a PID controller to provide a number between 0 and 1 to indicate a load on the heater</p><p>A cascade temperature controller is a controller which utilizes the input/setpoints of other controllers/climate entities to regulate to its own setpoint</p><hr><h2 id="requirements" tabindex="-1"><a class="header-anchor" href="#requirements" aria-hidden="true">#</a> Requirements</h2><ul><li><p>Home assistant integrated with Node-RED</p></li><li><p>The PID node installed - https://flows.nodered.org/node/node-red-contrib-pid</p></li><li><p>A climate entity</p></li></ul><h2 id="instructions" tabindex="-1"><a class="header-anchor" href="#instructions" aria-hidden="true">#</a> Instructions</h2><ul><li><p>Create an <code>input_number</code> entity in Home Assistant and name it &quot;cascade_setpoint&quot;</p></li><li><p>Create an <code>input_boolean</code> entity in Home Assistant and name it <code>cascade_enabled</code></p></li></ul><ul><li>When set to false, this will disengage the controller</li></ul><ul><li><p>Import the flow into Node-RED</p></li><li><p>Enter the correct sensor tempertaure entity in the <code>Temp sensor</code> node</p></li><li><p>Change the climate entity name in three places</p></li></ul><ul><li>Current climate settings - node</li><li>Set Temperature node - two places <ul><li><code>Entity ID</code></li><li><code>Data</code></li></ul></li></ul><ul><li>(optional) Change the oven setpoint range - see figure below.</li></ul><ul><li>This regulates what values the controller sends to the oven. As a default, the value sent is oven_setpoint = setpoint +- 5 degrees. That is, for a setoint of 10C, the controller will be sending setpoints between 5 and 15 C to the oven. This is further limited to whole numbers, a minimum value of 5, and a maximum value of 30.</li></ul><ul><li>(reccomended) Tune the PID controller - Detailed instructions can be found here: http://blog.clanlaw.org.uk/pid-loop-tuning.html</li></ul><ul><li>Measure the system and find the overshoot time <ul><li>Set the proportional band to <strong>zero</strong> and place the setpoint a bit above the current measured value (se figure).</li><li>Wait for the system to overshoot the target temperature and measure the time it takes for the system to return to the setpoint.</li></ul></li><li>Set the proportional band. This is the value indicates how much the measured temperature is allowed to deviate from the setpoint before max load is applied.</li><li>Spesify the integral time. A good value is two times the overshoot time.</li><li>Insert the derivative time. A good value here is half of the overshoot time.</li></ul><p><img src="'+o+'" alt="oven_setoint"><img src="'+e+'" alt="overshoot_time"></p><hr><h2 id="flow" tabindex="-1"><a class="header-anchor" href="#flow" aria-hidden="true">#</a> Flow</h2><hr><details class="custom-container details"><summary>Flow code</summary><div class="language-json ext-json"><pre class="language-json"><code><span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;tab&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;label&quot;</span><span class="token operator">:</span> <span class="token string">&quot;PID Controller - cascade&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;disabled&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;info&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;env&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;61ae0bee1a382102&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;server-state-changed&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Setpoint&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;server&quot;</span><span class="token operator">:</span> <span class="token string">&quot;e2dd69fb.8f70a8&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token property">&quot;exposeToHomeAssistant&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;haConfig&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;name&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;icon&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span> <span class="token punctuation">}</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;entityidfilter&quot;</span><span class="token operator">:</span> <span class="token string">&quot;input_number.cascade_setpoint&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;entityidfiltertype&quot;</span><span class="token operator">:</span> <span class="token string">&quot;exact&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputinitially&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;state_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;num&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;haltifstate&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;str&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_compare&quot;</span><span class="token operator">:</span> <span class="token string">&quot;is&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;output_only_on_state_change&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;for&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;num&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;minutes&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignorePrevStateNull&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignorePrevStateUnknown&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignorePrevStateUnavailable&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignoreCurrentStateUnknown&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignoreCurrentStateUnavailable&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputProperties&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;payload&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;entityState&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;data&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;eventData&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;topic&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;triggerId&quot;</span> <span class="token punctuation">}</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">120</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">100</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;f8958d382348c254&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ef1c6050d6de41c7&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;server-state-changed&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Temp. sensor&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;server&quot;</span><span class="token operator">:</span> <span class="token string">&quot;e2dd69fb.8f70a8&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token property">&quot;exposeToHomeAssistant&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;haConfig&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;name&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;icon&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span> <span class="token punctuation">}</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;entityidfilter&quot;</span><span class="token operator">:</span> <span class="token string">&quot;sensor.kjokken_temp&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;entityidfiltertype&quot;</span><span class="token operator">:</span> <span class="token string">&quot;exact&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputinitially&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;state_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;num&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;haltifstate&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;str&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_compare&quot;</span><span class="token operator">:</span> <span class="token string">&quot;is&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;output_only_on_state_change&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;for&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;num&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;seconds&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignorePrevStateNull&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignorePrevStateUnknown&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignorePrevStateUnavailable&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignoreCurrentStateUnknown&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ignoreCurrentStateUnavailable&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputProperties&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;payload&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;entityState&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;data&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;eventData&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;topic&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;triggerId&quot;</span> <span class="token punctuation">}</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">130</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">160</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;ee1904546f36bdcb&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;f8958d382348c254&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;function&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Specify topic&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;func&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg.topic = \\&quot;setpoint\\&quot;\\nflow.set(&#39;setpoint&#39;,msg.payload)\\nreturn msg&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;noerr&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token property">&quot;initialize&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;finalize&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;libs&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">270</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">100</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;6f77dd60c21180e1&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;6f77dd60c21180e1&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;PID&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;setpoint&quot;</span><span class="token operator">:</span> <span class="token string">&quot;7&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;pb&quot;</span><span class="token operator">:</span> <span class="token string">&quot;0.6&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ti&quot;</span><span class="token operator">:</span> <span class="token string">&quot;3600&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;td&quot;</span><span class="token operator">:</span> <span class="token string">&quot;900&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;integral_default&quot;</span><span class="token operator">:</span> <span class="token number">0.5</span><span class="token punctuation">,</span>\n <span class="token property">&quot;smooth_factor&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;max_interval&quot;</span><span class="token operator">:</span> <span class="token string">&quot;600&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;enable&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;disabled_op&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">430</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">140</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;ea6adedb7e2fc14e&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ea6adedb7e2fc14e&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;function&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Calc oven setpoint&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;func&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg.load = msg.payload\\n//Max adjustment is +-5 degrees\\ntemp = flow.get(&#39;setpoint&#39;)+ 5 * 2 * (msg.load-0.5)\\n//Some ovens have max and min temperature settings\\nif(temp&lt;5) {temp=5.0;}\\nif(temp&gt;30) {temp=30.0;}\\n//Many ovens cannot deal with decimals.\\ntemp = Math.round(temp)\\nmsg.heater_setpoint=temp\\nreturn msg&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;noerr&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token property">&quot;initialize&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;finalize&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;libs&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">590</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">140</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;45925567a1177d5b&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;5fa07ec0c1842823&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;api-current-state&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Current climate settings&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;server&quot;</span><span class="token operator">:</span> <span class="token string">&quot;e2dd69fb.8f70a8&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;str&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_compare&quot;</span><span class="token operator">:</span> <span class="token string">&quot;is&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;entity_id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;climate.my_climate&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;state_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;str&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;blockInputOverrides&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputProperties&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;payload&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;entityState&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;data&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;entity&quot;</span> <span class="token punctuation">}</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;for&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;num&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;minutes&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">950</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">140</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;ba7e48582e04c14c&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;0a7c09c92a01178e&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ba7e48582e04c14c&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;switch&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Not same?&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;data.attributes.temperature&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;rules&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span> <span class="token property">&quot;t&quot;</span><span class="token operator">:</span> <span class="token string">&quot;neq&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;v&quot;</span><span class="token operator">:</span> <span class="token string">&quot;heater_setpoint&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;vt&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;checkall&quot;</span><span class="token operator">:</span> <span class="token string">&quot;true&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;repair&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">1150</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">140</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;1114bb7e63d16e98&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;0a7c09c92a01178e&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1114bb7e63d16e98&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;api-call-service&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Sett temperatur&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;server&quot;</span><span class="token operator">:</span> <span class="token string">&quot;e2dd69fb.8f70a8&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token property">&quot;debugenabled&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;service_domain&quot;</span><span class="token operator">:</span> <span class="token string">&quot;climate&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;service&quot;</span><span class="token operator">:</span> <span class="token string">&quot;set_temperature&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;entityId&quot;</span><span class="token operator">:</span> <span class="token string">&quot;climate.my_climate&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token string">&quot;{\\&quot;entity_id\\&quot;:\\&quot;climate.my_climate\\&quot;,\\&quot;temperature\\&quot;:\\&quot;{{heater_setpoint}}\\&quot;}&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;dataType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;json&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;mergecontext&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;mustacheAltTags&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputProperties&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;queue&quot;</span><span class="token operator">:</span> <span class="token string">&quot;none&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">1320</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">140</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;45925567a1177d5b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;api-current-state&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Enabled?&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;server&quot;</span><span class="token operator">:</span> <span class="token string">&quot;e2dd69fb.8f70a8&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if&quot;</span><span class="token operator">:</span> <span class="token string">&quot;true&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;bool&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;halt_if_compare&quot;</span><span class="token operator">:</span> <span class="token string">&quot;is&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;entity_id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;input_boolean.cascade_enabled&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;state_type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;habool&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;blockInputOverrides&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputProperties&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;enabled&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;entityState&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;property&quot;</span><span class="token operator">:</span> <span class="token string">&quot;data&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;propertyType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;msg&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token property">&quot;valueType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;entity&quot;</span> <span class="token punctuation">}</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;for&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;num&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;forUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;minutes&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">760</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">140</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;5fa07ec0c1842823&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;0a7c09c92a01178e&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;debug&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;active&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;tosidebar&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;console&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;tostatus&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;complete&quot;</span><span class="token operator">:</span> <span class="token string">&quot;true&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;targetType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;full&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;statusVal&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;statusType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;auto&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">1330</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">240</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ee1904546f36bdcb&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;delay&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;z&quot;</span><span class="token operator">:</span> <span class="token string">&quot;29fde6c61057362b&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;pauseType&quot;</span><span class="token operator">:</span> <span class="token string">&quot;delay&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;timeout&quot;</span><span class="token operator">:</span> <span class="token string">&quot;100&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;timeoutUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;milliseconds&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;rate&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;nbRateUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;rateUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;second&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;randomFirst&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;randomLast&quot;</span><span class="token operator">:</span> <span class="token string">&quot;5&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;randomUnits&quot;</span><span class="token operator">:</span> <span class="token string">&quot;seconds&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;drop&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;allowrate&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputs&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n <span class="token property">&quot;x&quot;</span><span class="token operator">:</span> <span class="token number">290</span><span class="token punctuation">,</span>\n <span class="token property">&quot;y&quot;</span><span class="token operator">:</span> <span class="token number">160</span><span class="token punctuation">,</span>\n <span class="token property">&quot;wires&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;6f77dd60c21180e1&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token string">&quot;e2dd69fb.8f70a8&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;server&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Home Assistant&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token property">&quot;addon&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;rejectUnauthorizedCerts&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;ha_boolean&quot;</span><span class="token operator">:</span> <span class="token string">&quot;y|yes|true|on|home|open&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;connectionDelay&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;cacheJson&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;heartbeat&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;heartbeatInterval&quot;</span><span class="token operator">:</span> <span class="token string">&quot;30&quot;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">]</span>\n</code></pre></div></details>',26),c={},r=(0,a(3744).Z)(c,[["render",function(s,n){return u}]])},3744:(s,n)=>{n.Z=(s,n)=>{const a=s.__vccOpts||s;for(const[s,t]of n)a[s]=t;return a}},6953:(s,n,a)=>{s.exports=a.p+"assets/img/node-ps-strategy-heat-capacitor-cascade-control.2e75ed9e.png"},3450:(s,n,a)=>{s.exports=a.p+"assets/img/oven-setpoint-calculation.5bda0eec.png"},3007:(s,n,a)=>{s.exports=a.p+"assets/img/overshoot-time.b3b5d70e.png"}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[509],{6464:(e,t,o)=>{o.r(t),o.d(t,{data:()=>r});const r={key:"v-8daa1a0e",path:"/",title:"",lang:"en-US",frontmatter:{home:!0,heroImage:"/logo.png",heroAlt:"Power Saver",heroText:"node-red-contrib-power-saver",tagline:"A collection of nodes to Node-RED that automates saving money on variable electricity prices",actions:[{text:"Guide",link:"/guide",type:"primary"},{text:"Nodes",link:"/nodes/",type:"primary"},{text:"Examples",link:"/examples/",type:"primary"}],features:[{title:"Automatic scheduling",details:"Automatically calculate best plan and send signal to turn on and off."},{title:"Best Save Strategy",details:"Postpone power consumption when there is most to save, perfect for the water heater."},{title:"Lowest Price Strategy",details:"Turn on power when the prices are the lowest, perfect for smart charging or heating."},{title:"Add variable grid tariff",details:"Automatically add values that varies on fixed hours, or use API to get grid tariff from Elvia."},{title:"Perfect with Home Assistant",details:"Use Home Assistant with Node-RED and control switches via service calls."},{title:"Tibber and Nord Pool",details:"Painlessly use prices received from Tibber or Nord Pool."}],footer:"Created by Otto Paulsen",footerHtml:!0},excerpt:"",headers:[],filePathRelative:"README.md",git:{updatedTime:1642535555e3}}},5760:(e,t,o)=>{o.r(t),o.d(t,{default:()=>d});var r=o(6252);const a=(0,r.Uk)("This is a collection of nodes for the popular "),i={href:"https://nodered.org/",target:"_blank",rel:"noopener noreferrer"},s=(0,r.Uk)("Node-RED"),n=(0,r.Uk)(" 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."),l={},d=(0,o(3744).Z)(l,[["render",function(e,t){const o=(0,r.up)("OutboundLink"),l=(0,r.up)("DonateButtons");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r._)("p",null,[a,(0,r._)("a",i,[s,(0,r.Wm)(o)]),n]),(0,r.Wm)(l)],64)}]])},3744:(e,t)=>{t.Z=(e,t)=>{const o=e.__vccOpts||e;for(const[e,r]of t)o[e]=r;return o}}}]);
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[509],{6464:(e,t,o)=>{o.r(t),o.d(t,{data:()=>r});const r={key:"v-8daa1a0e",path:"/",title:"",lang:"en-US",frontmatter:{home:!0,heroImage:"/logo.png",heroAlt:"Power Saver",heroText:"node-red-contrib-power-saver",tagline:"A collection of nodes to Node-RED that automates saving money on variable electricity prices",actions:[{text:"Guide",link:"/guide",type:"primary"},{text:"Nodes",link:"/nodes/",type:"primary"},{text:"Examples",link:"/examples/",type:"primary"}],features:[{title:"Automatic scheduling",details:"Automatically calculate best plan and send signal to turn on and off."},{title:"Best Save Strategy",details:"Postpone power consumption when there is most to save, perfect for the water heater."},{title:"Lowest Price Strategy",details:"Turn on power when the prices are the lowest, perfect for smart charging or heating."},{title:"Add variable grid tariff",details:"Automatically add values that varies on fixed hours, or use API to get grid tariff from Elvia."},{title:"Perfect with Home Assistant",details:"Use Home Assistant with Node-RED and control switches via service calls."},{title:"Tibber and Nord Pool",details:"Painlessly use prices received from Tibber or Nord Pool."}],footer:"Created by Otto Paulsen and contributors",footerHtml:!0},excerpt:"",headers:[],git:{updatedTime:164452306e4},filePathRelative:"README.md"}},425:(e,t,o)=>{o.r(t),o.d(t,{default:()=>d});var r=o(6252);const a=(0,r.Uk)("This is a collection of nodes for the popular "),i={href:"https://nodered.org/",target:"_blank",rel:"noopener noreferrer"},n=(0,r.Uk)("Node-RED"),s=(0,r.Uk)(" 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."),l={},d=(0,o(3744).Z)(l,[["render",function(e,t){const o=(0,r.up)("ExternalLinkIcon"),l=(0,r.up)("DonateButtons");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r._)("p",null,[a,(0,r._)("a",i,[n,(0,r.Wm)(o)]),s]),(0,r.Wm)(l)],64)}]])},3744:(e,t)=>{t.Z=(e,t)=>{const o=e.__vccOpts||e;for(const[e,r]of t)o[e]=r;return o}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[407],{7952:(n,e,s)=>{s.r(e),s.d(e,{data:()=>a});const a={key:"v-b4a42144",path:"/nodes/old-power-saver-doc.html",title:"node-red-contrib-power-saver v2 (deprecated)",lang:"en-US",frontmatter:{},excerpt:"",headers:[{level:2,title:"Installation",slug:"installation",children:[]},{level:2,title:"Input",slug:"input",children:[{level:3,title:"Tibber input",slug:"tibber-input",children:[]},{level:3,title:"Nordpool input",slug:"nordpool-input",children:[]},{level:3,title:"Other input",slug:"other-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:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Algorithm",slug:"algorithm",children:[]},{level:2,title:"Integration with MagicMirror",slug:"integration-with-magicmirror",children:[]},{level:2,title:"Change Log",slug:"change-log",children:[]},{level:2,title:"Contribute",slug:"contribute",children:[]}],filePathRelative:"nodes/old-power-saver-doc.md",git:{updatedTime:1640034618e3}}},2047:(n,e,s)=>{s.r(e),s.d(e,{default:()=>tn});var a=s(6252);const t=(0,a.uE)('<h1 id="node-red-contrib-power-saver-v2-deprecated" tabindex="-1"><a class="header-anchor" href="#node-red-contrib-power-saver-v2-deprecated" aria-hidden="true">#</a> node-red-contrib-power-saver v2 (deprecated)</h1><p>A Node-RED node to save money when power prices are changing. Saving is done by postponing power consumption until the price is lower.</p><p>You can configure maximum number of hours to save in a sequence, and minimum time to recover after a maximum saving period.</p><p><img src="https://github.com/ottopaulsen/node-red-contrib-power-saver/blob/main/doc/node-red-contrib-power-saver-flow.png?raw=true" alt="Normal flow"></p><p>You can use it to control for example a heater, a water heater or any other power consumer that is acceptable to turn off now and then.</p><p>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.</p><p>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.</p><p>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.</p><p><strong>NB! WIP</strong></p><p>This node is currently rather new, and has been tried for a few weeks, enough to come in a version two with improved savings plan.</p>',10),o=(0,a.Uk)("Feel free to try it, and report back problems or ideas as "),r={href:"https://github.com/ottopaulsen/node-red-contrib-power-saver/issues",target:"_blank",rel:"noopener noreferrer"},p=(0,a.Uk)("Github issues"),l=(0,a.Uk)("."),i=(0,a.uE)('<h2 id="installation" tabindex="-1"><a class="header-anchor" href="#installation" aria-hidden="true">#</a> Installation</h2><p>Install in Node-RED via the Manage Palette menu.</p><p>May also be installed via npm:</p><p><code>npm install node-red-contrib-power-saver</code></p><p>Make sure that you upgrade now and then to get the latest version. See <a href="CHANGELOG">changelog</a> for changes.</p><h2 id="input" tabindex="-1"><a class="header-anchor" href="#input" aria-hidden="true">#</a> Input</h2><p>3 different types of input are accepted:</p><ul><li>Tibber</li><li>Nordpool</li><li>Other sources in a specific JSON format</li></ul><p>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.</p><p>From version 2.1.0, you can also send a config object as input for dynamically changing the node config.</p><h3 id="tibber-input" tabindex="-1"><a class="header-anchor" href="#tibber-input" aria-hidden="true">#</a> Tibber input</h3>',11),u=(0,a.Uk)("If you are a Tibber customer, you can use the "),c=(0,a._)("code",null,"tibber-query",-1),h=(0,a.Uk)(" node from the "),d={href:"https://flows.nodered.org/node/node-red-contrib-tibber-api",target:"_blank",rel:"noopener noreferrer"},b=(0,a._)("code",null,"node-red-contrib-tibber-api",-1),m=(0,a.Uk)(" node"),k=(0,a.Uk)(". Set it up with the following query:"),g=(0,a.uE)('<div class="language-gql ext-gql line-numbers-mode"><pre class="language-gql"><code>{\n viewer {\n homes {\n currentSubscription {\n priceInfo {\n today {\n total\n startsAt\n }\n tomorrow {\n total\n startsAt\n }\n }\n }\n }\n }\n}\n</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></div></div><p>Send the result from the <code>tibber-query</code> node with the query above directly to the <code>power-saver</code> 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.</p>',2),f=(0,a.Uk)("See example with Tibber, a switch and MQTT"),y=(0,a._)("h3",{id:"nordpool-input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#nordpool-input","aria-hidden":"true"},"#"),(0,a.Uk)(" Nordpool input")],-1),w=(0,a.Uk)("This is especially designed to work for Home Assistant (HA), and the "),q={href:"https://github.com/custom-components/nordpool",target:"_blank",rel:"noopener noreferrer"},v=(0,a.Uk)("Nord Pool custom component"),_=(0,a.Uk)(". The Nord Pool component provides a "),M=(0,a._)("em",null,"sensor",-1),T=(0,a.Uk)(" that gives price per hour for today and tomorrow (after 13:00). Send the output from this sensor directly to the "),x=(0,a._)("code",null,"power-saver",-1),U=(0,a.Uk)(" node. Make sure this is done whenever the node is updated, as well as when the system starts up."),S=(0,a._)("p",null,[(0,a.Uk)("Data can be sent from both the "),(0,a._)("code",null,"current state"),(0,a.Uk)(" node or the "),(0,a._)("code",null,"events: state"),(0,a.Uk)(" node.")],-1),O=(0,a.Uk)("See example with Nord Pool and "),I=(0,a._)("code",null,"current state",-1),N=(0,a.Uk)(" node"),W=(0,a.Uk)("See example with Nord Pool and "),A=(0,a._)("code",null,"events: state",-1),C=(0,a.Uk)(" node"),j=(0,a.uE)('<h3 id="other-input" tabindex="-1"><a class="header-anchor" href="#other-input" aria-hidden="true">#</a> Other input</h3><p>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:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>\n <span class="token property">&quot;today&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-21T00:00:00+02:00&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-21T01:00:00+02:00&quot;</span> <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;tomorrow&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-22T00:00:00+02:00&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-22T01:00:00+02:00&quot;</span> <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span>\n<span class="token punctuation">}</span>\n</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></div></div><h2 id="output" tabindex="-1"><a class="header-anchor" href="#output" aria-hidden="true">#</a> Output</h2><h3 id="output-1" tabindex="-1"><a class="header-anchor" href="#output-1" aria-hidden="true">#</a> Output 1</h3><p>A payload with the word <code>true</code> is sent to output 1 whenever the power / switch shall be turned on.</p><h3 id="output-2" tabindex="-1"><a class="header-anchor" href="#output-2" aria-hidden="true">#</a> Output 2</h3><p>A payload with the word <code>false</code> is sent to output 2 whenever the power / switch shall be turned off.</p><h3 id="output-3" tabindex="-1"><a class="header-anchor" href="#output-3" aria-hidden="true">#</a> Output 3</h3><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>\n <span class="token property">&quot;schedule&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T00:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T01:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span>\n <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;hours&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;price&quot;</span><span class="token operator">:</span> <span class="token number">1.2584</span><span class="token punctuation">,</span>\n <span class="token property">&quot;onOff&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T00:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;saving&quot;</span><span class="token operator">:</span> <span class="token number">0.2034</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;price&quot;</span><span class="token operator">:</span> <span class="token number">1.055</span><span class="token punctuation">,</span>\n <span class="token property">&quot;onOff&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T01:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;saving&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;price&quot;</span><span class="token operator">:</span> <span class="token number">1.2054</span><span class="token punctuation">,</span>\n <span class="token property">&quot;onOff&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T02:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;saving&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>\n <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;source&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Nordpool&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;config&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>\n <span class="token property">&quot;maxHoursToSaveInSequence&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minHoursOnAfterMaxSequenceSaved&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minSaving&quot;</span><span class="token operator">:</span> <span class="token number">0.001</span><span class="token punctuation">,</span>\n <span class="token property">&quot;sendCurrentValueWhenRescheduling&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputIfNoSchedule&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n</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></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="configuration" tabindex="-1"><a class="header-anchor" href="#configuration" aria-hidden="true">#</a> Configuration</h2><p>Currently there is only one strategy for saving. This is the <em>mostSaved</em> strategy. 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 of a water heater or another thermostat controlled heater.</p><p>You can configure the following:</p><ul><li>Maximum number of hours to turn off in a sequence.</li><li>Minimum hours to turn on immediately after a period when turned off the maximum number of hours that is allowed to be turned off.</li><li>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?</li><li>Wether to send on/off just after a reschedule is done without waiting until the next scheduled switch.</li><li>What to do if there is no valid schedule any more (turn on or off).</li></ul><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>\n <span class="token property">&quot;config&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>\n <span class="token property">&quot;maxHoursToSaveInSequence&quot;</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minHoursOnAfterMaxSequenceSaved&quot;</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minSaving&quot;</span><span class="token operator">:</span> <span class="token number">0.02</span><span class="token punctuation">,</span>\n <span class="token property">&quot;sendCurrentValueWhenRescheduling&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputIfNoSchedule&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;scheduleOnlyFromCurrentTime&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n</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></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, 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><h2 id="algorithm" tabindex="-1"><a class="header-anchor" href="#algorithm" aria-hidden="true">#</a> Algorithm</h2><p>The calculation that decides what hours to turn off works as follows:</p><ol><li>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.</li><li>The matrix is filled with how much you save by turning off hour x for y hours.</li><li>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.</li><li>The remaining sequences are sorted by how much that is saved, in descending order.</li><li>Next, a table with one value per hour is created, with all hours in state &quot;on&quot;.</li><li>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.</li><li>When all sequences are processed, the resulting table shows a pretty good savings plan, that in most cases would be the optimal plan.</li></ol><p>I say &quot;in most cases&quot;, 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.</p><h2 id="integration-with-magicmirror" tabindex="-1"><a class="header-anchor" href="#integration-with-magicmirror" aria-hidden="true">#</a> Integration with MagicMirror</h2>',28),H=(0,a.Uk)("Are you using "),P={href:"https://magicmirror.builders/",target:"_blank",rel:"noopener noreferrer"},E=(0,a.Uk)("MagicMirror"),G=(0,a.Uk)("? Are you also using "),L={href:"https://tibber.com/",target:"_blank",rel:"noopener noreferrer"},R=(0,a.Uk)("Tibber"),Y=(0,a.Uk)("? If so, there is a module for MM called "),D={href:"https://github.com/ottopaulsen/MMM-Tibber",target:"_blank",rel:"noopener noreferrer"},F=(0,a.Uk)("MMM-Tibber"),J=(0,a.Uk)(", that easily can be used to show savings from this node."),Q=(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),V=(0,a._)("p",null,"The purple lines show savings per kWh.",-1),Z=(0,a.Uk)("Read more about this in the "),B={href:"https://github.com/ottopaulsen/MMM-Tibber#show-savings",target:"_blank",rel:"noopener noreferrer"},z=(0,a.Uk)("MMM-Tibber documentation"),K=(0,a.Uk)("."),X=(0,a._)("h2",{id:"change-log",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#change-log","aria-hidden":"true"},"#"),(0,a.Uk)(" Change Log")],-1),$=(0,a.Uk)("See "),nn=(0,a.Uk)("CHANGELOG.md"),en=(0,a._)("h2",{id:"contribute",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#contribute","aria-hidden":"true"},"#"),(0,a.Uk)(" Contribute")],-1),sn=(0,a._)("p",null,"Contributions are welcome. Please start by creating a Github Issue with suggested changes, and state what you would like to do.",-1),an={},tn=(0,s(3744).Z)(an,[["render",function(n,e){const s=(0,a.up)("OutboundLink"),an=(0,a.up)("RouterLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[t,(0,a._)("p",null,[o,(0,a._)("a",r,[p,(0,a.Wm)(s)]),l]),i,(0,a._)("p",null,[u,c,h,(0,a._)("a",d,[b,m,(0,a.Wm)(s)]),k]),g,(0,a._)("p",null,[(0,a.Wm)(an,{to:"/nodes/doc/example-tibber-mqtt.html"},{default:(0,a.w5)((()=>[f])),_:1})]),y,(0,a._)("p",null,[w,(0,a._)("a",q,[v,(0,a.Wm)(s)]),_,M,T,x,U]),S,(0,a._)("p",null,[(0,a.Wm)(an,{to:"/nodes/doc/example-nordpool-current-state.html"},{default:(0,a.w5)((()=>[O,I,N])),_:1})]),(0,a._)("p",null,[(0,a.Wm)(an,{to:"/nodes/doc/example-nordpool-events-state.html"},{default:(0,a.w5)((()=>[W,A,C])),_:1})]),j,(0,a._)("p",null,[H,(0,a._)("a",P,[E,(0,a.Wm)(s)]),G,(0,a._)("a",L,[R,(0,a.Wm)(s)]),Y,(0,a._)("a",D,[F,(0,a.Wm)(s)]),J]),Q,V,(0,a._)("p",null,[Z,(0,a._)("a",B,[z,(0,a.Wm)(s)]),K]),X,(0,a._)("p",null,[$,(0,a.Wm)(an,{to:"/nodes/CHANGELOG.html"},{default:(0,a.w5)((()=>[nn])),_:1})]),en,sn],64)}]])},3744:(n,e)=>{e.Z=(n,e)=>{const s=n.__vccOpts||n;for(const[n,a]of e)s[n]=a;return s}}}]);
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[407],{7952:(n,e,s)=>{s.r(e),s.d(e,{data:()=>a});const a={key:"v-b4a42144",path:"/nodes/old-power-saver-doc.html",title:"node-red-contrib-power-saver v2 (deprecated)",lang:"en-US",frontmatter:{},excerpt:"",headers:[{level:2,title:"Installation",slug:"installation",children:[]},{level:2,title:"Input",slug:"input",children:[{level:3,title:"Tibber input",slug:"tibber-input",children:[]},{level:3,title:"Nordpool input",slug:"nordpool-input",children:[]},{level:3,title:"Other input",slug:"other-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:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Algorithm",slug:"algorithm",children:[]},{level:2,title:"Integration with MagicMirror",slug:"integration-with-magicmirror",children:[]},{level:2,title:"Change Log",slug:"change-log",children:[]},{level:2,title:"Contribute",slug:"contribute",children:[]}],git:{updatedTime:1640034618e3},filePathRelative:"nodes/old-power-saver-doc.md"}},1206:(n,e,s)=>{s.r(e),s.d(e,{default:()=>tn});var a=s(6252);const t=(0,a.uE)('<h1 id="node-red-contrib-power-saver-v2-deprecated" tabindex="-1"><a class="header-anchor" href="#node-red-contrib-power-saver-v2-deprecated" aria-hidden="true">#</a> node-red-contrib-power-saver v2 (deprecated)</h1><p>A Node-RED node to save money when power prices are changing. Saving is done by postponing power consumption until the price is lower.</p><p>You can configure maximum number of hours to save in a sequence, and minimum time to recover after a maximum saving period.</p><p><img src="https://github.com/ottopaulsen/node-red-contrib-power-saver/blob/main/doc/node-red-contrib-power-saver-flow.png?raw=true" alt="Normal flow"></p><p>You can use it to control for example a heater, a water heater or any other power consumer that is acceptable to turn off now and then.</p><p>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.</p><p>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.</p><p>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.</p><p><strong>NB! WIP</strong></p><p>This node is currently rather new, and has been tried for a few weeks, enough to come in a version two with improved savings plan.</p>',10),o=(0,a.Uk)("Feel free to try it, and report back problems or ideas as "),r={href:"https://github.com/ottopaulsen/node-red-contrib-power-saver/issues",target:"_blank",rel:"noopener noreferrer"},p=(0,a.Uk)("Github issues"),l=(0,a.Uk)("."),i=(0,a.uE)('<h2 id="installation" tabindex="-1"><a class="header-anchor" href="#installation" aria-hidden="true">#</a> Installation</h2><p>Install in Node-RED via the Manage Palette menu.</p><p>May also be installed via npm:</p><p><code>npm install node-red-contrib-power-saver</code></p><p>Make sure that you upgrade now and then to get the latest version. See <a href="CHANGELOG">changelog</a> for changes.</p><h2 id="input" tabindex="-1"><a class="header-anchor" href="#input" aria-hidden="true">#</a> Input</h2><p>3 different types of input are accepted:</p><ul><li>Tibber</li><li>Nordpool</li><li>Other sources in a specific JSON format</li></ul><p>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.</p><p>From version 2.1.0, you can also send a config object as input for dynamically changing the node config.</p><h3 id="tibber-input" tabindex="-1"><a class="header-anchor" href="#tibber-input" aria-hidden="true">#</a> Tibber input</h3>',11),u=(0,a.Uk)("If you are a Tibber customer, you can use the "),c=(0,a._)("code",null,"tibber-query",-1),h=(0,a.Uk)(" node from the "),d={href:"https://flows.nodered.org/node/node-red-contrib-tibber-api",target:"_blank",rel:"noopener noreferrer"},b=(0,a._)("code",null,"node-red-contrib-tibber-api",-1),m=(0,a.Uk)(" node"),k=(0,a.Uk)(". Set it up with the following query:"),g=(0,a.uE)('<div class="language-gql ext-gql line-numbers-mode"><pre class="language-gql"><code>{\n viewer {\n homes {\n currentSubscription {\n priceInfo {\n today {\n total\n startsAt\n }\n tomorrow {\n total\n startsAt\n }\n }\n }\n }\n }\n}\n</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></div></div><p>Send the result from the <code>tibber-query</code> node with the query above directly to the <code>power-saver</code> 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.</p>',2),f=(0,a.Uk)("See example with Tibber, a switch and MQTT"),y=(0,a._)("h3",{id:"nordpool-input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#nordpool-input","aria-hidden":"true"},"#"),(0,a.Uk)(" Nordpool input")],-1),w=(0,a.Uk)("This is especially designed to work for Home Assistant (HA), and the "),q={href:"https://github.com/custom-components/nordpool",target:"_blank",rel:"noopener noreferrer"},v=(0,a.Uk)("Nord Pool custom component"),_=(0,a.Uk)(". The Nord Pool component provides a "),M=(0,a._)("em",null,"sensor",-1),T=(0,a.Uk)(" that gives price per hour for today and tomorrow (after 13:00). Send the output from this sensor directly to the "),x=(0,a._)("code",null,"power-saver",-1),U=(0,a.Uk)(" node. Make sure this is done whenever the node is updated, as well as when the system starts up."),S=(0,a._)("p",null,[(0,a.Uk)("Data can be sent from both the "),(0,a._)("code",null,"current state"),(0,a.Uk)(" node or the "),(0,a._)("code",null,"events: state"),(0,a.Uk)(" node.")],-1),I=(0,a.Uk)("See example with Nord Pool and "),O=(0,a._)("code",null,"current state",-1),N=(0,a.Uk)(" node"),W=(0,a.Uk)("See example with Nord Pool and "),A=(0,a._)("code",null,"events: state",-1),C=(0,a.Uk)(" node"),j=(0,a.uE)('<h3 id="other-input" tabindex="-1"><a class="header-anchor" href="#other-input" aria-hidden="true">#</a> Other input</h3><p>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:</p><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>\n <span class="token property">&quot;today&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-21T00:00:00+02:00&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-21T01:00:00+02:00&quot;</span> <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;tomorrow&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-22T00:00:00+02:00&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span> <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-06-22T01:00:00+02:00&quot;</span> <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span>\n<span class="token punctuation">}</span>\n</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></div></div><h2 id="output" tabindex="-1"><a class="header-anchor" href="#output" aria-hidden="true">#</a> Output</h2><h3 id="output-1" tabindex="-1"><a class="header-anchor" href="#output-1" aria-hidden="true">#</a> Output 1</h3><p>A payload with the word <code>true</code> is sent to output 1 whenever the power / switch shall be turned on.</p><h3 id="output-2" tabindex="-1"><a class="header-anchor" href="#output-2" aria-hidden="true">#</a> Output 2</h3><p>A payload with the word <code>false</code> is sent to output 2 whenever the power / switch shall be turned off.</p><h3 id="output-3" tabindex="-1"><a class="header-anchor" href="#output-3" aria-hidden="true">#</a> Output 3</h3><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>\n <span class="token property">&quot;schedule&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T00:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T01:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span>\n <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;hours&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;price&quot;</span><span class="token operator">:</span> <span class="token number">1.2584</span><span class="token punctuation">,</span>\n <span class="token property">&quot;onOff&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T00:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;saving&quot;</span><span class="token operator">:</span> <span class="token number">0.2034</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;price&quot;</span><span class="token operator">:</span> <span class="token number">1.055</span><span class="token punctuation">,</span>\n <span class="token property">&quot;onOff&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T01:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;saving&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n <span class="token property">&quot;price&quot;</span><span class="token operator">:</span> <span class="token number">1.2054</span><span class="token punctuation">,</span>\n <span class="token property">&quot;onOff&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;start&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2021-09-30T02:00:00.000+02:00&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;saving&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>\n <span class="token punctuation">}</span>\n <span class="token comment">//...</span>\n <span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token property">&quot;source&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Nordpool&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;config&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>\n <span class="token property">&quot;maxHoursToSaveInSequence&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minHoursOnAfterMaxSequenceSaved&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minSaving&quot;</span><span class="token operator">:</span> <span class="token number">0.001</span><span class="token punctuation">,</span>\n <span class="token property">&quot;sendCurrentValueWhenRescheduling&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputIfNoSchedule&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n</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></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="configuration" tabindex="-1"><a class="header-anchor" href="#configuration" aria-hidden="true">#</a> Configuration</h2><p>Currently there is only one strategy for saving. This is the <em>mostSaved</em> strategy. 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 of a water heater or another thermostat controlled heater.</p><p>You can configure the following:</p><ul><li>Maximum number of hours to turn off in a sequence.</li><li>Minimum hours to turn on immediately after a period when turned off the maximum number of hours that is allowed to be turned off.</li><li>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?</li><li>Wether to send on/off just after a reschedule is done without waiting until the next scheduled switch.</li><li>What to do if there is no valid schedule any more (turn on or off).</li></ul><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>\n <span class="token property">&quot;config&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>\n <span class="token property">&quot;maxHoursToSaveInSequence&quot;</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minHoursOnAfterMaxSequenceSaved&quot;</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n <span class="token property">&quot;minSaving&quot;</span><span class="token operator">:</span> <span class="token number">0.02</span><span class="token punctuation">,</span>\n <span class="token property">&quot;sendCurrentValueWhenRescheduling&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;outputIfNoSchedule&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token property">&quot;scheduleOnlyFromCurrentTime&quot;</span><span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n</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></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, 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><h2 id="algorithm" tabindex="-1"><a class="header-anchor" href="#algorithm" aria-hidden="true">#</a> Algorithm</h2><p>The calculation that decides what hours to turn off works as follows:</p><ol><li>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.</li><li>The matrix is filled with how much you save by turning off hour x for y hours.</li><li>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.</li><li>The remaining sequences are sorted by how much that is saved, in descending order.</li><li>Next, a table with one value per hour is created, with all hours in state &quot;on&quot;.</li><li>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.</li><li>When all sequences are processed, the resulting table shows a pretty good savings plan, that in most cases would be the optimal plan.</li></ol><p>I say &quot;in most cases&quot;, 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.</p><h2 id="integration-with-magicmirror" tabindex="-1"><a class="header-anchor" href="#integration-with-magicmirror" aria-hidden="true">#</a> Integration with MagicMirror</h2>',28),H=(0,a.Uk)("Are you using "),P={href:"https://magicmirror.builders/",target:"_blank",rel:"noopener noreferrer"},E=(0,a.Uk)("MagicMirror"),G=(0,a.Uk)("? Are you also using "),L={href:"https://tibber.com/",target:"_blank",rel:"noopener noreferrer"},R=(0,a.Uk)("Tibber"),Y=(0,a.Uk)("? If so, there is a module for MM called "),D={href:"https://github.com/ottopaulsen/MMM-Tibber",target:"_blank",rel:"noopener noreferrer"},F=(0,a.Uk)("MMM-Tibber"),J=(0,a.Uk)(", that easily can be used to show savings from this node."),Q=(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),V=(0,a._)("p",null,"The purple lines show savings per kWh.",-1),Z=(0,a.Uk)("Read more about this in the "),B={href:"https://github.com/ottopaulsen/MMM-Tibber#show-savings",target:"_blank",rel:"noopener noreferrer"},z=(0,a.Uk)("MMM-Tibber documentation"),K=(0,a.Uk)("."),X=(0,a._)("h2",{id:"change-log",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#change-log","aria-hidden":"true"},"#"),(0,a.Uk)(" Change Log")],-1),$=(0,a.Uk)("See "),nn=(0,a.Uk)("CHANGELOG.md"),en=(0,a._)("h2",{id:"contribute",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#contribute","aria-hidden":"true"},"#"),(0,a.Uk)(" Contribute")],-1),sn=(0,a._)("p",null,"Contributions are welcome. Please start by creating a Github Issue with suggested changes, and state what you would like to do.",-1),an={},tn=(0,s(3744).Z)(an,[["render",function(n,e){const s=(0,a.up)("ExternalLinkIcon"),an=(0,a.up)("RouterLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[t,(0,a._)("p",null,[o,(0,a._)("a",r,[p,(0,a.Wm)(s)]),l]),i,(0,a._)("p",null,[u,c,h,(0,a._)("a",d,[b,m,(0,a.Wm)(s)]),k]),g,(0,a._)("p",null,[(0,a.Wm)(an,{to:"/nodes/doc/example-tibber-mqtt.html"},{default:(0,a.w5)((()=>[f])),_:1})]),y,(0,a._)("p",null,[w,(0,a._)("a",q,[v,(0,a.Wm)(s)]),_,M,T,x,U]),S,(0,a._)("p",null,[(0,a.Wm)(an,{to:"/nodes/doc/example-nordpool-current-state.html"},{default:(0,a.w5)((()=>[I,O,N])),_:1})]),(0,a._)("p",null,[(0,a.Wm)(an,{to:"/nodes/doc/example-nordpool-events-state.html"},{default:(0,a.w5)((()=>[W,A,C])),_:1})]),j,(0,a._)("p",null,[H,(0,a._)("a",P,[E,(0,a.Wm)(s)]),G,(0,a._)("a",L,[R,(0,a.Wm)(s)]),Y,(0,a._)("a",D,[F,(0,a.Wm)(s)]),J]),Q,V,(0,a._)("p",null,[Z,(0,a._)("a",B,[z,(0,a.Wm)(s)]),K]),X,(0,a._)("p",null,[$,(0,a.Wm)(an,{to:"/nodes/CHANGELOG.html"},{default:(0,a.w5)((()=>[nn])),_:1})]),en,sn],64)}]])},3744:(n,e)=>{e.Z=(n,e)=>{const s=n.__vccOpts||n;for(const[n,a]of e)s[n]=a;return s}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[651],{3029:(e,a,t)=>{t.r(a),t.d(a,{data:()=>r});const r={key:"v-e8c55052",path:"/nodes/",title:"Nodes",lang:"en-US",frontmatter:{},excerpt:"",headers:[{level:2,title:"Power Saver",slug:"power-saver",children:[]},{level:2,title:"Strategy nodes",slug:"strategy-nodes",children:[{level:3,title:"ps-strategy-best-save",slug:"ps-strategy-best-save",children:[]},{level:3,title:"ps-strategy-lowest-price",slug:"ps-strategy-lowest-price",children:[]},{level:3,title:"ps-strategy-heat-capacitor Experimental",slug:"ps-strategy-heat-capacitor-experimental",children:[]}]},{level:2,title:"Utility nodes",slug:"utility-nodes",children:[{level:3,title:"ps-receive-price",slug:"ps-receive-price",children:[]}]},{level:2,title:"Grid tariff nodes",slug:"grid-tariff-nodes",children:[{level:3,title:"ps-general-add-tariff",slug:"ps-general-add-tariff",children:[]},{level:3,title:"ps-elvia-add-tariff",slug:"ps-elvia-add-tariff",children:[]}]},{level:2,title:"Other nodes",slug:"other-nodes",children:[{level:3,title:"ps-elvia-tariff-types",slug:"ps-elvia-tariff-types",children:[]},{level:3,title:"ps-elvia-tariff",slug:"ps-elvia-tariff",children:[]}]}],git:{updatedTime:164452306e4},filePathRelative:"nodes/README.md"}},5262:(e,a,t)=>{t.r(a),t.d(a,{default:()=>C});var r=t(6252),s=t(7656),i=t(7188),d=t(6110),p=t(7652),n=t(3301),o=t(4693),l=t(5824);const h=(0,r._)("h1",{id:"nodes",tabindex:"-1"},[(0,r._)("a",{class:"header-anchor",href:"#nodes","aria-hidden":"true"},"#"),(0,r.Uk)(" Nodes")],-1),f=(0,r._)("p",null,"Here is an overview of the nodes, and links to detailed descriptions for eah of them.",-1),g={id:"power-saver",tabindex:"-1"},c=(0,r._)("a",{class:"header-anchor",href:"#power-saver","aria-hidden":"true"},"#",-1),v=(0,r.Uk)(),A=(0,r._)("a",{href:"./power-saver"},"Power Saver",-1),u=(0,r.Uk)(),y=(0,r.uE)('<p><img src="'+s+'" alt="Power Saver node"></p><p>The old node from version 2 is still working, but should be replaced.</p><h2 id="strategy-nodes" tabindex="-1"><a class="header-anchor" href="#strategy-nodes" aria-hidden="true">#</a> Strategy nodes</h2><p>These are the nodes used to calculate and control saving.</p><h3 id="ps-strategy-best-save" tabindex="-1"><a class="header-anchor" href="#ps-strategy-best-save" aria-hidden="true">#</a> <a href="./ps-strategy-best-save">ps-strategy-best-save</a></h3><p><img src="'+i+'" alt="ps-strategy-best-save"></p><p>Strategy to find the best hours to postpone power consumption to achieve the most saving.</p><h3 id="ps-strategy-lowest-price" tabindex="-1"><a class="header-anchor" href="#ps-strategy-lowest-price" aria-hidden="true">#</a> <a href="./ps-strategy-lowest-price">ps-strategy-lowest-price</a></h3><p><img src="'+d+'" alt="ps-strategy-lowest-price"></p><p>Strategy to find the x hours with lowest price in a given period each day.</p>',10),m={id:"ps-strategy-heat-capacitor-experimental",tabindex:"-1"},w=(0,r._)("a",{class:"header-anchor",href:"#ps-strategy-heat-capacitor-experimental","aria-hidden":"true"},"#",-1),E=(0,r.Uk)(),b=(0,r._)("a",{href:"./ps-strategy-heat-capacitor"},"ps-strategy-heat-capacitor",-1),k=(0,r.Uk)(),B=(0,r.Uk)("Experimental"),I=(0,r.uE)('<p><img src="'+p+'" alt="ps-strategy-heat-capacitor"></p><p>A strategy for moving consumption from expensive to cheap periods utilizing climate entities and trading principles.</p><h2 id="utility-nodes" tabindex="-1"><a class="header-anchor" href="#utility-nodes" aria-hidden="true">#</a> Utility nodes</h2><h3 id="ps-receive-price" tabindex="-1"><a class="header-anchor" href="#ps-receive-price" aria-hidden="true">#</a> <a href="./ps-receive-price">ps-receive-price</a></h3><p><img src="'+n+'" alt="ps-receive-price"></p><p>Node to convert different types of input data to the format used by the strategy nodes.</p><h2 id="grid-tariff-nodes" tabindex="-1"><a class="header-anchor" href="#grid-tariff-nodes" aria-hidden="true">#</a> Grid tariff nodes</h2><h3 id="ps-general-add-tariff" tabindex="-1"><a class="header-anchor" href="#ps-general-add-tariff" aria-hidden="true">#</a> <a href="./ps-general-add-tariff">ps-general-add-tariff</a></h3><p><img src="'+o+'" alt="ps-general-add-tariff"></p><p>Node to add a variable grid tariff (or any value) to the prices before sending them to the strategy nodes.</p><h3 id="ps-elvia-add-tariff" tabindex="-1"><a class="header-anchor" href="#ps-elvia-add-tariff" aria-hidden="true">#</a> <a href="./ps-elvia-add-tariff">ps-elvia-add-tariff</a></h3><p><img src="'+l+'" alt="ps-elvia-add-tariff"></p><p>Node to add Elvia grid tariff to the prices before sending them to the strategy nodes.</p><h2 id="other-nodes" tabindex="-1"><a class="header-anchor" href="#other-nodes" aria-hidden="true">#</a> Other nodes</h2><p>These are a couple of other nodes for using the Elvia API, but these are not important to the Power Saver, so they are not given any further documentation here.</p><h3 id="ps-elvia-tariff-types" tabindex="-1"><a class="header-anchor" href="#ps-elvia-tariff-types" aria-hidden="true">#</a> ps-elvia-tariff-types</h3><p>Use this to get a list of the tariff types available in the Elvia API.</p><h3 id="ps-elvia-tariff" tabindex="-1"><a class="header-anchor" href="#ps-elvia-tariff" aria-hidden="true">#</a> ps-elvia-tariff</h3><p>Use this to get the Elvia grid tariff for a selected tariff type.</p>',19),x={},C=(0,t(3744).Z)(x,[["render",function(e,a){const t=(0,r.up)("Badge");return(0,r.wg)(),(0,r.iD)(r.HY,null,[h,f,(0,r._)("h2",g,[c,v,A,u,(0,r.Wm)(t,{type:"warning",text:"deprecated",vertical:"middle"})]),y,(0,r._)("h3",m,[w,E,b,k,(0,r.Wm)(t,{type:"warning"},{default:(0,r.w5)((()=>[B])),_:1})]),I],64)}]])},3744:(e,a)=>{a.Z=(e,a)=>{const t=e.__vccOpts||e;for(const[e,r]of a)t[e]=r;return t}},7656:(e,a,t)=>{e.exports=t.p+"assets/img/node-power-saver.51ff2e5d.png"},5824:(e,a,t)=>{e.exports=t.p+"assets/img/node-ps-elvia-add-tariff.94ea2b09.png"},4693:(e,a,t)=>{e.exports=t.p+"assets/img/node-ps-general-add-tariff.a3cf6f06.png"},3301:(e,a,t)=>{e.exports=t.p+"assets/img/node-ps-receive-price.76eaa418.png"},7188:(e,a,t)=>{e.exports=t.p+"assets/img/node-ps-strategy-best-save.392292d5.png"},7652:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIgAAABNCAYAAAB9nyxVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAAGXklEQVR4Xu2dz2vcRhTH8z/tf5Cjj7mmYEyg5GRyCviUa+nFwadsE+cUwh5q7KwpFJKUsJdC6MXFCTE0JadAwaSkbZriH3mdN9JIb0ZPs9pdSZa1X8EHrBnNzFrvozdajeJcISIASlELAXCohQA41EIAHGqhxnh3RA/uf0fD4RBcYjiGHMswvmWohSGPHt6lV+Nb9OHFDfprstYK73/8iuiXr0HNnL68Se+e3aadx/dMaPV4S9RCCcvRphgOCNIsLEoVSdRCB6cizhxaAJsGgjQPZ5Jp041a6OD56iKyBwNBmoezCMc4jLtELXTwTY0WvDaAIO3AMQ7jLlELHRCk/0AQEAWCgCgQBESBIDVzvHWVBqvX6Fipm8rTa7Q+uEp7T5W6CwKC1AwEEXRSkNEKDQYrtMeBGgwsm6O8/mAjKbPMG0iD2o8dW5at0d6qGX8jLd+4XmybCXGdNgtlwbFpe+0zJGOs0IEbU/zOVtqgbVV6Kog4mXY/PeH8s5CCT/D61prfvgqRfvwMkgRLHqu1zT5rkEG0vrLPa38vFiKvc/u+EEVhZqGngsg0LU6srZv/ZGVE+okGtUAaWFUQJbBCLk8sV+eEsf0oP89BTwXxT4iXKdLgOkqDnB1TcnJL+pkqiA2Ya3eV1ksFkVOOhD+P0q/3ewu5uFyKJKjyey5XBgmOTU5QiQAzIPuZJkh45ZdPMSLI6bGSaAYx2M9h6vm4sj6q0FNBwoyRnHQ/eGmd3K9IrJ9Kgrh6l01UQYrjeG09IZJxPNmzTCUvltnpqSAr5q6eT06CvILsSU7LFzl5pf1kgeFgKdkrqzeYYB8oQnGd+8z+OEIAr86MvyWFEX0Jweaht4LIE7kUKNmQBdKm1lmAIJcUd4+R7KfZQt6T2JvcxaYXBoJcWoJvOTJ72HOwePZg+icIqBUIAqJAEBAFgoAo9Qry9jV9oU909laUNQQEaYeOCTKkk4/v6fwfw8cJfVaPSYAg7dCyIHfo3zdD+swc3lHqR3R2anrm7fQ1/Veoz4Eg7dCyIBM6Nw3t9mmi1HdckGCtZBmYS5Dt7W3bULJ9f0jPfxhDkDkoLP5dMJPdb2j7gR9fG2MTd7N5Lng7zP7+Ph0eHtLR0ZEHl42fPKHJ5KcZBNmhU77fyO45IIhW3yYsx/7e96Ux5vibLfPBk4MN0ho6uI6PqS6I2LdCXBJB7Mpp+oi7sP6RP/7238PIV2oT0uWA9LG4pQOScOaoEmOzFQXhNKM1kvAx/RbEBNJ7f8OJECztB9lGW1xzx3Ypg1SNsdlqEOS3Azo/OyFi/n5uynqSQbIpJskYVhBb5y8Sli+3J+0giP1Wk26hEH0TRE4VEpc1vPrkXdQqgngvDLUgEQRZhBkzSE4w/fR1ipn5JnWZBClIIKeRpC7MJl0UZKGbVGamr7lLJUi+n00J8huOnGJMuZ06XL3tl+su/kWnhb7mOtggTjMS9UHZmwmdueccxzumTDz3CPftcxCsxXSBhR6USbiRF7ipj9rrA4K0A8c4jLtELXTogtS/fflz5I9jgCDtUK8gv47o5I+f6+f3b/1xDBCkHeoVpEUgSDtAEBAFgoAoEAREgSAgCgQBUSBI17CP5Lvzb4shSNeQghTWftoHgnQZCDI/TQjivZxTthJryJb006u97G+y5qu0KbJPgzpelkHkynAuSdln5PL1jZVkvBpfHYAgKf47GfLdDg6UuIrlFODE8YLrjk36yIQJskHpeLL/aBv5vokTp/57FwhiCV/2KccGyRNEyBPrR5Gn/DhNkGIbKYwVJMhQdQBBLOGLP5IkMC6tr6+GgvhXrU313lWdYtrlwY6MVypIsQ0EidBaBgklkPv255IMEkwP07JBRqkgyCAz0ew9iDjhngQum0hBRNDksTa4+RWfZJNcmPh4miBhG+UeBILk1C0IkwQxJQuEk4IxwRqJoKXBrPI3WTdHxSlCHU8KIsb2RUsRQkCQgCYEmRkvmP0EgiwCBIEgUSAIBFl2IAiIAkFAlIUE4f/4/8OLG2oAmwaCNM/py5vEMQ7jLlELHePdEb0a31ID2DQQpHnePbtNHOMw7hK1UPLo4d0LySIQpFk4e+w8vmdCrMfdoRaGsCScSdoUBYI0A4vBmaOKHIxaqMGpiOcrvqkBlxeO4bRpRaIWAuBQCwFwqIUAJNCV/wHqxZ2/2166bwAAAABJRU5ErkJggg=="},6110:(e,a,t)=>{e.exports=t.p+"assets/img/node-ps-strategy-lowest-price.3a4ad347.png"}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[807],{9570:(e,t,n)=>{n.r(t),n.d(t,{data:()=>r});const r={key:"v-fffb8e28",path:"/guide/",title:"Guide",lang:"en-US",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"Introduction",slug:"introduction",children:[]},{level:2,title:"Getting started",slug:"getting-started",children:[{level:3,title:"Installation",slug:"installation",children:[]},{level:3,title:"Get price data",slug:"get-price-data",children:[]},{level:3,title:"Add grid tariff",slug:"add-grid-tariff",children:[]},{level:3,title:"Calculate and run schedule",slug:"calculate-and-run-schedule",children:[]},{level:3,title:"Use schedule signals",slug:"use-schedule-signals",children:[]},{level:3,title:"Display schedule",slug:"display-schedule",children:[]},{level:3,title:"More information",slug:"more-information",children:[]}]},{level:2,title:"Migration from v2",slug:"migration-from-v2",children:[]}],git:{updatedTime:1641408133e3},filePathRelative:"guide/README.md"}},8253:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ae});var r=n(6252),o=n(1321),a=n(3405),s=n(1758);const i=(0,r._)("h1",{id:"guide",tabindex:"-1"},[(0,r._)("a",{class:"header-anchor",href:"#guide","aria-hidden":"true"},"#"),(0,r.Uk)(" Guide")],-1),l=(0,r._)("h2",{id:"introduction",tabindex:"-1"},[(0,r._)("a",{class:"header-anchor",href:"#introduction","aria-hidden":"true"},"#"),(0,r.Uk)(" Introduction")],-1),d=(0,r.Uk)("This is a collection of nodes for the popular "),c={href:"https://nodered.org/",target:"_blank",rel:"noopener noreferrer"},u=(0,r.Uk)("Node-RED"),p=(0,r.Uk)(" 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."),h=(0,r.uE)('<p>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. There are different ways to calculate what hours to turn on and off, and these are implemented as <strong>strategies nodes</strong>. Each strategy node can be configured to fit different purposes.</p><p>The strategies need price data to work. These can be received from different sources, for example Tibber, Nord Pool or custom sources.</p><div class="custom-container warning"><p class="custom-container-title">Price sources</p><p>Tibber and Nord Pool are only available in the nordics, so if you live outside the nordics, you must find another source of price data, and make your own input.</p></div><p>Grid tariff is normally not part of the electricity price, so if this varies by the hour, it must be added before sent to the strategy nodes for calculation. This can be done by putting a <code>ps-xxx-add-tariff</code> node between the price receiver and the strategy.</p><p>The strategy nodes have 3 outputs. Output 1 is used to &quot;turn on&quot;, output 2 is used to &quot;turn off&quot;, and on output 3, the calculated schedule and some other information is sent. You can use this to make graphs, or just send it to a debug node to view it.</p><p>Example:</p><p><img src="'+o+'" alt="Example flow"></p><p>Here prices are received from Tibber, converted in the <code>ps-receive-price</code> node, then grid tariff for Elvia is added before sent to the <code>ps-strategy-best-save</code> node. Output is sent to Home Assistant via two <code>call-service</code> nodes, and the schedule is sent to a debug node.</p><div class="custom-container tip"><p class="custom-container-title">Home Assistant</p><p>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.</p></div><h2 id="getting-started" tabindex="-1"><a class="header-anchor" href="#getting-started" aria-hidden="true">#</a> Getting started</h2><h3 id="installation" tabindex="-1"><a class="header-anchor" href="#installation" aria-hidden="true">#</a> Installation</h3><p>Install in Node-RED via the Manage Palette menu.</p><p>May also be installed via npm:</p><p><code>npm install node-red-contrib-power-saver</code></p><p>Make sure that you upgrade now and then to get the latest version. See <a href="CHANGELOG">changelog</a> for changes.</p><h3 id="get-price-data" tabindex="-1"><a class="header-anchor" href="#get-price-data" aria-hidden="true">#</a> Get price data</h3><p>This solution is useless without price data. In the nordics, there are at least two very common places to get price data from:</p><ul><li>Tibber</li><li>Nord Pool</li></ul><p>The <code>ps-receive-price</code> node is designed to handle price input from both these, and convert it to the format required by the strategy nodes.</p>',19),b=(0,r.Uk)("If you are a Tibber customer, use the "),m=(0,r._)("code",null,"tibber-query",-1),f=(0,r.Uk)(" node from the "),_={href:"https://flows.nodered.org/node/node-red-contrib-tibber-api",target:"_blank",rel:"noopener noreferrer"},g=(0,r.Uk)("Tibber API"),v=(0,r.Uk)(" to receive price, with one of the following queries:"),y=(0,r._)("div",{class:"language-gql ext-gql line-numbers-mode"},[(0,r._)("pre",{class:"language-gql"},[(0,r._)("code",null,"{\n viewer {\n homes {\n id\n address {\n address1\n address2\n address3\n postalCode\n city\n country\n }\n }\n }\n}\n")]),(0,r._)("div",{class:"line-numbers"},[(0,r._)("span",{class:"line-number"},"1"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"2"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"3"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"4"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"5"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"6"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"7"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"8"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"9"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"10"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"11"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"12"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"13"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"14"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"15"),(0,r._)("br")])],-1),w=(0,r._)("div",{class:"language-gql ext-gql line-numbers-mode"},[(0,r._)("pre",{class:"language-gql"},[(0,r._)("code",null,'{\n viewer {\n home(id: "142c1670-ab43-2ab3-ba6d-723703a551e2") {\n currentSubscription{\n priceInfo{\n today {\n total\n energy\n tax\n startsAt\n }\n tomorrow {\n total\n energy\n tax\n startsAt\n }\n }\n }\n }\n }\n}\n')]),(0,r._)("div",{class:"highlight-lines"},[(0,r._)("br"),(0,r._)("br"),(0,r._)("div",{class:"highlight-line"}," "),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br"),(0,r._)("br")]),(0,r._)("div",{class:"line-numbers"},[(0,r._)("span",{class:"line-number"},"1"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"2"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"3"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"4"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"5"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"6"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"7"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"8"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"9"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"10"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"11"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"12"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"13"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"14"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"15"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"16"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"17"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"18"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"19"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"20"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"21"),(0,r._)("br"),(0,r._)("span",{class:"line-number"},"22"),(0,r._)("br")])],-1),k=(0,r._)("p",null,[(0,r.Uk)("See more details in the "),(0,r._)("a",{href:"../nodes/ps-receive-price#tibber-input"},"documentation"),(0,r.Uk)(" for the "),(0,r._)("code",null,"ps-receive-price"),(0,r.Uk)(" node.")],-1),x=(0,r.Uk)("Se documentation for "),U={href:"https://flows.nodered.org/node/node-red-contrib-tibber-api",target:"_blank",rel:"noopener noreferrer"},T=(0,r.Uk)("node-red-contrib-tibber-api"),q=(0,r.Uk)(" for details about the Tibber query."),A=(0,r._)("div",{class:"custom-container tip"},[(0,r._)("p",{class:"custom-container-title"},"Tibber query"),(0,r._)("p",null,[(0,r.Uk)("You can use an "),(0,r._)("code",null,"inject"),(0,r.Uk)(" node (standard Node-RED) to send the Tibber query as a text string int to the "),(0,r._)("code",null,"tibber-query"),(0,r.Uk)(" node. This can be set to repeat the query for example every hour.")])],-1),S=(0,r.Uk)("See example of Tibber flow and mqtt"),E=(0,r.Uk)("If you use Home Assistant (HA), you can install the "),N={href:"https://github.com/custom-components/nordpool",target:"_blank",rel:"noopener noreferrer"},I=(0,r.Uk)("Nord Pool custom component"),P=(0,r.Uk)(", that provides a "),W=(0,r._)("em",null,"sensor",-1),H=(0,r.Uk)(" that gives price per hour for today and tomorrow. Data can be sent from both the "),M=(0,r._)("code",null,"current state",-1),G=(0,r.Uk)(" node or the "),C=(0,r._)("code",null,"events: state",-1),D=(0,r.Uk)(" node."),R=(0,r.Uk)("See example with Nord Pool and "),O=(0,r._)("code",null,"current state",-1),Y=(0,r.Uk)(" node"),L=(0,r.Uk)("See example with Nord Pool and "),j=(0,r._)("code",null,"events: state",-1),B=(0,r.Uk)(" node"),Z=(0,r.uE)('<h3 id="add-grid-tariff" tabindex="-1"><a class="header-anchor" href="#add-grid-tariff" aria-hidden="true">#</a> Add grid tariff</h3><p>When also the grid tariff changes per hour, it must be added to the electricity price in order to get the calculations right.</p><p>After the the <code>ps-receive-price</code> node, add a <code>ps-xxx-add-tariff</code> node to add grid tariff. What node to choose depends on what grid you get electricity through. The following grids are supported:</p><table><thead><tr><th>Grid supplier</th><th>Node</th></tr></thead><tbody><tr><td>General (any)</td><td><code>ps-general-add-tariff</code></td></tr><tr><td>Elvia</td><td><code>ps-elvia-add-tariff</code></td></tr></tbody></table><p>If your grid is not supported, you may code this yourself.</p><div class="custom-container tip"><p class="custom-container-title">Skip this step</p><p>If the grid tariff is the same the whole day, you can skip this step i the flow.</p></div><h3 id="calculate-and-run-schedule" tabindex="-1"><a class="header-anchor" href="#calculate-and-run-schedule" aria-hidden="true">#</a> Calculate and run schedule</h3><p>This is the step where the value is produced. Based on the prices received, the optimal schedule for you is calculated automatically, based on your configuration. You can choose between the following strategies:</p><table><thead><tr><th>Strategy</th><th>Node</th><th>Description</th></tr></thead><tbody><tr><td>Best save</td><td><code>ps-strategy-best-save</code></td><td>Postpone power consumption when there is most to save.</td></tr><tr><td>Lowest price</td><td><code>ps--strategy-lowest-price</code></td><td>Turn on power when the prices are the lowest in a given period.</td></tr></tbody></table><p>These nodes must be configured for your purpose. See configuration description and other details in the documentation for each node.</p><p>Send the result from the <code>ps-xxx-add-tariff</code> node (or the <code>ps-receive-price</code> node) as input to the strategy node you choose.</p><div class="custom-container tip"><p class="custom-container-title">Choose strategy</p><p>Choose the best save strategy if you can postpone power consumption, and expect the consumption to occur during the first hour after power is turned on again.</p><p>Choose the lowest price strategy if you need the power to be on for x hours, but it is not important when that is. Note that you can select to have all hours on in one consecutive period, or spread around on the cheapest hours.</p></div><h3 id="use-schedule-signals" tabindex="-1"><a class="header-anchor" href="#use-schedule-signals" aria-hidden="true">#</a> Use schedule signals</h3><p>Use the outputs to control switches, thermostats or other entities to control your power consumers.</p><p><strong>Output 1</strong> is used to turn on. A payload with value <code>true</code> is sent every time turning on is scheduled.</p><p><strong>Output 2</strong> is used to turn off. A payload with value <code>false</code> is sent every time turning off is scheduled.</p><p>Example using Home Assistant:</p><p><img src="'+a+'" alt="Example flow"></p><div class="custom-container tip"><p class="custom-container-title">Use output</p><p>There are many ways you can use the output:</p><ul><li>Turn on/off a switch</li><li>Set a thermostat up, down or to specific values</li><li>Change setting of a dimmer</li><li>Send a notification</li></ul></div><h3 id="display-schedule" tabindex="-1"><a class="header-anchor" href="#display-schedule" aria-hidden="true">#</a> Display schedule</h3><p><strong>Output 3</strong> 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.</p><p>For users of Magic Mirror and Tibber, the <code>ps-best-save</code> node can send its schedule to the MMM-Tibber module. See more details in the <code>ps-best-save</code> node documentation.</p><h3 id="more-information" tabindex="-1"><a class="header-anchor" href="#more-information" aria-hidden="true">#</a> More information</h3>',23),F=(0,r.Uk)("There are more details and more information in the documentation for each "),z=(0,r.Uk)("node"),J=(0,r.Uk)(" and in the "),K=(0,r.Uk)("examples"),Q=(0,r.Uk)("."),V=(0,r._)("h2",{id:"migration-from-v2",tabindex:"-1"},[(0,r._)("a",{class:"header-anchor",href:"#migration-from-v2","aria-hidden":"true"},"#"),(0,r.Uk)(" Migration from v2")],-1),X=(0,r._)("p",null,[(0,r.Uk)("The "),(0,r._)("code",null,"Power Saver"),(0,r.Uk)(" node from v2 is still here, and it is working exactly as before. However, it will not be further maintained, so you should replace it. You may directly replace the "),(0,r._)("code",null,"Power Saver"),(0,r.Uk)(" node by two of the new nodes:")],-1),$=(0,r._)("p",null,[(0,r._)("img",{src:s,alt:"Migrate Power Saver"})],-1),ee=(0,r.Uk)("See more details in the "),te=(0,r.Uk)("documentation for the "),ne=(0,r._)("code",null,"ps-strategy-best-save",-1),re=(0,r.Uk)(" node."),oe={},ae=(0,n(3744).Z)(oe,[["render",function(e,t){const n=(0,r.up)("ExternalLinkIcon"),o=(0,r.up)("CodeGroupItem"),a=(0,r.up)("CodeGroup"),s=(0,r.up)("RouterLink");return(0,r.wg)(),(0,r.iD)(r.HY,null,[i,l,(0,r._)("p",null,[d,(0,r._)("a",c,[u,(0,r.Wm)(n)]),p]),h,(0,r._)("p",null,[b,m,f,(0,r._)("a",_,[g,(0,r.Wm)(n)]),v]),(0,r.Wm)(a,null,{default:(0,r.w5)((()=>[(0,r.Wm)(o,{title:"All homes"},{default:(0,r.w5)((()=>[y])),_:1}),(0,r.Wm)(o,{title:"Single home",active:""},{default:(0,r.w5)((()=>[w])),_:1})])),_:1}),k,(0,r._)("p",null,[x,(0,r._)("a",U,[T,(0,r.Wm)(n)]),q]),A,(0,r._)("p",null,[(0,r.Wm)(s,{to:"/examples/example-tibber-mqtt.html"},{default:(0,r.w5)((()=>[S])),_:1})]),(0,r._)("p",null,[E,(0,r._)("a",N,[I,(0,r.Wm)(n)]),P,W,H,M,G,C,D]),(0,r._)("p",null,[(0,r.Wm)(s,{to:"/examples/example-nordpool-current-state.html"},{default:(0,r.w5)((()=>[R,O,Y])),_:1})]),(0,r._)("p",null,[(0,r.Wm)(s,{to:"/examples/example-nordpool-events-state.html"},{default:(0,r.w5)((()=>[L,j,B])),_:1})]),Z,(0,r._)("p",null,[F,(0,r.Wm)(s,{to:"/nodes/"},{default:(0,r.w5)((()=>[z])),_:1}),J,(0,r.Wm)(s,{to:"/examples/"},{default:(0,r.w5)((()=>[K])),_:1}),Q]),V,X,$,(0,r._)("p",null,[ee,(0,r.Wm)(s,{to:"/nodes/ps-strategy-best-save.html"},{default:(0,r.w5)((()=>[te,ne])),_:1}),re])],64)}]])},3744:(e,t)=>{t.Z=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},1321:(e,t,n)=>{e.exports=n.p+"assets/img/example-flow-1.3ff3e23f.png"},3405:(e,t,n)=>{e.exports=n.p+"assets/img/example-flow-2.b653b58d.png"},1758:(e,t,n)=>{e.exports=n.p+"assets/img/migrate-best-save.f73420f6.png"}}]);