node-red-contrib-power-saver 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/docs/.vuepress/dist/404.html +2 -2
  2. package/docs/.vuepress/dist/assets/js/{app.6090e276.js → app.eae70176.js} +1 -1
  3. package/docs/.vuepress/dist/assets/js/{runtime~app.c30fcb3d.js → runtime~app.3384c251.js} +1 -1
  4. package/docs/.vuepress/dist/assets/js/{v-0b5e3c8c.34230e16.js → v-0b5e3c8c.d62b30f7.js} +1 -1
  5. package/docs/.vuepress/dist/assets/js/{v-4637f9e4.38f66bbb.js → v-4637f9e4.b67738ed.js} +1 -1
  6. package/docs/.vuepress/dist/assets/js/v-510ed0d4.528dd6f3.js +1 -0
  7. package/docs/.vuepress/dist/changelog/index.html +3 -3
  8. package/docs/.vuepress/dist/contribute/index.html +2 -2
  9. package/docs/.vuepress/dist/examples/example-next-schedule-entity.html +2 -2
  10. package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +2 -2
  11. package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +2 -2
  12. package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +2 -2
  13. package/docs/.vuepress/dist/examples/index.html +2 -2
  14. package/docs/.vuepress/dist/faq/index.html +2 -2
  15. package/docs/.vuepress/dist/guide/index.html +2 -2
  16. package/docs/.vuepress/dist/index.html +2 -2
  17. package/docs/.vuepress/dist/nodes/index.html +2 -2
  18. package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +2 -2
  19. package/docs/.vuepress/dist/nodes/power-saver.html +2 -2
  20. package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +2 -2
  21. package/docs/.vuepress/dist/nodes/ps-general-add-tariff.html +2 -2
  22. package/docs/.vuepress/dist/nodes/ps-receive-price.html +2 -2
  23. package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +6 -4
  24. package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +6 -4
  25. package/docs/.vuepress/dist/nodes/strategy-input.html +2 -2
  26. package/docs/changelog/README.md +6 -0
  27. package/docs/nodes/ps-general-add-tariff.md +2 -0
  28. package/docs/nodes/ps-strategy-best-save.md +6 -2
  29. package/docs/nodes/ps-strategy-lowest-price.md +6 -2
  30. package/package.json +1 -1
  31. package/src/elvia/elvia-add-tariff.js +5 -1
  32. package/src/handle-input.js +8 -3
  33. package/src/receive-price.js +6 -1
  34. package/test/general-add-tariff.test.js +5 -2
  35. package/test/send-config-input.test.js +44 -0
  36. package/docs/.vuepress/dist/assets/js/v-510ed0d4.f8668033.js +0 -1
@@ -5,11 +5,11 @@
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <meta name="generator" content="VuePress 2.0.0-beta.27">
7
7
  <link rel="icon" href="/euro.png"><title>Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
8
- <link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.c30fcb3d.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/css/styles.e835bef6.css" as="style"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/812.79dad458.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/app.6090e276.js" as="script">
8
+ <link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.3384c251.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/css/styles.e835bef6.css" as="style"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/812.79dad458.js" as="script"><link rel="preload" href="/node-red-contrib-power-saver/assets/js/app.eae70176.js" as="script">
9
9
  <link rel="stylesheet" href="/node-red-contrib-power-saver/assets/css/styles.e835bef6.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"><!--[--><div class="theme-container"><div class="theme-default-content"><h1>404</h1><blockquote>How did we get here?</blockquote><a href="/node-red-contrib-power-saver/" class="">Take me home</a></div></div><!----><!--]--></div>
13
- <script src="/node-red-contrib-power-saver/assets/js/runtime~app.c30fcb3d.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/812.79dad458.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/app.6090e276.js" defer></script>
13
+ <script src="/node-red-contrib-power-saver/assets/js/runtime~app.3384c251.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/812.79dad458.js" defer></script><script src="/node-red-contrib-power-saver/assets/js/app.eae70176.js" defer></script>
14
14
  </body>
15
15
  </html>
@@ -1 +1 @@
1
- "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[143],{3131:(e,t,a)=>{a.d(t,{g:()=>o});var n=a(2009),d=a(6971),s=a(1598);const o=[n.Z,d.Z,s.Z]},9947:(e,t,a)=>{a.d(t,{p:()=>n});const n=[a(3051).Z]},4611:(e,t,a)=>{a.d(t,{l:()=>o});var n=a(8866),d=a(1263),s=a(6243);const o=[n.Z,d.Z,s.Z]},4150:(e,t,a)=>{a.d(t,{Z:()=>d});var n=a(6252);const d={404:(0,n.RC)((()=>a.e(491).then(a.bind(a,8491)))),Layout:(0,n.RC)((()=>a.e(293).then(a.bind(a,3293))))}},6056:(e,t,a)=>{a.d(t,{b:()=>d});var n=a(6252);const d={"v-8daa1a0e":(0,n.RC)((()=>a.e(509).then(a.bind(a,7354)))),"v-510ed0d4":(0,n.RC)((()=>a.e(495).then(a.bind(a,8168)))),"v-7c87f26e":(0,n.RC)((()=>a.e(889).then(a.bind(a,9704)))),"v-0aca7ba6":(0,n.RC)((()=>a.e(27).then(a.bind(a,1190)))),"v-0607240a":(0,n.RC)((()=>a.e(35).then(a.bind(a,1433)))),"v-61f728ca":(0,n.RC)((()=>a.e(283).then(a.bind(a,6314)))),"v-30acb564":(0,n.RC)((()=>a.e(901).then(a.bind(a,2870)))),"v-5db8da3a":(0,n.RC)((()=>a.e(625).then(a.bind(a,3350)))),"v-7446a652":(0,n.RC)((()=>a.e(969).then(a.bind(a,3580)))),"v-fffb8e28":(0,n.RC)((()=>a.e(807).then(a.bind(a,2163)))),"v-e8c55052":(0,n.RC)((()=>a.e(651).then(a.bind(a,1173)))),"v-b4a42144":(0,n.RC)((()=>a.e(407).then(a.bind(a,2047)))),"v-1ad821fa":(0,n.RC)((()=>a.e(22).then(a.bind(a,8718)))),"v-08683c60":(0,n.RC)((()=>a.e(332).then(a.bind(a,8594)))),"v-1e2b191e":(0,n.RC)((()=>a.e(737).then(a.bind(a,3332)))),"v-677dfaed":(0,n.RC)((()=>a.e(745).then(a.bind(a,546)))),"v-0b5e3c8c":(0,n.RC)((()=>a.e(363).then(a.bind(a,3701)))),"v-4637f9e4":(0,n.RC)((()=>a.e(418).then(a.bind(a,4004)))),"v-5954bcb2":(0,n.RC)((()=>a.e(317).then(a.bind(a,886)))),"v-3706649a":(0,n.RC)((()=>a.e(88).then(a.bind(a,8109))))}},9706:(e,t,a)=>{a.d(t,{T:()=>n});const n={"v-8daa1a0e":()=>a.e(509).then(a.bind(a,6464)).then((({data:e})=>e)),"v-510ed0d4":()=>a.e(495).then(a.bind(a,3707)).then((({data:e})=>e)),"v-7c87f26e":()=>a.e(889).then(a.bind(a,9459)).then((({data:e})=>e)),"v-0aca7ba6":()=>a.e(27).then(a.bind(a,7726)).then((({data:e})=>e)),"v-0607240a":()=>a.e(35).then(a.bind(a,3811)).then((({data:e})=>e)),"v-61f728ca":()=>a.e(283).then(a.bind(a,4773)).then((({data:e})=>e)),"v-30acb564":()=>a.e(901).then(a.bind(a,8835)).then((({data:e})=>e)),"v-5db8da3a":()=>a.e(625).then(a.bind(a,8682)).then((({data:e})=>e)),"v-7446a652":()=>a.e(969).then(a.bind(a,4129)).then((({data:e})=>e)),"v-fffb8e28":()=>a.e(807).then(a.bind(a,9570)).then((({data:e})=>e)),"v-e8c55052":()=>a.e(651).then(a.bind(a,3029)).then((({data:e})=>e)),"v-b4a42144":()=>a.e(407).then(a.bind(a,7952)).then((({data:e})=>e)),"v-1ad821fa":()=>a.e(22).then(a.bind(a,2336)).then((({data:e})=>e)),"v-08683c60":()=>a.e(332).then(a.bind(a,5845)).then((({data:e})=>e)),"v-1e2b191e":()=>a.e(737).then(a.bind(a,1510)).then((({data:e})=>e)),"v-677dfaed":()=>a.e(745).then(a.bind(a,7951)).then((({data:e})=>e)),"v-0b5e3c8c":()=>a.e(363).then(a.bind(a,3594)).then((({data:e})=>e)),"v-4637f9e4":()=>a.e(418).then(a.bind(a,3959)).then((({data:e})=>e)),"v-5954bcb2":()=>a.e(317).then(a.bind(a,1535)).then((({data:e})=>e)),"v-3706649a":()=>a.e(88).then(a.bind(a,1801)).then((({data:e})=>e))}},4634:(e,t,a)=>{a.d(t,{g:()=>d});var n=a(4802);const d=[["v-8daa1a0e","/","",["/index.html","/README.md"]],["v-510ed0d4","/changelog/","Change Log",["/changelog/index.html","/changelog/README.md"]],["v-7c87f26e","/contribute/","Contribute",["/contribute/index.html","/contribute/README.md"]],["v-0aca7ba6","/examples/","Examples",["/examples/index.html","/examples/README.md"]],["v-0607240a","/examples/example-next-schedule-entity.html","Output schedule to a sensor entity",["/examples/example-next-schedule-entity","/examples/example-next-schedule-entity.md"]],["v-61f728ca","/examples/example-nordpool-current-state.html","Nord Pool and current state node",["/examples/example-nordpool-current-state","/examples/example-nordpool-current-state.md"]],["v-30acb564","/examples/example-nordpool-events-state.html","Nord Pool and events: state node",["/examples/example-nordpool-events-state","/examples/example-nordpool-events-state.md"]],["v-5db8da3a","/examples/example-tibber-mqtt.html","Tibber, a switch and MQTT",["/examples/example-tibber-mqtt","/examples/example-tibber-mqtt.md"]],["v-7446a652","/faq/","FAQ",["/faq/index.html","/faq/README.md"]],["v-fffb8e28","/guide/","Guide",["/guide/index.html","/guide/README.md"]],["v-e8c55052","/nodes/","Nodes",["/nodes/index.html","/nodes/README.md"]],["v-b4a42144","/nodes/old-power-saver-doc.html","node-red-contrib-power-saver v2 (deprecated)",["/nodes/old-power-saver-doc","/nodes/old-power-saver-doc.md"]],["v-1ad821fa","/nodes/power-saver.html","power-saver",["/nodes/power-saver","/nodes/power-saver.md"]],["v-08683c60","/nodes/ps-elvia-add-tariff.html","ps-elvia-add-tariff",["/nodes/ps-elvia-add-tariff","/nodes/ps-elvia-add-tariff.md"]],["v-1e2b191e","/nodes/ps-general-add-tariff.html","ps-general-add-tariff",["/nodes/ps-general-add-tariff","/nodes/ps-general-add-tariff.md"]],["v-677dfaed","/nodes/ps-receive-price.html","ps-receive-price",["/nodes/ps-receive-price","/nodes/ps-receive-price.md"]],["v-0b5e3c8c","/nodes/ps-strategy-best-save.html","ps-strategy-best-save",["/nodes/ps-strategy-best-save","/nodes/ps-strategy-best-save.md"]],["v-4637f9e4","/nodes/ps-strategy-lowest-price.html","ps-strategy-lowest-price",["/nodes/ps-strategy-lowest-price","/nodes/ps-strategy-lowest-price.md"]],["v-5954bcb2","/nodes/strategy-input.html","Strategy input format",["/nodes/strategy-input","/nodes/strategy-input.md"]],["v-3706649a","/404.html","",["/404"]]].reduce(((e,[t,a,d,s])=>(e.push({name:t,path:a,component:n.Y,meta:{title:d}},...s.map((e=>({path:e,redirect:a})))),e)),[{name:"404",path:"/:catchAll(.*)",component:n.Y}])},5220:(e,t,a)=>{a.d(t,{H:()=>n});const n={base:"/node-red-contrib-power-saver/",lang:"en-US",title:"Power Saver",description:"A Node-RED note to save money on hourly changing power prices",head:[["link",{rel:"icon",href:"/euro.png"}]],locales:{}}},2232:(e,t,a)=>{a.d(t,{f:()=>n});const n={contributors:!1,navbar:[{text:"Guide",link:"/guide/"},{text:"Nodes",link:"/nodes/"},{text:"Examples",link:"/examples/"},{text:"Contribute",link:"/contribute/"},{text:"Changes",link:"/changelog/"},{text:"GitHub",link:"https://github.com/ottopaulsen/node-red-contrib-power-saver"}],sidebar:{"/guide/":[{text:"Guide",children:["/guide/README.md"]}],"/nodes/":[{text:"Nodes",children:[{text:"Power Saver",link:"/nodes/power-saver.md"},{text:"Strategy nodes",children:["/nodes/ps-strategy-best-save.md","/nodes/ps-strategy-lowest-price.md"]},{text:"Utility nodes",children:["/nodes/ps-receive-price.md"]},{text:"Grid tariff nodes",children:["/nodes/ps-general-add-tariff.md","/nodes/ps-elvia-add-tariff.md"]}]},{text:"Data format",children:["/nodes/strategy-input.md"]}],"/examples/":[{text:"Examples",children:["/examples/example-nordpool-current-state.md","/examples/example-nordpool-events-state.md","/examples/example-tibber-mqtt.md"]}],"/contribute/":"auto","/changelog/":"auto"},locales:{"/":{selectLanguageName:"English"}},logo:null,darkMode:!0,repo:null,selectLanguageText:"Languages",selectLanguageAriaLabel:"Select language",sidebarDepth:2,editLink:!0,editLinkText:"Edit this page",lastUpdated:!0,lastUpdatedText:"Last Updated",contributorsText:"Contributors",notFound:["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],backToHome:"Take me home",openInNewWindow:"open in new window",toggleDarkMode:"toggle dark mode",toggleSidebar:"toggle sidebar"}}},e=>{e.O(0,[460,812],(()=>(5698,e(e.s=5698)))),e.O()}]);
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[143],{3131:(e,t,a)=>{a.d(t,{g:()=>o});var n=a(2009),d=a(6971),s=a(1598);const o=[n.Z,d.Z,s.Z]},9947:(e,t,a)=>{a.d(t,{p:()=>n});const n=[a(3051).Z]},4611:(e,t,a)=>{a.d(t,{l:()=>o});var n=a(8866),d=a(1263),s=a(6243);const o=[n.Z,d.Z,s.Z]},4150:(e,t,a)=>{a.d(t,{Z:()=>d});var n=a(6252);const d={404:(0,n.RC)((()=>a.e(491).then(a.bind(a,8491)))),Layout:(0,n.RC)((()=>a.e(293).then(a.bind(a,3293))))}},6056:(e,t,a)=>{a.d(t,{b:()=>d});var n=a(6252);const d={"v-8daa1a0e":(0,n.RC)((()=>a.e(509).then(a.bind(a,7354)))),"v-510ed0d4":(0,n.RC)((()=>a.e(495).then(a.bind(a,6926)))),"v-7c87f26e":(0,n.RC)((()=>a.e(889).then(a.bind(a,9704)))),"v-0aca7ba6":(0,n.RC)((()=>a.e(27).then(a.bind(a,1190)))),"v-0607240a":(0,n.RC)((()=>a.e(35).then(a.bind(a,1433)))),"v-61f728ca":(0,n.RC)((()=>a.e(283).then(a.bind(a,6314)))),"v-30acb564":(0,n.RC)((()=>a.e(901).then(a.bind(a,2870)))),"v-5db8da3a":(0,n.RC)((()=>a.e(625).then(a.bind(a,3350)))),"v-7446a652":(0,n.RC)((()=>a.e(969).then(a.bind(a,3580)))),"v-fffb8e28":(0,n.RC)((()=>a.e(807).then(a.bind(a,2163)))),"v-e8c55052":(0,n.RC)((()=>a.e(651).then(a.bind(a,1173)))),"v-b4a42144":(0,n.RC)((()=>a.e(407).then(a.bind(a,2047)))),"v-1ad821fa":(0,n.RC)((()=>a.e(22).then(a.bind(a,8718)))),"v-08683c60":(0,n.RC)((()=>a.e(332).then(a.bind(a,8594)))),"v-1e2b191e":(0,n.RC)((()=>a.e(737).then(a.bind(a,3332)))),"v-677dfaed":(0,n.RC)((()=>a.e(745).then(a.bind(a,546)))),"v-0b5e3c8c":(0,n.RC)((()=>a.e(363).then(a.bind(a,7723)))),"v-4637f9e4":(0,n.RC)((()=>a.e(418).then(a.bind(a,1859)))),"v-5954bcb2":(0,n.RC)((()=>a.e(317).then(a.bind(a,886)))),"v-3706649a":(0,n.RC)((()=>a.e(88).then(a.bind(a,8109))))}},9706:(e,t,a)=>{a.d(t,{T:()=>n});const n={"v-8daa1a0e":()=>a.e(509).then(a.bind(a,6464)).then((({data:e})=>e)),"v-510ed0d4":()=>a.e(495).then(a.bind(a,3707)).then((({data:e})=>e)),"v-7c87f26e":()=>a.e(889).then(a.bind(a,9459)).then((({data:e})=>e)),"v-0aca7ba6":()=>a.e(27).then(a.bind(a,7726)).then((({data:e})=>e)),"v-0607240a":()=>a.e(35).then(a.bind(a,3811)).then((({data:e})=>e)),"v-61f728ca":()=>a.e(283).then(a.bind(a,4773)).then((({data:e})=>e)),"v-30acb564":()=>a.e(901).then(a.bind(a,8835)).then((({data:e})=>e)),"v-5db8da3a":()=>a.e(625).then(a.bind(a,8682)).then((({data:e})=>e)),"v-7446a652":()=>a.e(969).then(a.bind(a,4129)).then((({data:e})=>e)),"v-fffb8e28":()=>a.e(807).then(a.bind(a,9570)).then((({data:e})=>e)),"v-e8c55052":()=>a.e(651).then(a.bind(a,3029)).then((({data:e})=>e)),"v-b4a42144":()=>a.e(407).then(a.bind(a,7952)).then((({data:e})=>e)),"v-1ad821fa":()=>a.e(22).then(a.bind(a,2336)).then((({data:e})=>e)),"v-08683c60":()=>a.e(332).then(a.bind(a,5845)).then((({data:e})=>e)),"v-1e2b191e":()=>a.e(737).then(a.bind(a,1510)).then((({data:e})=>e)),"v-677dfaed":()=>a.e(745).then(a.bind(a,7951)).then((({data:e})=>e)),"v-0b5e3c8c":()=>a.e(363).then(a.bind(a,3594)).then((({data:e})=>e)),"v-4637f9e4":()=>a.e(418).then(a.bind(a,3959)).then((({data:e})=>e)),"v-5954bcb2":()=>a.e(317).then(a.bind(a,1535)).then((({data:e})=>e)),"v-3706649a":()=>a.e(88).then(a.bind(a,1801)).then((({data:e})=>e))}},4634:(e,t,a)=>{a.d(t,{g:()=>d});var n=a(4802);const d=[["v-8daa1a0e","/","",["/index.html","/README.md"]],["v-510ed0d4","/changelog/","Change Log",["/changelog/index.html","/changelog/README.md"]],["v-7c87f26e","/contribute/","Contribute",["/contribute/index.html","/contribute/README.md"]],["v-0aca7ba6","/examples/","Examples",["/examples/index.html","/examples/README.md"]],["v-0607240a","/examples/example-next-schedule-entity.html","Output schedule to a sensor entity",["/examples/example-next-schedule-entity","/examples/example-next-schedule-entity.md"]],["v-61f728ca","/examples/example-nordpool-current-state.html","Nord Pool and current state node",["/examples/example-nordpool-current-state","/examples/example-nordpool-current-state.md"]],["v-30acb564","/examples/example-nordpool-events-state.html","Nord Pool and events: state node",["/examples/example-nordpool-events-state","/examples/example-nordpool-events-state.md"]],["v-5db8da3a","/examples/example-tibber-mqtt.html","Tibber, a switch and MQTT",["/examples/example-tibber-mqtt","/examples/example-tibber-mqtt.md"]],["v-7446a652","/faq/","FAQ",["/faq/index.html","/faq/README.md"]],["v-fffb8e28","/guide/","Guide",["/guide/index.html","/guide/README.md"]],["v-e8c55052","/nodes/","Nodes",["/nodes/index.html","/nodes/README.md"]],["v-b4a42144","/nodes/old-power-saver-doc.html","node-red-contrib-power-saver v2 (deprecated)",["/nodes/old-power-saver-doc","/nodes/old-power-saver-doc.md"]],["v-1ad821fa","/nodes/power-saver.html","power-saver",["/nodes/power-saver","/nodes/power-saver.md"]],["v-08683c60","/nodes/ps-elvia-add-tariff.html","ps-elvia-add-tariff",["/nodes/ps-elvia-add-tariff","/nodes/ps-elvia-add-tariff.md"]],["v-1e2b191e","/nodes/ps-general-add-tariff.html","ps-general-add-tariff",["/nodes/ps-general-add-tariff","/nodes/ps-general-add-tariff.md"]],["v-677dfaed","/nodes/ps-receive-price.html","ps-receive-price",["/nodes/ps-receive-price","/nodes/ps-receive-price.md"]],["v-0b5e3c8c","/nodes/ps-strategy-best-save.html","ps-strategy-best-save",["/nodes/ps-strategy-best-save","/nodes/ps-strategy-best-save.md"]],["v-4637f9e4","/nodes/ps-strategy-lowest-price.html","ps-strategy-lowest-price",["/nodes/ps-strategy-lowest-price","/nodes/ps-strategy-lowest-price.md"]],["v-5954bcb2","/nodes/strategy-input.html","Strategy input format",["/nodes/strategy-input","/nodes/strategy-input.md"]],["v-3706649a","/404.html","",["/404"]]].reduce(((e,[t,a,d,s])=>(e.push({name:t,path:a,component:n.Y,meta:{title:d}},...s.map((e=>({path:e,redirect:a})))),e)),[{name:"404",path:"/:catchAll(.*)",component:n.Y}])},5220:(e,t,a)=>{a.d(t,{H:()=>n});const n={base:"/node-red-contrib-power-saver/",lang:"en-US",title:"Power Saver",description:"A Node-RED note to save money on hourly changing power prices",head:[["link",{rel:"icon",href:"/euro.png"}]],locales:{}}},2232:(e,t,a)=>{a.d(t,{f:()=>n});const n={contributors:!1,navbar:[{text:"Guide",link:"/guide/"},{text:"Nodes",link:"/nodes/"},{text:"Examples",link:"/examples/"},{text:"Contribute",link:"/contribute/"},{text:"Changes",link:"/changelog/"},{text:"GitHub",link:"https://github.com/ottopaulsen/node-red-contrib-power-saver"}],sidebar:{"/guide/":[{text:"Guide",children:["/guide/README.md"]}],"/nodes/":[{text:"Nodes",children:[{text:"Power Saver",link:"/nodes/power-saver.md"},{text:"Strategy nodes",children:["/nodes/ps-strategy-best-save.md","/nodes/ps-strategy-lowest-price.md"]},{text:"Utility nodes",children:["/nodes/ps-receive-price.md"]},{text:"Grid tariff nodes",children:["/nodes/ps-general-add-tariff.md","/nodes/ps-elvia-add-tariff.md"]}]},{text:"Data format",children:["/nodes/strategy-input.md"]}],"/examples/":[{text:"Examples",children:["/examples/example-nordpool-current-state.md","/examples/example-nordpool-events-state.md","/examples/example-tibber-mqtt.md"]}],"/contribute/":"auto","/changelog/":"auto"},locales:{"/":{selectLanguageName:"English"}},logo:null,darkMode:!0,repo:null,selectLanguageText:"Languages",selectLanguageAriaLabel:"Select language",sidebarDepth:2,editLink:!0,editLinkText:"Edit this page",lastUpdated:!0,lastUpdatedText:"Last Updated",contributorsText:"Contributors",notFound:["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],backToHome:"Take me home",openInNewWindow:"open in new window",toggleDarkMode:"toggle dark mode",toggleSidebar:"toggle sidebar"}}},e=>{e.O(0,[460,812],(()=>(5698,e(e.s=5698)))),e.O()}]);
@@ -1 +1 @@
1
- (()=>{"use strict";var e,r,t,a={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return a[e].call(t.exports,t,t.exports,n),t.exports}n.m=a,e=[],n.O=(r,t,a,o)=>{if(!t){var d=1/0;for(c=0;c<e.length;c++){for(var[t,a,o]=e[c],f=!0,i=0;i<t.length;i++)(!1&o||d>=o)&&Object.keys(n.O).every((e=>n.O[e](t[i])))?t.splice(i--,1):(f=!1,o<d&&(d=o));if(f){e.splice(c--,1);var v=a();void 0!==v&&(r=v)}}return r}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[t,a,o]},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>"assets/js/"+({22:"v-1ad821fa",27:"v-0aca7ba6",35:"v-0607240a",88:"v-3706649a",283:"v-61f728ca",317:"v-5954bcb2",332:"v-08683c60",363:"v-0b5e3c8c",407:"v-b4a42144",418:"v-4637f9e4",495:"v-510ed0d4",509:"v-8daa1a0e",625:"v-5db8da3a",651:"v-e8c55052",737:"v-1e2b191e",745:"v-677dfaed",807:"v-fffb8e28",889:"v-7c87f26e",901:"v-30acb564",969:"v-7446a652"}[e]||e)+"."+{22:"6e2194d0",27:"b42fad7f",35:"661e1808",88:"d7f73384",283:"6fdbbb92",293:"5e967839",317:"182daf70",332:"a6b9cf5b",363:"34230e16",407:"9e5f9728",418:"38f66bbb",491:"c183eba3",495:"f8668033",509:"dde202c9",625:"f2de6cb9",651:"8384b053",737:"50b8fa18",745:"0013f083",807:"3406fd88",889:"1127dcf5",901:"f2fcd69f",969:"d05e2648"}[e]+".js",n.miniCssF=e=>{},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},t="node-red-contrib-power-saver:",n.l=(e,a,o,d)=>{if(r[e])r[e].push(a);else{var f,i;if(void 0!==o)for(var v=document.getElementsByTagName("script"),c=0;c<v.length;c++){var s=v[c];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==t+o){f=s;break}}f||(i=!0,(f=document.createElement("script")).charset="utf-8",f.timeout=120,n.nc&&f.setAttribute("nonce",n.nc),f.setAttribute("data-webpack",t+o),f.src=e),r[e]=[a];var b=(t,a)=>{f.onerror=f.onload=null,clearTimeout(l);var o=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),o&&o.forEach((e=>e(a))),t)return t(a)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=b.bind(null,f.onerror),f.onload=b.bind(null,f.onload),i&&document.head.appendChild(f)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/node-red-contrib-power-saver/",(()=>{var e={523:0,460:0};n.f.j=(r,t)=>{var a=n.o(e,r)?e[r]:void 0;if(0!==a)if(a)t.push(a[2]);else if(/^(460|523)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>a=e[r]=[t,o]));t.push(a[2]=o);var d=n.p+n.u(r),f=new Error;n.l(d,(t=>{if(n.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=t&&("load"===t.type?"missing":t.type),d=t&&t.target&&t.target.src;f.message="Loading chunk "+r+" failed.\n("+o+": "+d+")",f.name="ChunkLoadError",f.type=o,f.request=d,a[1](f)}}),"chunk-"+r,r)}},n.O.j=r=>0===e[r];var r=(r,t)=>{var a,o,[d,f,i]=t,v=0;if(d.some((r=>0!==e[r]))){for(a in f)n.o(f,a)&&(n.m[a]=f[a]);if(i)var c=i(n)}for(r&&r(t);v<d.length;v++)o=d[v],n.o(e,o)&&e[o]&&e[o][0](),e[d[v]]=0;return n.O(c)},t=self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();
1
+ (()=>{"use strict";var e,r,t,a={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return a[e].call(t.exports,t,t.exports,n),t.exports}n.m=a,e=[],n.O=(r,t,a,o)=>{if(!t){var d=1/0;for(c=0;c<e.length;c++){for(var[t,a,o]=e[c],f=!0,i=0;i<t.length;i++)(!1&o||d>=o)&&Object.keys(n.O).every((e=>n.O[e](t[i])))?t.splice(i--,1):(f=!1,o<d&&(d=o));if(f){e.splice(c--,1);var v=a();void 0!==v&&(r=v)}}return r}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[t,a,o]},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>"assets/js/"+({22:"v-1ad821fa",27:"v-0aca7ba6",35:"v-0607240a",88:"v-3706649a",283:"v-61f728ca",317:"v-5954bcb2",332:"v-08683c60",363:"v-0b5e3c8c",407:"v-b4a42144",418:"v-4637f9e4",495:"v-510ed0d4",509:"v-8daa1a0e",625:"v-5db8da3a",651:"v-e8c55052",737:"v-1e2b191e",745:"v-677dfaed",807:"v-fffb8e28",889:"v-7c87f26e",901:"v-30acb564",969:"v-7446a652"}[e]||e)+"."+{22:"6e2194d0",27:"b42fad7f",35:"661e1808",88:"d7f73384",283:"6fdbbb92",293:"5e967839",317:"182daf70",332:"a6b9cf5b",363:"d62b30f7",407:"9e5f9728",418:"b67738ed",491:"c183eba3",495:"528dd6f3",509:"dde202c9",625:"f2de6cb9",651:"8384b053",737:"50b8fa18",745:"0013f083",807:"3406fd88",889:"1127dcf5",901:"f2fcd69f",969:"d05e2648"}[e]+".js",n.miniCssF=e=>{},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},t="node-red-contrib-power-saver:",n.l=(e,a,o,d)=>{if(r[e])r[e].push(a);else{var f,i;if(void 0!==o)for(var v=document.getElementsByTagName("script"),c=0;c<v.length;c++){var s=v[c];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==t+o){f=s;break}}f||(i=!0,(f=document.createElement("script")).charset="utf-8",f.timeout=120,n.nc&&f.setAttribute("nonce",n.nc),f.setAttribute("data-webpack",t+o),f.src=e),r[e]=[a];var l=(t,a)=>{f.onerror=f.onload=null,clearTimeout(b);var o=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),o&&o.forEach((e=>e(a))),t)return t(a)},b=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),i&&document.head.appendChild(f)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/node-red-contrib-power-saver/",(()=>{var e={523:0,460:0};n.f.j=(r,t)=>{var a=n.o(e,r)?e[r]:void 0;if(0!==a)if(a)t.push(a[2]);else if(/^(460|523)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>a=e[r]=[t,o]));t.push(a[2]=o);var d=n.p+n.u(r),f=new Error;n.l(d,(t=>{if(n.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=t&&("load"===t.type?"missing":t.type),d=t&&t.target&&t.target.src;f.message="Loading chunk "+r+" failed.\n("+o+": "+d+")",f.name="ChunkLoadError",f.type=o,f.request=d,a[1](f)}}),"chunk-"+r,r)}},n.O.j=r=>0===e[r];var r=(r,t)=>{var a,o,[d,f,i]=t,v=0;if(d.some((r=>0!==e[r]))){for(a in f)n.o(f,a)&&(n.m[a]=f[a]);if(i)var c=i(n)}for(r&&r(t);v<d.length;v++)o=d[v],n.o(e,o)&&e[o]&&e[o][0](),e[d[v]]=0;return n.O(c)},t=self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();
@@ -1 +1 @@
1
- "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[363],{3594:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-0b5e3c8c",path:"/nodes/ps-strategy-best-save.html",title:"ps-strategy-best-save",lang:"en-US",frontmatter:{},excerpt:"",headers:[{level:2,title:"Description",slug:"description",children:[]},{level:2,title:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Input",slug:"input",children:[]},{level:2,title:"Output",slug:"output",children:[{level:3,title:"Output 1",slug:"output-1",children:[]},{level:3,title:"Output 2",slug:"output-2",children:[]},{level:3,title:"Output 3",slug:"output-3",children:[]}]},{level:2,title:"Algorithm",slug:"algorithm",children:[]},{level:2,title:"Integration with MagicMirror",slug:"integration-with-magicmirror",children:[]}],filePathRelative:"nodes/ps-strategy-best-save.md",git:{updatedTime:1640034618e3}}},3701:(e,n,s)=>{s.r(n),s.d(n,{default:()=>pe});var a=s(6252),t=s(7188),o=s(5442);const r=(0,a._)("h1",{id:"ps-strategy-best-save",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#ps-strategy-best-save","aria-hidden":"true"},"#"),(0,a.Uk)(" ps-strategy-best-save")],-1),l=(0,a._)("p",null,[(0,a._)("img",{src:t,alt:"ps-strategy-best-save"})],-1),i=(0,a._)("p",null,"Strategy node to postpone power consumption until the price is lower.",-1),u=(0,a._)("h2",{id:"description",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),(0,a.Uk)(" Description")],-1),p=(0,a._)("p",null,"This strategy turns off the hours where the price difference is largest compared to the next hour that is on. The idea is that the power you are not using when the switch is turned off, will be used immediately when the switch is turned on. This would fit well for turning off a water heater or another thermostat controlled heater.",-1),c=(0,a._)("p",null,[(0,a.Uk)("The picture at the bottom of the page, under "),(0,a._)("a",{href:"#integration-with-magicmirror"},"Integration with MagicMirror"),(0,a.Uk)(", illustrates this by the purple strokes, taking the price from the top of the price curve to the level of the first hour after the save-period.")],-1),_=(0,a._)("h2",{id:"configuration",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#configuration","aria-hidden":"true"},"#"),(0,a.Uk)(" Configuration")],-1),h=(0,a._)("p",null,[(0,a._)("img",{src:o,alt:"Best Save Config"})],-1),k=(0,a._)("table",null,[(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Value"),(0,a._)("th",null,"Description")])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,"Max per sequence"),(0,a._)("td",null,"Maximum number of hours to turn off in a sequence.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Min recover"),(0,a._)("td",null,"Minimum hours to turn on immediately after a period when turned off the maximum number of hours that is allowed to be turned off")]),(0,a._)("tr",null,[(0,a._)("td",null,"Min saving"),(0,a._)("td",null,"Minimum amount to save per kWh in order to bother turning it off. It is recommended to have some amount here, e.g. 2 cents / 2 øre. No point in saving 0.001, is it?")]),(0,a._)("tr",null,[(0,a._)("td",null,"Schedule for"),(0,a._)("td",null,"Select to schedule for the whole data set or only from the current hour.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Send when rescheduling"),(0,a._)("td",null,"Check this to make sure on or off output is sent immediately after rescheduling")]),(0,a._)("tr",null,[(0,a._)("td",null,"If no schedule, send"),(0,a._)("td",null,"What to do if there is no valid schedule any more (turn on or off).")])])],-1),d=(0,a._)("div",{class:"custom-container warning"},[(0,a._)("p",{class:"custom-container-title"},"Min recover"),(0,a._)("p",null,[(0,a.Uk)("NB! The "),(0,a._)("code",null,"Min recover"),(0,a.Uk)(" only has effect if the previous save-period is of length "),(0,a._)("code",null,"Max per sequence"),(0,a.Uk)(". If the save-period is shorter, the following on-period may be as short as one hour.")])],-1),b={class:"custom-container tip"},m=(0,a._)("p",{class:"custom-container-title"},"Legionella",-1),g=(0,a.Uk)("Many people ask if there is a danger that legionella bacteria will grow and become dangerous when the temperature of the water heater is lowered. As long as the water is heated to at least 65 °C every day, or at least every week, the risk of infection is not considered significant, according to the norwegian "),f={href:"https://www.fhi.no/nettpub/legionellaveilederen/",target:"_blank",rel:"noopener noreferrer"},U=(0,a.Uk)("FHI"),y=(0,a.Uk)("."),v=(0,a._)("h3",{id:"dynamic-config",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#dynamic-config","aria-hidden":"true"},"#"),(0,a.Uk)(" Dynamic config")],-1),w=(0,a._)("p",null,"It is possible to change config dynamically by sending a config message to the node. The config messages has a payload with a config object like this example:",-1),M=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token property"},'"payload"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"maxHoursToSaveInSequence"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"4"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minHoursOnAfterMaxSequenceSaved"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"2"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minSaving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.02"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"scheduleOnlyFromCurrentTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br")])],-1),x=(0,a._)("p",null,"All the variables in the config object are optional. You can send only those you want to change.",-1),T=(0,a._)("p",null,"The config sent like this will be valid until a new config is sent the same way, or until the flow is restarted. On a restart, the original config set up in the node will be used.",-1),I=(0,a._)("p",null,"When a config is sent like this, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.",-1),q=(0,a._)("h2",{id:"input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#input","aria-hidden":"true"},"#"),(0,a.Uk)(" Input")],-1),S=(0,a.Uk)("The input is the "),O=(0,a.Uk)("common strategy input format"),W=(0,a._)("h2",{id:"output",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output","aria-hidden":"true"},"#"),(0,a.Uk)(" Output")],-1),A=(0,a._)("p",null,"There are three outputs. You use only those you need for your purpose.",-1),C=(0,a._)("h3",{id:"output-1",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-1","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 1")],-1),j=(0,a._)("p",null,[(0,a.Uk)("A payload with the word "),(0,a._)("code",null,"true"),(0,a.Uk)(" is sent to output 1 whenever the power / switch shall be turned on.")],-1),D=(0,a._)("h3",{id:"output-2",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-2","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 2")],-1),H=(0,a._)("p",null,[(0,a.Uk)("A payload with the word "),(0,a._)("code",null,"false"),(0,a.Uk)(" is sent to output 2 whenever the power / switch shall be turned off.")],-1),N=(0,a._)("h3",{id:"output-3",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-3","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 3")],-1),R=(0,a._)("p",null,"When a valid input is received, and the schedule is recalculated, the resulting schedule, as well as some other information, is sent to output 3. You can use this to see the plan and verify that it meets your expectations. You can also use it to display the schedule in any way you like.",-1),Y=(0,a._)("p",null,"Example of output:",-1),L=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"schedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T00:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T01:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hours"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.2584"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T00:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.2034"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.055"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T01:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.2054"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T02:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"source"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"Nord Pool"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"maxHoursToSaveInSequence"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minHoursOnAfterMaxSequenceSaved"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"1"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minSaving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.001"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"12"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"13"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"14"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"15"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"16"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"17"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"18"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"19"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"20"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"21"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"22"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"23"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"24"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"25"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"26"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"27"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"28"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"29"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"30"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"31"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"32"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"33"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"34"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"35"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"36"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"37"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"38"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"39"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"40"),(0,a._)("br")])],-1),V=(0,a._)("p",null,[(0,a.Uk)("The "),(0,a._)("code",null,"schedule"),(0,a.Uk)(" array shows every time the switch is turned on or off. The "),(0,a._)("code",null,"hours"),(0,a.Uk)(" array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.")],-1),B=(0,a._)("h2",{id:"algorithm",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#algorithm","aria-hidden":"true"},"#"),(0,a.Uk)(" Algorithm")],-1),F=(0,a._)("p",null,"The calculation that decides what hours to turn off works as follows:",-1),P=(0,a._)("ol",null,[(0,a._)("li",null,"A matrix (x * y) is created where x is the number of hours we have price information for, and y is the configured maximum number of hours to turn off in a sequence."),(0,a._)("li",null,"The matrix is filled with how much you save by turning off hour x for y hours."),(0,a._)("li",null,"The matrix is processed calculating all possibilities for turning off a number of hours in a sequence and by that saving money. In this process all non-saving sequences are discarded. Also, if the average saving per hour is less than what you have configured as minimum amount to save per kWh, the sequence is discarded."),(0,a._)("li",null,"The remaining sequences are sorted by how much that is saved, in descending order."),(0,a._)("li",null,'Next, a table with one value per hour is created, with all hours in state "on".'),(0,a._)("li",null,"Then the saving sequences is applied one by one, turning off the hours in each sequence, discarding sequences that lead to any violation of the rules set by the config."),(0,a._)("li",null,"When all sequences are processed, the resulting table shows a pretty good savings plan, that in most cases would be the optimal plan.")],-1),Z=(0,a._)("p",null,'I say "in most cases", because there is a chance that a group of two or more sequences combined can give a better plan than a single sequence preceeding those two, but where the selection of the one sequence causes the group to be discarded. If anyone encounters this situation, I would be happy to receive the price data set, and try to improve the algorithm even further.',-1),E=(0,a._)("h2",{id:"integration-with-magicmirror",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#integration-with-magicmirror","aria-hidden":"true"},"#"),(0,a.Uk)(" Integration with MagicMirror")],-1),z=(0,a.Uk)("Are you using "),G={href:"https://magicmirror.builders/",target:"_blank",rel:"noopener noreferrer"},J=(0,a.Uk)("MagicMirror"),K=(0,a.Uk)("? Are you also using "),Q={href:"https://tibber.com/",target:"_blank",rel:"noopener noreferrer"},X=(0,a.Uk)("Tibber"),$=(0,a.Uk)("? If so, there is a module for MM called "),ee={href:"https://github.com/ottopaulsen/MMM-Tibber",target:"_blank",rel:"noopener noreferrer"},ne=(0,a.Uk)("MMM-Tibber"),se=(0,a.Uk)(", that easily can be used to show savings from this node."),ae=(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),te=(0,a._)("p",null,"The purple lines show savings per kWh.",-1),oe=(0,a.Uk)("Read more about this in the "),re={href:"https://github.com/ottopaulsen/MMM-Tibber#show-savings",target:"_blank",rel:"noopener noreferrer"},le=(0,a.Uk)("MMM-Tibber documentation"),ie=(0,a.Uk)("."),ue={},pe=(0,s(3744).Z)(ue,[["render",function(e,n){const s=(0,a.up)("OutboundLink"),t=(0,a.up)("RouterLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[r,l,i,u,p,c,_,h,k,d,(0,a._)("div",b,[m,(0,a._)("p",null,[g,(0,a._)("a",f,[U,(0,a.Wm)(s)]),y])]),v,w,M,x,T,I,q,(0,a._)("p",null,[S,(0,a.Wm)(t,{to:"/nodes/strategy-input.html"},{default:(0,a.w5)((()=>[O])),_:1})]),W,A,C,j,D,H,N,R,Y,L,V,B,F,P,Z,E,(0,a._)("p",null,[z,(0,a._)("a",G,[J,(0,a.Wm)(s)]),K,(0,a._)("a",Q,[X,(0,a.Wm)(s)]),$,(0,a._)("a",ee,[ne,(0,a.Wm)(s)]),se]),ae,te,(0,a._)("p",null,[oe,(0,a._)("a",re,[le,(0,a.Wm)(s)]),ie])],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}},5442:(e,n,s)=>{e.exports=s.p+"assets/img/best-save-config.93fa3c21.png"},7188:(e,n,s)=>{e.exports=s.p+"assets/img/node-ps-strategy-best-save.392292d5.png"}}]);
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[363],{3594:(e,n,s)=>{s.r(n),s.d(n,{data:()=>a});const a={key:"v-0b5e3c8c",path:"/nodes/ps-strategy-best-save.html",title:"ps-strategy-best-save",lang:"en-US",frontmatter:{},excerpt:"",headers:[{level:2,title:"Description",slug:"description",children:[]},{level:2,title:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Input",slug:"input",children:[]},{level:2,title:"Output",slug:"output",children:[{level:3,title:"Output 1",slug:"output-1",children:[]},{level:3,title:"Output 2",slug:"output-2",children:[]},{level:3,title:"Output 3",slug:"output-3",children:[]}]},{level:2,title:"Algorithm",slug:"algorithm",children:[]},{level:2,title:"Integration with MagicMirror",slug:"integration-with-magicmirror",children:[]}],filePathRelative:"nodes/ps-strategy-best-save.md",git:{updatedTime:1641510047e3}}},7723:(e,n,s)=>{s.r(n),s.d(n,{default:()=>ue});var a=s(6252),t=s(7188),o=s(5442);const r=(0,a._)("h1",{id:"ps-strategy-best-save",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#ps-strategy-best-save","aria-hidden":"true"},"#"),(0,a.Uk)(" ps-strategy-best-save")],-1),l=(0,a._)("p",null,[(0,a._)("img",{src:t,alt:"ps-strategy-best-save"})],-1),i=(0,a._)("p",null,"Strategy node to postpone power consumption until the price is lower.",-1),p=(0,a._)("h2",{id:"description",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),(0,a.Uk)(" Description")],-1),u=(0,a._)("p",null,"This strategy turns off the hours where the price difference is largest compared to the next hour that is on. The idea is that the power you are not using when the switch is turned off, will be used immediately when the switch is turned on. This would fit well for turning off a water heater or another thermostat controlled heater.",-1),c=(0,a._)("p",null,[(0,a.Uk)("The picture at the bottom of the page, under "),(0,a._)("a",{href:"#integration-with-magicmirror"},"Integration with MagicMirror"),(0,a.Uk)(", illustrates this by the purple strokes, taking the price from the top of the price curve to the level of the first hour after the save-period.")],-1),_=(0,a._)("h2",{id:"configuration",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#configuration","aria-hidden":"true"},"#"),(0,a.Uk)(" Configuration")],-1),h=(0,a._)("p",null,[(0,a._)("img",{src:o,alt:"Best Save Config"})],-1),k=(0,a._)("table",null,[(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Value"),(0,a._)("th",null,"Description")])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,"Max per sequence"),(0,a._)("td",null,"Maximum number of hours to turn off in a sequence.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Min recover"),(0,a._)("td",null,"Minimum hours to turn on immediately after a period when turned off the maximum number of hours that is allowed to be turned off")]),(0,a._)("tr",null,[(0,a._)("td",null,"Min saving"),(0,a._)("td",null,"Minimum amount to save per kWh in order to bother turning it off. It is recommended to have some amount here, e.g. 2 cents / 2 øre. No point in saving 0.001, is it?")]),(0,a._)("tr",null,[(0,a._)("td",null,"Schedule for"),(0,a._)("td",null,"Select to schedule for the whole data set or only from the current hour.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Send when rescheduling"),(0,a._)("td",null,"Check this to make sure on or off output is sent immediately after rescheduling")]),(0,a._)("tr",null,[(0,a._)("td",null,"If no schedule, send"),(0,a._)("td",null,"What to do if there is no valid schedule any more (turn on or off).")])])],-1),d=(0,a._)("div",{class:"custom-container warning"},[(0,a._)("p",{class:"custom-container-title"},"Min recover"),(0,a._)("p",null,[(0,a.Uk)("NB! The "),(0,a._)("code",null,"Min recover"),(0,a.Uk)(" only has effect if the previous save-period is of length "),(0,a._)("code",null,"Max per sequence"),(0,a.Uk)(". If the save-period is shorter, the following on-period may be as short as one hour.")])],-1),b={class:"custom-container tip"},m=(0,a._)("p",{class:"custom-container-title"},"Legionella",-1),g=(0,a.Uk)("Many people ask if there is a danger that legionella bacteria will grow and become dangerous when the temperature of the water heater is lowered. As long as the water is heated to at least 65 °C every day, or at least every week, the risk of infection is not considered significant, according to the norwegian "),f={href:"https://www.fhi.no/nettpub/legionellaveilederen/",target:"_blank",rel:"noopener noreferrer"},U=(0,a.Uk)("FHI"),y=(0,a.Uk)("."),v=(0,a._)("h3",{id:"dynamic-config",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#dynamic-config","aria-hidden":"true"},"#"),(0,a.Uk)(" Dynamic config")],-1),w=(0,a._)("p",null,"It is possible to change config dynamically by sending a config message to the node. The config messages has a payload with a config object like this example:",-1),M=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token property"},'"payload"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"maxHoursToSaveInSequence"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"4"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minHoursOnAfterMaxSequenceSaved"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"2"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minSaving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.02"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"scheduleOnlyFromCurrentTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br")])],-1),x=(0,a._)("p",null,"All the variables in the config object are optional. You can send only those you want to change.",-1),T=(0,a._)("p",null,"The config sent like this will be valid until a new config is sent the same way, or until the flow is restarted. On a restart, the original config set up in the node will be used.",-1),I=(0,a._)("p",null,"When a config is sent like this, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.",-1),q=(0,a._)("h2",{id:"input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#input","aria-hidden":"true"},"#"),(0,a.Uk)(" Input")],-1),S=(0,a.Uk)("The input is the "),O=(0,a.Uk)("common strategy input format"),W=(0,a._)("h2",{id:"output",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output","aria-hidden":"true"},"#"),(0,a.Uk)(" Output")],-1),A=(0,a._)("p",null,"There are three outputs. You use only those you need for your purpose.",-1),C=(0,a._)("h3",{id:"output-1",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-1","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 1")],-1),j=(0,a._)("p",null,[(0,a.Uk)("A payload with the word "),(0,a._)("code",null,"true"),(0,a.Uk)(" is sent to output 1 whenever the power / switch shall be turned on.")],-1),D=(0,a._)("h3",{id:"output-2",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-2","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 2")],-1),H=(0,a._)("p",null,[(0,a.Uk)("A payload with the word "),(0,a._)("code",null,"false"),(0,a.Uk)(" is sent to output 2 whenever the power / switch shall be turned off.")],-1),N=(0,a._)("h3",{id:"output-3",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output-3","aria-hidden":"true"},"#"),(0,a.Uk)(" Output 3")],-1),R=(0,a._)("p",null,"When a valid input is received, and the schedule is recalculated, the resulting schedule, as well as some other information, is sent to output 3. You can use this to see the plan and verify that it meets your expectations. You can also use it to display the schedule in any way you like.",-1),Y=(0,a._)("p",null,"Example of output:",-1),L=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"schedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T00:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T01:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hours"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.2584"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T00:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.2034"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.055"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T01:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"1.2054"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T02:00:00.000+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"source"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"Nord Pool"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"maxHoursToSaveInSequence"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minHoursOnAfterMaxSequenceSaved"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"1"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"minSaving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.001"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T23:45:12.123+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"version"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"3.1.2"'),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"12"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"13"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"14"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"15"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"16"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"17"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"18"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"19"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"20"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"21"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"22"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"23"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"24"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"25"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"26"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"27"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"28"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"29"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"30"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"31"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"32"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"33"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"34"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"35"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"36"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"37"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"38"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"39"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"40"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"41"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"42"),(0,a._)("br")])],-1),V=(0,a._)("p",null,[(0,a.Uk)("The "),(0,a._)("code",null,"schedule"),(0,a.Uk)(" array shows every time the switch is turned on or off. The "),(0,a._)("code",null,"hours"),(0,a.Uk)(" array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.")],-1),B=(0,a._)("h2",{id:"algorithm",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#algorithm","aria-hidden":"true"},"#"),(0,a.Uk)(" Algorithm")],-1),F=(0,a._)("p",null,"The calculation that decides what hours to turn off works as follows:",-1),P=(0,a._)("ol",null,[(0,a._)("li",null,"A matrix (x * y) is created where x is the number of hours we have price information for, and y is the configured maximum number of hours to turn off in a sequence."),(0,a._)("li",null,"The matrix is filled with how much you save by turning off hour x for y hours."),(0,a._)("li",null,"The matrix is processed calculating all possibilities for turning off a number of hours in a sequence and by that saving money. In this process all non-saving sequences are discarded. Also, if the average saving per hour is less than what you have configured as minimum amount to save per kWh, the sequence is discarded."),(0,a._)("li",null,"The remaining sequences are sorted by how much that is saved, in descending order."),(0,a._)("li",null,'Next, a table with one value per hour is created, with all hours in state "on".'),(0,a._)("li",null,"Then the saving sequences is applied one by one, turning off the hours in each sequence, discarding sequences that lead to any violation of the rules set by the config."),(0,a._)("li",null,"When all sequences are processed, the resulting table shows a pretty good savings plan, that in most cases would be the optimal plan.")],-1),Z=(0,a._)("p",null,'I say "in most cases", because there is a chance that a group of two or more sequences combined can give a better plan than a single sequence preceeding those two, but where the selection of the one sequence causes the group to be discarded. If anyone encounters this situation, I would be happy to receive the price data set, and try to improve the algorithm even further.',-1),E=(0,a._)("h2",{id:"integration-with-magicmirror",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#integration-with-magicmirror","aria-hidden":"true"},"#"),(0,a.Uk)(" Integration with MagicMirror")],-1),z=(0,a.Uk)("Are you using "),G={href:"https://magicmirror.builders/",target:"_blank",rel:"noopener noreferrer"},J=(0,a.Uk)("MagicMirror"),K=(0,a.Uk)("? Are you also using "),Q={href:"https://tibber.com/",target:"_blank",rel:"noopener noreferrer"},X=(0,a.Uk)("Tibber"),$=(0,a.Uk)("? If so, there is a module for MM called "),ee={href:"https://github.com/ottopaulsen/MMM-Tibber",target:"_blank",rel:"noopener noreferrer"},ne=(0,a.Uk)("MMM-Tibber"),se=(0,a.Uk)(", that easily can be used to show savings from this node."),ae=(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),te=(0,a._)("p",null,"The purple lines show savings per kWh.",-1),oe=(0,a.Uk)("Read more about this in the "),re={href:"https://github.com/ottopaulsen/MMM-Tibber#show-savings",target:"_blank",rel:"noopener noreferrer"},le=(0,a.Uk)("MMM-Tibber documentation"),ie=(0,a.Uk)("."),pe={},ue=(0,s(3744).Z)(pe,[["render",function(e,n){const s=(0,a.up)("OutboundLink"),t=(0,a.up)("RouterLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[r,l,i,p,u,c,_,h,k,d,(0,a._)("div",b,[m,(0,a._)("p",null,[g,(0,a._)("a",f,[U,(0,a.Wm)(s)]),y])]),v,w,M,x,T,I,q,(0,a._)("p",null,[S,(0,a.Wm)(t,{to:"/nodes/strategy-input.html"},{default:(0,a.w5)((()=>[O])),_:1})]),W,A,C,j,D,H,N,R,Y,L,V,B,F,P,Z,E,(0,a._)("p",null,[z,(0,a._)("a",G,[J,(0,a.Wm)(s)]),K,(0,a._)("a",Q,[X,(0,a.Wm)(s)]),$,(0,a._)("a",ee,[ne,(0,a.Wm)(s)]),se]),ae,te,(0,a._)("p",null,[oe,(0,a._)("a",re,[le,(0,a.Wm)(s)]),ie])],64)}]])},3744:(e,n)=>{n.Z=(e,n)=>{const s=e.__vccOpts||e;for(const[e,a]of n)s[e]=a;return s}},5442:(e,n,s)=>{e.exports=s.p+"assets/img/best-save-config.93fa3c21.png"},7188:(e,n,s)=>{e.exports=s.p+"assets/img/node-ps-strategy-best-save.392292d5.png"}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[418],{3959:(n,s,e)=>{e.r(s),e.d(s,{data:()=>a});const a={key:"v-4637f9e4",path:"/nodes/ps-strategy-lowest-price.html",title:"ps-strategy-lowest-price",lang:"en-US",frontmatter:{next:"./ps-receive-price.md"},excerpt:"",headers:[{level:2,title:"Description",slug:"description",children:[]},{level:2,title:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Input",slug:"input",children:[]},{level:2,title:"Output",slug:"output",children:[]},{level:2,title:"Tips & tricks",slug:"tips-tricks",children:[{level:3,title:"Multiple nodes works together",slug:"multiple-nodes-works-together",children:[]},{level:3,title:"Highest price",slug:"highest-price",children:[]}]}],filePathRelative:"nodes/ps-strategy-lowest-price.md",git:{updatedTime:1640034618e3}}},4004:(n,s,e)=>{e.r(s),e.d(s,{default:()=>V});var a=e(6252),t=e(6110),o=e(3981);const l=(0,a._)("h1",{id:"ps-strategy-lowest-price",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#ps-strategy-lowest-price","aria-hidden":"true"},"#"),(0,a.Uk)(" ps-strategy-lowest-price")],-1),r=(0,a._)("p",null,[(0,a._)("img",{src:t,alt:"ps-strategy-lowest-price"})],-1),p=(0,a._)("p",null,"Strategy node to turn on power the hours when the price is lowest during a given period, and turn off the other hours.",-1),c=(0,a._)("h2",{id:"description",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),(0,a.Uk)(" Description")],-1),i=(0,a._)("p",null,"The node can work on a specific period from 1 to 24 hours during a 24 hour period. Inside this period, you can decide how many hours that shall be on. The rest of the period will be off. Outside the period, you can select that the output shall be either on or off. You can also decide that the hours on shall be consecutive (one continuous period) or spread around in multiple on-periods.",-1),u=(0,a._)("h2",{id:"configuration",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#configuration","aria-hidden":"true"},"#"),(0,a.Uk)(" Configuration")],-1),_=(0,a._)("p",null,[(0,a._)("img",{src:o,alt:"Node Configuration"})],-1),k=(0,a._)("table",null,[(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Value"),(0,a._)("th",null,"Description")])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,"From Time"),(0,a._)("td",null,"The start time of the selected period.")]),(0,a._)("tr",null,[(0,a._)("td",null,"To Time"),(0,a._)("td",null,"The end time of the selected period.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Hours On"),(0,a._)("td",null,"The number of hours that shall be turned on.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Consecutive On-Period"),(0,a._)("td",null,"Check this if you need the on-period to be consecutive.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Send When Rescheduling"),(0,a._)("td",null,"Check this to make sure on or off output is sent immediately after rescheduling.")]),(0,a._)("tr",null,[(0,a._)("td",null,"If No Schedule, Send"),(0,a._)("td",null,"What to do if there is no valid schedule any more (turn on or off).")]),(0,a._)("tr",null,[(0,a._)("td",null,"Outside Period, Send"),(0,a._)("td",null,"Select the value to send outside the selected period.")])])],-1),d=(0,a._)("p",null,"If you want to use a period of 24 hours, set the From Time and To Time to the same value. The time you select is significant in the way that it decides which 24 hours that are considered when finding the hours with lowest price.",-1),h=(0,a._)("div",{class:"custom-container tip"},[(0,a._)("p",{class:"custom-container-title"},"Example with Consecutive On-Period"),(0,a._)("p",null,[(0,a.Uk)("One example to need a consecutive on-period can be if you want to control the washing machine. Let's say it needs 3 hours, and you want it to run between 22:00 and 06:00. Set "),(0,a._)("code",null,"From Time = 22:00"),(0,a.Uk)(", "),(0,a._)("code",null,"To Time = 06:00"),(0,a.Uk)(" and check the "),(0,a._)("code",null,"Consecutive On-Period"),(0,a.Uk)(" flag. This will turn on the cheapest 3-hour period from 22:00 to 06:00.")]),(0,a._)("p",null,"NB! It is not recommended to run the washing machine when you are sleeping or away.")],-1),b=(0,a._)("div",{class:"custom-container tip"},[(0,a._)("p",{class:"custom-container-title"},"Example with non-consecutive on-period"),(0,a._)("p",null,[(0,a.Uk)("If you have heating cables in the driveway, you may need them to be on only for a few hours every day, for example 4 hours, but it may not be important when this is. Then set "),(0,a._)("code",null,"From Time = 00:00"),(0,a.Uk)(", "),(0,a._)("code",null,"To Time = 00:00"),(0,a.Uk)(" and "),(0,a._)("strong",null,"un-check"),(0,a.Uk)(" the "),(0,a._)("code",null,"Consecutive On-Period"),(0,a.Uk)(" flag. This will turn on the 4 cheapest hours during the whole day, and off the rest.")]),(0,a._)("p",null,[(0,a.Uk)("You can use any time for start and end, but it is a good idea to use "),(0,a._)("code",null,"00:00"),(0,a.Uk)(", since the prices normally comes for this period.")])],-1),m=(0,a._)("div",{class:"custom-container warning"},[(0,a._)("p",{class:"custom-container-title"},"Outside Period, Send"),(0,a._)("p",null,[(0,a.Uk)("Unless the period you select is 24 hours ("),(0,a._)("code",null,"From Time"),(0,a.Uk)(" and "),(0,a._)("code",null,"To Time"),(0,a.Uk)(" are the same), it is important what value you choose for "),(0,a._)("code",null,"Outside Period, Send"),(0,a.Uk)(". This decides whether the output is on or off during the period that is outside the selected period.")])],-1),U=(0,a._)("div",{class:"custom-container danger"},[(0,a._)("p",{class:"custom-container-title"},"Schedule not calculated"),(0,a._)("p",null,"If you select a period for example from 10:00 to 02:00, it may not be possible to calculate before the period starts. This is because electricity prices for the next day (in the Nord Pool area) normally are received around 13:00. The node cannot calculate the period until it has price data for the whole period.")],-1),g=(0,a._)("h3",{id:"dynamic-config",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#dynamic-config","aria-hidden":"true"},"#"),(0,a.Uk)(" Dynamic config")],-1),f=(0,a._)("p",null,"It is possible to change config dynamically by sending a config message to the node. The config messages has a payload with a config object like this example:",-1),y=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token property"},'"payload"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"fromTime"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"10"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"toTime"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"16"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hoursOn"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"doNotSplit"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputOutsidePeriod"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br")])],-1),w=(0,a._)("p",null,"All the variables in the config object are optional. You can send only those you want to change.",-1),v=(0,a._)("p",null,"The config sent like this will be valid until a new config is sent the same way, or until the flow is restarted. On a restart, the original config set up in the node will be used.",-1),T=(0,a._)("p",null,"When a config is sent like this, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.",-1),x=(0,a._)("h2",{id:"input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#input","aria-hidden":"true"},"#"),(0,a.Uk)(" Input")],-1),O=(0,a.Uk)("The input is the "),C=(0,a.Uk)("common strategy input format"),S=(0,a._)("h2",{id:"output",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output","aria-hidden":"true"},"#"),(0,a.Uk)(" Output")],-1),I=(0,a._)("p",null,"When a valid input is received, and the schedule is recalculated, the resulting schedule, as well as some other information, is sent to output 3. You can use this to see the plan and verify that it meets your expectations. You can also use it to display the schedule in any way you like.",-1),P=(0,a._)("p",null,"Example of output:",-1),j=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"schedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T00:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T04:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T10:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T18:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T04:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T10:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T18:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hours"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.4778"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T00:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.4828"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T01:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token comment"},"//..."),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.6514"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T23:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"source"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"Tibber"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"fromTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"04"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"toTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"18"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hoursOn"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"06"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"doNotSplit"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputOutsidePeriod"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"12"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"13"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"14"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"15"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"16"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"17"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"18"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"19"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"20"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"21"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"22"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"23"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"24"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"25"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"26"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"27"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"28"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"29"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"30"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"31"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"32"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"33"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"34"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"35"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"36"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"37"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"38"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"39"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"40"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"41"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"42"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"43"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"44"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"45"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"46"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"47"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"48"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"49"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"50"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"51"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"52"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"53"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"54"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"55"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"56"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"57"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"58"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"59"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"60"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"61"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"62"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"63"),(0,a._)("br")])],-1),N=(0,a._)("p",null,[(0,a.Uk)("The "),(0,a._)("code",null,"schedule"),(0,a.Uk)(" array shows every time the switch is turned on or off. The "),(0,a._)("code",null,"hours"),(0,a.Uk)(" array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.")],-1),W=(0,a._)("h2",{id:"tips-tricks",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#tips-tricks","aria-hidden":"true"},"#"),(0,a.Uk)(" Tips & tricks")],-1),Y=(0,a._)("h3",{id:"multiple-nodes-works-together",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#multiple-nodes-works-together","aria-hidden":"true"},"#"),(0,a.Uk)(" Multiple nodes works together")],-1),D=(0,a._)("p",null,"You can use multiple nodes simultanously, for different periods, if you want more hours on one part of the day than another part, or to make sure there are at least some hours on during each period.",-1),F=(0,a._)("h3",{id:"highest-price",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#highest-price","aria-hidden":"true"},"#"),(0,a.Uk)(" Highest price")],-1),H=(0,a._)("p",null,[(0,a.Uk)("If you want to find the "),(0,a._)("code",null,"x"),(0,a.Uk)(" hours with the highest prices, do as follows:")],-1),R=(0,a._)("ol",null,[(0,a._)("li",null,[(0,a.Uk)("Calculate "),(0,a._)("code",null,"y"),(0,a.Uk)(" as the total number of hours in the period. For example, if the period is from "),(0,a._)("code",null,"08:00"),(0,a.Uk)(" to "),(0,a._)("code",null,"20:00"),(0,a.Uk)(", then "),(0,a._)("code",null,"y = 12"),(0,a.Uk)(".")]),(0,a._)("li",null,[(0,a.Uk)("Configure "),(0,a._)("code",null,"Hours On = y - x"),(0,a.Uk)(", so if "),(0,a._)("code",null,"x = 4"),(0,a.Uk)(", then "),(0,a._)("code",null,"Hours On = 12 - 4 = 8"),(0,a.Uk)(".")]),(0,a._)("li",null,[(0,a.Uk)("Use "),(0,a._)("strong",null,"Output 2"),(0,a.Uk)(" to get a signal when you have the hours with the highest prices. Just remember that the value sent to output 2 is "),(0,a._)("code",null,"false"),(0,a.Uk)(", not "),(0,a._)("code",null,"true"),(0,a.Uk)(" as it is on output 1.")])],-1),E={},V=(0,e(3744).Z)(E,[["render",function(n,s){const e=(0,a.up)("RouterLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,r,p,c,i,u,_,k,d,h,b,m,U,g,f,y,w,v,T,x,(0,a._)("p",null,[O,(0,a.Wm)(e,{to:"/nodes/strategy-input.html"},{default:(0,a.w5)((()=>[C])),_:1})]),S,I,P,j,N,W,Y,D,F,H,R],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const e=n.__vccOpts||n;for(const[n,a]of s)e[n]=a;return e}},3981:(n,s,e)=>{n.exports=e.p+"assets/img/lowest-price-config.6d66a8c2.png"},6110:(n,s,e)=>{n.exports=e.p+"assets/img/node-ps-strategy-lowest-price.3a4ad347.png"}}]);
1
+ "use strict";(self.webpackChunknode_red_contrib_power_saver=self.webpackChunknode_red_contrib_power_saver||[]).push([[418],{3959:(n,s,e)=>{e.r(s),e.d(s,{data:()=>a});const a={key:"v-4637f9e4",path:"/nodes/ps-strategy-lowest-price.html",title:"ps-strategy-lowest-price",lang:"en-US",frontmatter:{next:"./ps-receive-price.md"},excerpt:"",headers:[{level:2,title:"Description",slug:"description",children:[]},{level:2,title:"Configuration",slug:"configuration",children:[{level:3,title:"Dynamic config",slug:"dynamic-config",children:[]}]},{level:2,title:"Input",slug:"input",children:[]},{level:2,title:"Output",slug:"output",children:[]},{level:2,title:"Tips & tricks",slug:"tips-tricks",children:[{level:3,title:"Multiple nodes works together",slug:"multiple-nodes-works-together",children:[]},{level:3,title:"Highest price",slug:"highest-price",children:[]}]}],filePathRelative:"nodes/ps-strategy-lowest-price.md",git:{updatedTime:1641510047e3}}},1859:(n,s,e)=>{e.r(s),e.d(s,{default:()=>V});var a=e(6252),t=e(6110),o=e(3981);const l=(0,a._)("h1",{id:"ps-strategy-lowest-price",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#ps-strategy-lowest-price","aria-hidden":"true"},"#"),(0,a.Uk)(" ps-strategy-lowest-price")],-1),r=(0,a._)("p",null,[(0,a._)("img",{src:t,alt:"ps-strategy-lowest-price"})],-1),p=(0,a._)("p",null,"Strategy node to turn on power the hours when the price is lowest during a given period, and turn off the other hours.",-1),c=(0,a._)("h2",{id:"description",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),(0,a.Uk)(" Description")],-1),i=(0,a._)("p",null,"The node can work on a specific period from 1 to 24 hours during a 24 hour period. Inside this period, you can decide how many hours that shall be on. The rest of the period will be off. Outside the period, you can select that the output shall be either on or off. You can also decide that the hours on shall be consecutive (one continuous period) or spread around in multiple on-periods.",-1),u=(0,a._)("h2",{id:"configuration",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#configuration","aria-hidden":"true"},"#"),(0,a.Uk)(" Configuration")],-1),_=(0,a._)("p",null,[(0,a._)("img",{src:o,alt:"Node Configuration"})],-1),k=(0,a._)("table",null,[(0,a._)("thead",null,[(0,a._)("tr",null,[(0,a._)("th",null,"Value"),(0,a._)("th",null,"Description")])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,"From Time"),(0,a._)("td",null,"The start time of the selected period.")]),(0,a._)("tr",null,[(0,a._)("td",null,"To Time"),(0,a._)("td",null,"The end time of the selected period.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Hours On"),(0,a._)("td",null,"The number of hours that shall be turned on.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Consecutive On-Period"),(0,a._)("td",null,"Check this if you need the on-period to be consecutive.")]),(0,a._)("tr",null,[(0,a._)("td",null,"Send When Rescheduling"),(0,a._)("td",null,"Check this to make sure on or off output is sent immediately after rescheduling.")]),(0,a._)("tr",null,[(0,a._)("td",null,"If No Schedule, Send"),(0,a._)("td",null,"What to do if there is no valid schedule any more (turn on or off).")]),(0,a._)("tr",null,[(0,a._)("td",null,"Outside Period, Send"),(0,a._)("td",null,"Select the value to send outside the selected period.")])])],-1),d=(0,a._)("p",null,"If you want to use a period of 24 hours, set the From Time and To Time to the same value. The time you select is significant in the way that it decides which 24 hours that are considered when finding the hours with lowest price.",-1),h=(0,a._)("div",{class:"custom-container tip"},[(0,a._)("p",{class:"custom-container-title"},"Example with Consecutive On-Period"),(0,a._)("p",null,[(0,a.Uk)("One example to need a consecutive on-period can be if you want to control the washing machine. Let's say it needs 3 hours, and you want it to run between 22:00 and 06:00. Set "),(0,a._)("code",null,"From Time = 22:00"),(0,a.Uk)(", "),(0,a._)("code",null,"To Time = 06:00"),(0,a.Uk)(" and check the "),(0,a._)("code",null,"Consecutive On-Period"),(0,a.Uk)(" flag. This will turn on the cheapest 3-hour period from 22:00 to 06:00.")]),(0,a._)("p",null,"NB! It is not recommended to run the washing machine when you are sleeping or away.")],-1),b=(0,a._)("div",{class:"custom-container tip"},[(0,a._)("p",{class:"custom-container-title"},"Example with non-consecutive on-period"),(0,a._)("p",null,[(0,a.Uk)("If you have heating cables in the driveway, you may need them to be on only for a few hours every day, for example 4 hours, but it may not be important when this is. Then set "),(0,a._)("code",null,"From Time = 00:00"),(0,a.Uk)(", "),(0,a._)("code",null,"To Time = 00:00"),(0,a.Uk)(" and "),(0,a._)("strong",null,"un-check"),(0,a.Uk)(" the "),(0,a._)("code",null,"Consecutive On-Period"),(0,a.Uk)(" flag. This will turn on the 4 cheapest hours during the whole day, and off the rest.")]),(0,a._)("p",null,[(0,a.Uk)("You can use any time for start and end, but it is a good idea to use "),(0,a._)("code",null,"00:00"),(0,a.Uk)(", since the prices normally comes for this period.")])],-1),m=(0,a._)("div",{class:"custom-container warning"},[(0,a._)("p",{class:"custom-container-title"},"Outside Period, Send"),(0,a._)("p",null,[(0,a.Uk)("Unless the period you select is 24 hours ("),(0,a._)("code",null,"From Time"),(0,a.Uk)(" and "),(0,a._)("code",null,"To Time"),(0,a.Uk)(" are the same), it is important what value you choose for "),(0,a._)("code",null,"Outside Period, Send"),(0,a.Uk)(". This decides whether the output is on or off during the period that is outside the selected period.")])],-1),U=(0,a._)("div",{class:"custom-container danger"},[(0,a._)("p",{class:"custom-container-title"},"Schedule not calculated"),(0,a._)("p",null,"If you select a period for example from 10:00 to 02:00, it may not be possible to calculate before the period starts. This is because electricity prices for the next day (in the Nord Pool area) normally are received around 13:00. The node cannot calculate the period until it has price data for the whole period.")],-1),g=(0,a._)("h3",{id:"dynamic-config",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#dynamic-config","aria-hidden":"true"},"#"),(0,a.Uk)(" Dynamic config")],-1),f=(0,a._)("p",null,"It is possible to change config dynamically by sending a config message to the node. The config messages has a payload with a config object like this example:",-1),y=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token property"},'"payload"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"fromTime"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"10"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"toTime"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"16"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hoursOn"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"3"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"doNotSplit"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a.Uk)(),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputOutsidePeriod"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br")])],-1),w=(0,a._)("p",null,"All the variables in the config object are optional. You can send only those you want to change.",-1),v=(0,a._)("p",null,"The config sent like this will be valid until a new config is sent the same way, or until the flow is restarted. On a restart, the original config set up in the node will be used.",-1),T=(0,a._)("p",null,"When a config is sent like this, the schedule will be replanned based on the last previously received price data. If no price data has been received, no scheduling is done.",-1),x=(0,a._)("h2",{id:"input",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#input","aria-hidden":"true"},"#"),(0,a.Uk)(" Input")],-1),O=(0,a.Uk)("The input is the "),C=(0,a.Uk)("common strategy input format"),S=(0,a._)("h2",{id:"output",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#output","aria-hidden":"true"},"#"),(0,a.Uk)(" Output")],-1),I=(0,a._)("p",null,"When a valid input is received, and the schedule is recalculated, the resulting schedule, as well as some other information, is sent to output 3. You can use this to see the plan and verify that it meets your expectations. You can also use it to display the schedule in any way you like.",-1),P=(0,a._)("p",null,"Example of output:",-1),j=(0,a._)("div",{class:"language-json ext-json line-numbers-mode"},[(0,a._)("pre",{class:"language-json"},[(0,a._)("code",null,[(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"schedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T00:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T04:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T10:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T18:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T04:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T10:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T18:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"value"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hours"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"["),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.4778"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T00:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.4828"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-10T01:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token comment"},"//..."),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"price"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token number"},"0.6514"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"onOff"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"start"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-12-11T23:00:00.000+01:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"saving"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token null keyword"},"null"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"]"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"source"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"Tibber"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"config"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token punctuation"},"{"),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"fromTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"04"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"toTime"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"18"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"hoursOn"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"06"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"doNotSplit"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"false"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"sendCurrentValueWhenRescheduling"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token boolean"},"true"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputIfNoSchedule"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"outputOutsidePeriod"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"true"'),(0,a.Uk)("\n "),(0,a._)("span",{class:"token punctuation"},"}"),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"time"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"2021-09-30T23:45:12.123+02:00"'),(0,a._)("span",{class:"token punctuation"},","),(0,a.Uk)("\n "),(0,a._)("span",{class:"token property"},'"version"'),(0,a._)("span",{class:"token operator"},":"),(0,a.Uk)(),(0,a._)("span",{class:"token string"},'"3.1.2"'),(0,a.Uk)("\n"),(0,a._)("span",{class:"token punctuation"},"}"),(0,a.Uk)("\n")])]),(0,a._)("div",{class:"line-numbers"},[(0,a._)("span",{class:"line-number"},"1"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"2"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"3"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"4"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"5"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"6"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"7"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"8"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"9"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"10"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"11"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"12"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"13"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"14"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"15"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"16"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"17"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"18"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"19"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"20"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"21"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"22"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"23"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"24"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"25"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"26"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"27"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"28"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"29"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"30"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"31"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"32"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"33"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"34"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"35"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"36"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"37"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"38"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"39"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"40"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"41"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"42"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"43"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"44"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"45"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"46"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"47"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"48"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"49"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"50"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"51"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"52"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"53"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"54"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"55"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"56"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"57"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"58"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"59"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"60"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"61"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"62"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"63"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"64"),(0,a._)("br"),(0,a._)("span",{class:"line-number"},"65"),(0,a._)("br")])],-1),N=(0,a._)("p",null,[(0,a.Uk)("The "),(0,a._)("code",null,"schedule"),(0,a.Uk)(" array shows every time the switch is turned on or off. The "),(0,a._)("code",null,"hours"),(0,a.Uk)(" array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.")],-1),W=(0,a._)("h2",{id:"tips-tricks",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#tips-tricks","aria-hidden":"true"},"#"),(0,a.Uk)(" Tips & tricks")],-1),Y=(0,a._)("h3",{id:"multiple-nodes-works-together",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#multiple-nodes-works-together","aria-hidden":"true"},"#"),(0,a.Uk)(" Multiple nodes works together")],-1),D=(0,a._)("p",null,"You can use multiple nodes simultanously, for different periods, if you want more hours on one part of the day than another part, or to make sure there are at least some hours on during each period.",-1),F=(0,a._)("h3",{id:"highest-price",tabindex:"-1"},[(0,a._)("a",{class:"header-anchor",href:"#highest-price","aria-hidden":"true"},"#"),(0,a.Uk)(" Highest price")],-1),H=(0,a._)("p",null,[(0,a.Uk)("If you want to find the "),(0,a._)("code",null,"x"),(0,a.Uk)(" hours with the highest prices, do as follows:")],-1),R=(0,a._)("ol",null,[(0,a._)("li",null,[(0,a.Uk)("Calculate "),(0,a._)("code",null,"y"),(0,a.Uk)(" as the total number of hours in the period. For example, if the period is from "),(0,a._)("code",null,"08:00"),(0,a.Uk)(" to "),(0,a._)("code",null,"20:00"),(0,a.Uk)(", then "),(0,a._)("code",null,"y = 12"),(0,a.Uk)(".")]),(0,a._)("li",null,[(0,a.Uk)("Configure "),(0,a._)("code",null,"Hours On = y - x"),(0,a.Uk)(", so if "),(0,a._)("code",null,"x = 4"),(0,a.Uk)(", then "),(0,a._)("code",null,"Hours On = 12 - 4 = 8"),(0,a.Uk)(".")]),(0,a._)("li",null,[(0,a.Uk)("Use "),(0,a._)("strong",null,"Output 2"),(0,a.Uk)(" to get a signal when you have the hours with the highest prices. Just remember that the value sent to output 2 is "),(0,a._)("code",null,"false"),(0,a.Uk)(", not "),(0,a._)("code",null,"true"),(0,a.Uk)(" as it is on output 1.")])],-1),E={},V=(0,e(3744).Z)(E,[["render",function(n,s){const e=(0,a.up)("RouterLink");return(0,a.wg)(),(0,a.iD)(a.HY,null,[l,r,p,c,i,u,_,k,d,h,b,m,U,g,f,y,w,v,T,x,(0,a._)("p",null,[O,(0,a.Wm)(e,{to:"/nodes/strategy-input.html"},{default:(0,a.w5)((()=>[C])),_:1})]),S,I,P,j,N,W,Y,D,F,H,R],64)}]])},3744:(n,s)=>{s.Z=(n,s)=>{const e=n.__vccOpts||n;for(const[n,a]of s)e[n]=a;return e}},3981:(n,s,e)=>{n.exports=e.p+"assets/img/lowest-price-config.6d66a8c2.png"},6110:(n,s,e)=>{n.exports=e.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([[495],{3707:(e,i,l)=>{l.r(i),l.d(i,{data:()=>a});const a={key:"v-510ed0d4",path:"/changelog/",title:"Change Log",lang:"en-US",frontmatter:{sidebar:"auto"},excerpt:"",headers:[{level:2,title:"3.1.2",slug:"_3-1-2",children:[]},{level:2,title:"3.1.1",slug:"_3-1-1",children:[]},{level:2,title:"3.1.0",slug:"_3-1-0",children:[]},{level:2,title:"3.0.10",slug:"_3-0-10",children:[]},{level:2,title:"3.0.9",slug:"_3-0-9",children:[]},{level:2,title:"3.0.8",slug:"_3-0-8",children:[]},{level:2,title:"3.0.7",slug:"_3-0-7",children:[]},{level:2,title:"3.0.6",slug:"_3-0-6",children:[]},{level:2,title:"3.0.5",slug:"_3-0-5",children:[]},{level:2,title:"3.0.4",slug:"_3-0-4",children:[]},{level:2,title:"3.0.3",slug:"_3-0-3",children:[]},{level:2,title:"3.0.2",slug:"_3-0-2",children:[]},{level:2,title:"3.0.1",slug:"_3-0-1",children:[]},{level:2,title:"3.0.0",slug:"_3-0-0",children:[]},{level:2,title:"2.1.0",slug:"_2-1-0",children:[]},{level:2,title:"2.0.5",slug:"_2-0-5",children:[]},{level:2,title:"2.0.4",slug:"_2-0-4",children:[]},{level:2,title:"2.0.3",slug:"_2-0-3",children:[]},{level:2,title:"2.0.2",slug:"_2-0-2",children:[]},{level:2,title:"2.0.1",slug:"_2-0-1",children:[]},{level:2,title:"2.0.0",slug:"_2-0-0",children:[]},{level:2,title:"1.0.9",slug:"_1-0-9",children:[]}],filePathRelative:"changelog/README.md",git:{updatedTime:1641508506e3}}},6926:(e,i,l)=>{l.r(i),l.d(i,{default:()=>t});const a=(0,l(6252).uE)('<h1 id="change-log" tabindex="-1"><a class="header-anchor" href="#change-log" aria-hidden="true">#</a> Change Log</h1><p>List the most significant changes, starting in version 1.0.9.</p><h2 id="_3-1-2" tabindex="-1"><a class="header-anchor" href="#_3-1-2" aria-hidden="true">#</a> 3.1.2</h2><ul><li>Add time, version and current value to output from strategy nodes.</li></ul><h2 id="_3-1-1" tabindex="-1"><a class="header-anchor" href="#_3-1-1" aria-hidden="true">#</a> 3.1.1</h2><ul><li>Fix schedule for Lowest Price node so it uses data from previous day correctly. It sometimes failed when the selected period went over midnight.</li><li>Fix so old data in the Lowest Price node context is deleted.</li></ul><h2 id="_3-1-0" tabindex="-1"><a class="header-anchor" href="#_3-1-0" aria-hidden="true">#</a> 3.1.0</h2><ul><li>New node <code>ps-general-add-tariff</code> to add values that varies af fixed times during the day.</li></ul><h2 id="_3-0-10" tabindex="-1"><a class="header-anchor" href="#_3-0-10" aria-hidden="true">#</a> 3.0.10</h2><ul><li>Fix bug in ps-elvia-add-tariff so it connects to API.</li></ul><h2 id="_3-0-9" tabindex="-1"><a class="header-anchor" href="#_3-0-9" aria-hidden="true">#</a> 3.0.9</h2><ul><li>Fix Nord Pool input for current state node, to read data when payload is set to entity.</li></ul><h2 id="_3-0-8" tabindex="-1"><a class="header-anchor" href="#_3-0-8" aria-hidden="true">#</a> 3.0.8</h2><ul><li>Fix bug in Lowest Price node when period goes over midnight.</li><li>Fix documentation - lots of pages were failing.</li></ul><h2 id="_3-0-7" tabindex="-1"><a class="header-anchor" href="#_3-0-7" aria-hidden="true">#</a> 3.0.7</h2><ul><li>Fix Nord Pool current state node input.</li></ul><h2 id="_3-0-6" tabindex="-1"><a class="header-anchor" href="#_3-0-6" aria-hidden="true">#</a> 3.0.6</h2><ul><li>Remove non-existent node from package.json.</li></ul><h2 id="_3-0-5" tabindex="-1"><a class="header-anchor" href="#_3-0-5" aria-hidden="true">#</a> 3.0.5</h2><ul><li>Move dependencies to correct section (node_fetch and lodash.cloneDeep).</li></ul><h2 id="_3-0-4" tabindex="-1"><a class="header-anchor" href="#_3-0-4" aria-hidden="true">#</a> 3.0.4</h2><ul><li>Remove <code>null</code>-values from Nord Pool data for <code>tomorrow</code>.</li></ul><h2 id="_3-0-3" tabindex="-1"><a class="header-anchor" href="#_3-0-3" aria-hidden="true">#</a> 3.0.3</h2><ul><li>Fix bug in lowest price strategy, when period ends at midnight.</li><li>Fix labels for hours on, so they do not have leading zero.</li><li>Fix so source should be visible in output 3.</li></ul><h2 id="_3-0-2" tabindex="-1"><a class="header-anchor" href="#_3-0-2" aria-hidden="true">#</a> 3.0.2</h2><ul><li>Bugfix in Lowest Price node (not successful)</li></ul><h2 id="_3-0-1" tabindex="-1"><a class="header-anchor" href="#_3-0-1" aria-hidden="true">#</a> 3.0.1</h2><ul><li>Fix so elvia subscription key is stored as credential</li><li>Fix bug on config for strategy nodes. Config was not saved properly.</li><li>Remove double output bug, and better handling when hoursOn &gt; period</li></ul><h2 id="_3-0-0" tabindex="-1"><a class="header-anchor" href="#_3-0-0" aria-hidden="true">#</a> 3.0.0</h2><ul><li>Deprecating old Power Saver node, adding multiple new nodes.</li><li>New node <code>ps-strategy-best-save</code> is replacing old node <code>Power Saver</code> together with the new <code>ps-receive-price</code> node.</li><li>Add new strategy node: <code>ps-strategy-lowest-price</code>.</li><li>Add new node: <code>ps-receive-price</code>.</li><li>Add grid tariff for Elvia customers, using the <code>ps-elvia-add-tariff</code> node.</li><li>New documentation.</li><li>Change node category to Power Saver.</li></ul><h2 id="_2-1-0" tabindex="-1"><a class="header-anchor" href="#_2-1-0" aria-hidden="true">#</a> 2.1.0</h2><ul><li>Accept config as input, making it possible to dynamically change config</li><li>Fix dropdown for config value for selecting output when there is no schedule</li><li>Improve config screen and documentation</li></ul><h2 id="_2-0-5" tabindex="-1"><a class="header-anchor" href="#_2-0-5" aria-hidden="true">#</a> 2.0.5</h2><ul><li>Update links to examples</li></ul><h2 id="_2-0-4" tabindex="-1"><a class="header-anchor" href="#_2-0-4" aria-hidden="true">#</a> 2.0.4</h2><ul><li>Update doc and add examples</li></ul><h2 id="_2-0-3" tabindex="-1"><a class="header-anchor" href="#_2-0-3" aria-hidden="true">#</a> 2.0.3</h2><ul><li>Bugfix</li></ul><h2 id="_2-0-2" tabindex="-1"><a class="header-anchor" href="#_2-0-2" aria-hidden="true">#</a> 2.0.2</h2><ul><li>Fix so Nord Pool data can be read directly from the current state node</li></ul><h2 id="_2-0-1" tabindex="-1"><a class="header-anchor" href="#_2-0-1" aria-hidden="true">#</a> 2.0.1</h2><ul><li>Fix bug that caused no schedule</li><li>Add config to output</li></ul><h2 id="_2-0-0" tabindex="-1"><a class="header-anchor" href="#_2-0-0" aria-hidden="true">#</a> 2.0.0</h2><ul><li>New and better algorithm to calculate savings, resulting in a better schedule.</li><li>Removed possibility to configure maximum hours to save per day, as this does not really make much sense.</li><li>Round savings to 4 decimals.</li><li>Set last savings hour to null when 0.</li></ul><h2 id="_1-0-9" tabindex="-1"><a class="header-anchor" href="#_1-0-9" aria-hidden="true">#</a> 1.0.9</h2><ul><li>Fix bug in saving last hour of the day.</li></ul>',46),d={},t=(0,l(3744).Z)(d,[["render",function(e,i){return a}]])},3744:(e,i)=>{i.Z=(e,i)=>{const l=e.__vccOpts||e;for(const[e,a]of i)l[e]=a;return l}}}]);