node-red-contrib-power-saver 3.0.2 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/.vuepress/dist/404.html +3 -3
- package/docs/.vuepress/dist/assets/js/{app.4ee3384b.js → app.342dc054.js} +1 -1
- package/docs/.vuepress/dist/assets/js/runtime~app.0d53f24f.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-510ed0d4.129ef915.js +1 -0
- package/docs/.vuepress/dist/changelog/index.html +3 -3
- package/docs/.vuepress/dist/contribute/index.html +2 -2
- package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +2 -2
- package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +2 -2
- package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +2 -2
- package/docs/.vuepress/dist/examples/index.html +2 -2
- package/docs/.vuepress/dist/guide/index.html +2 -2
- package/docs/.vuepress/dist/index.html +2 -2
- package/docs/.vuepress/dist/nodes/index.html +2 -2
- package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +2 -2
- package/docs/.vuepress/dist/nodes/power-saver.html +2 -2
- package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +2 -2
- package/docs/.vuepress/dist/nodes/ps-receive-price.html +2 -2
- package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +2 -2
- package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +2 -2
- package/docs/.vuepress/dist/nodes/strategy-input.html +2 -2
- package/docs/changelog/README.md +19 -1
- package/package.json +3 -3
- package/src/handle-input.js +1 -1
- package/src/receive-price-functions.js +14 -10
- package/src/receive-price.js +2 -2
- package/src/strategy-lowest-price.html +1 -1
- package/src/strategy-lowest-price.js +2 -2
- package/test/data/converted-prices.json +1 -0
- package/test/data/tibber-data-end-0-24h.json +197 -0
- package/test/data/tibber-data-end-0.json +101 -0
- package/test/data/tibber-result-end-0-24h.json +320 -0
- package/test/data/tibber-result-end-0.json +168 -0
- package/test/receive-price-functions.test.js +20 -0
- package/test/receive-price.test.js +4 -4
- package/test/strategy-lowest-price.test.js +66 -0
- package/docs/.vuepress/dist/assets/js/runtime~app.cafd6537.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-510ed0d4.204a09ec.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
|
<script src="https://c6.patreon.com/becomePatronButton.bundle.js"></script><link rel="icon" href="/euro.png"><title>power-saver | 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.
|
|
8
|
+
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.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"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/node-red-contrib-power-saver/" class=""><!----><span class="site-name">Power Saver</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><p class="sidebar-heading sidebar-item active">Nodes</p><ul class=""><li><!--[--><a href="/node-red-contrib-power-saver/nodes/power-saver.md" class="nav-link sidebar-item active" aria-label="Power Saver"><!--[--><!--]--> Power Saver <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><p class="sidebar-item">Strategy nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-strategy-best-save.html" class="nav-link sidebar-item" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html" class="nav-link sidebar-item" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Utility nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-receive-price.html" class="nav-link sidebar-item" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Grid tariff nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html" class="nav-link sidebar-item" aria-label="ps-elvia-add-tariff"><!--[--><!--]--> ps-elvia-add-tariff <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--><!--[--><p class="sidebar-heading sidebar-item">Data format</p><ul class=""><li><!--[--><a href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="nav-link sidebar-item" aria-label="Strategy input format"><!--[--><!--]--> Strategy input format <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="power-saver" tabindex="-1"><a class="header-anchor" href="#power-saver" aria-hidden="true">#</a> power-saver <span class="badge warning" style="vertical-align:middle;"><!--[-->deprecated<!--]--></span></h1><p><img src="/node-red-contrib-power-saver/assets/img/node-power-saver.51ff2e5d.png" alt="Power Saver node"></p><p>This is the node from version 2. It is still working, but should be replaced.</p><p>To migrate, just replace the Power Saver node by a combination of the ps-receive-price and the ps-best-save nodes:</p><p>Replace the <code>Power Saver</code> node from version 2:</p><p><img src="/node-red-contrib-power-saver/assets/img/migrate-power-saver.aae13f9d.png" alt="Power Saver node"></p><p>with this combination of <code>ps-receive-price</code> and <code>ps-strategy-best-save</code> from version 3:</p><p><img src="/node-red-contrib-power-saver/assets/img/migrate-best-save.f73420f6.png" alt="Migrate Power Saver"></p><p>The configuration is done in the <code>ps-strategy-best-save</code> node, and is the same as in the old <code>Power Saver</code> node.</p><p>Should you need it, here is the <a href="./old-power-saver-doc">old documentation</a> for the PowerSaver node from version 2.</p><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">12/12/2021, 2:17:07 PM</span></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: ottpau@gmail.com">Otto Paulsen</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav"><p class="inner"><!----><span class="next"><a href="/node-red-contrib-power-saver/nodes/ps-strategy-best-save.html" class="nav-link" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
13
|
-
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
13
|
+
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.js" defer></script>
|
|
14
14
|
</body>
|
|
15
15
|
</html>
|
|
@@ -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
|
<script src="https://c6.patreon.com/becomePatronButton.bundle.js"></script><link rel="icon" href="/euro.png"><title>ps-elvia-add-tariff | 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.
|
|
8
|
+
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.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"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/node-red-contrib-power-saver/" class=""><!----><span class="site-name">Power Saver</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/guide/" class="nav-link" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/nodes/" class="nav-link router-link-active" aria-label="Nodes"><!--[--><!--]--> Nodes <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/examples/" class="nav-link" aria-label="Examples"><!--[--><!--]--> Examples <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/contribute/" class="nav-link" aria-label="Contribute"><!--[--><!--]--> Contribute <!--[--><!--]--></a></div><div class="navbar-links-item"><a href="/node-red-contrib-power-saver/changelog/" class="nav-link" aria-label="Changes"><!--[--><!--]--> Changes <!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><p class="sidebar-heading sidebar-item active">Nodes</p><ul class=""><li><!--[--><a href="/node-red-contrib-power-saver/nodes/power-saver.md" class="nav-link sidebar-item" aria-label="Power Saver"><!--[--><!--]--> Power Saver <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><p class="sidebar-item">Strategy nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-strategy-best-save.html" class="nav-link sidebar-item" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html" class="nav-link sidebar-item" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item">Utility nodes</p><ul class="sidebar-sub-items"><li><!--[--><a href="/node-red-contrib-power-saver/nodes/ps-receive-price.html" class="nav-link sidebar-item" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li><li><!--[--><p class="sidebar-item active">Grid tariff nodes</p><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-item active" aria-label="ps-elvia-add-tariff"><!--[--><!--]--> ps-elvia-add-tariff <!--[--><!--]--></a><ul class="sidebar-sub-items"><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html#description" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Description"><!--[--><!--]--> Description <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html#configuration" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Configuration"><!--[--><!--]--> Configuration <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html#input" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Input"><!--[--><!--]--> Input <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/node-red-contrib-power-saver/nodes/ps-elvia-add-tariff.html#output" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="Output"><!--[--><!--]--> Output <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--></li></ul><!--]--></li></ul><!--]--><!--[--><p class="sidebar-heading sidebar-item">Data format</p><ul class=""><li><!--[--><a href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="nav-link sidebar-item" aria-label="Strategy input format"><!--[--><!--]--> Strategy input format <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="ps-elvia-add-tariff" tabindex="-1"><a class="header-anchor" href="#ps-elvia-add-tariff" aria-hidden="true">#</a> ps-elvia-add-tariff</h1><p><img src="/node-red-contrib-power-saver/assets/img/node-ps-elvia-add-tariff.94ea2b09.png" alt="ps-elvia-add-tariff"></p><p>Node to add grid tariff from Elvia.</p><div class="custom-container warning"><p class="custom-container-title">Elvia API</p><p>You need an Elvia API subscription key to use this node. See <a href="#elvia-configuration">configuration</a>.</p></div><h2 id="description" tabindex="-1"><a class="header-anchor" href="#description" aria-hidden="true">#</a> Description</h2><p>When grid tariff changes from hour to hour, this should normally also be considered when finding the most favorable hours to use power. This node retrieves prices from Elvia, so if you are an elvia customer, you can put this node between the <code>ps-receive-price</code> node and the strategy nodes. When configured, it will add Elvia tariff to the power prices before doing the calculation:</p><p><img src="/node-red-contrib-power-saver/assets/img/elvia-flow.bae2a4d5.png" alt="Elvia flow"></p><h2 id="configuration" tabindex="-1"><a class="header-anchor" href="#configuration" aria-hidden="true">#</a> Configuration</h2><div class="custom-container warning"><p class="custom-container-title">Elvia API subscription key</p><p>This node uses the Elvia API, and you must get your own Elvia API subscription key in order to use it. Go to the <a href="https://elvia.portal.azure-api.net/" target="_blank" rel="noopener noreferrer">Elvia Developer Portal<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a> to sign up, and then request for a subscription to the GridTariffAPI. When your subscription is approved, you will find your subscription key in the <a href="https://elvia.portal.azure-api.net/developer" target="_blank" rel="noopener noreferrer">developer portal<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a> under Your subscriptions.</p></div><p>The first time you use this node, you must create a <code>ps-elvia-config</code> entry. Click on the edit button to the right of Elvia Config:</p><p><img src="/node-red-contrib-power-saver/assets/img/elvia-config-no-config.b4bb972c.png" alt="Elvia configuration"></p><p>Then enter the Elvia API subscription key:</p><p><img src="/node-red-contrib-power-saver/assets/img/elvia-config-subscription-key.8be8ab8a.png" alt="Elvia configuration"></p><p>After entering the Elvia API subscription key the first time, it is not possible to select tariff.</p><p><img src="/node-red-contrib-power-saver/assets/img/elvia-config-no-tariff.3f89aba8.png" alt="Elvia configuration"></p><p>To fix that, save the config, deploy, and then open the node again. Now you should be able to select the right tariff:</p><p><img src="/node-red-contrib-power-saver/assets/img/elvia-config-select-tariff.0f73fd56.png" alt="Elvia configuration"></p><p>The next time you use this node, you can select the same config as you created the first time, and then you can also select tariff immediately.</p><h2 id="input" tabindex="-1"><a class="header-anchor" href="#input" aria-hidden="true">#</a> Input</h2><p>The input is the <a href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="">common strategy input format</a></p><h2 id="output" tabindex="-1"><a class="header-anchor" href="#output" aria-hidden="true">#</a> Output</h2><p>The input is the <a href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="">common strategy input format</a></p><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">12/12/2021, 2:17:07 PM</span></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: ottpau@gmail.com">Otto Paulsen</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
13
|
-
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
13
|
+
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.js" defer></script>
|
|
14
14
|
</body>
|
|
15
15
|
</html>
|
|
@@ -5,7 +5,7 @@
|
|
|
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
|
<script src="https://c6.patreon.com/becomePatronButton.bundle.js"></script><link rel="icon" href="/euro.png"><title>ps-receive-price | Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
|
|
8
|
-
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
8
|
+
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.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>
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
<span class="token punctuation">]</span>
|
|
76
76
|
<span class="token punctuation">}</span>
|
|
77
77
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><h2 id="output" tabindex="-1"><a class="header-anchor" href="#output" aria-hidden="true">#</a> Output</h2><p>The output is the <a href="/node-red-contrib-power-saver/nodes/strategy-input.html" class="">common strategy input format</a>, so it can be sent directly to the strategy nodes, or via any <code>ps-xxx-add-tariff</code> node.</p><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">12/12/2021, 2:17:07 PM</span></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: ottpau@gmail.com">Otto Paulsen</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav"><p class="inner"><span class="prev"> ← <a href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html" class="nav-link" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a></span><!----></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
78
|
-
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
78
|
+
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.js" defer></script>
|
|
79
79
|
</body>
|
|
80
80
|
</html>
|
|
@@ -5,7 +5,7 @@
|
|
|
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
|
<script src="https://c6.patreon.com/becomePatronButton.bundle.js"></script><link rel="icon" href="/euro.png"><title>ps-strategy-best-save | 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.
|
|
8
|
+
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.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>
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
<span class="token punctuation">}</span>
|
|
61
61
|
<span class="token punctuation">}</span>
|
|
62
62
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br></div></div><p>The <code>schedule</code> array shows every time the switch is turned on or off. The <code>hours</code> array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.</p><h2 id="algorithm" tabindex="-1"><a class="header-anchor" href="#algorithm" aria-hidden="true">#</a> Algorithm</h2><p>The calculation that decides what hours to turn off works as follows:</p><ol><li>A matrix (x * y) is created where x is the number of hours we have price information for, and y is the configured maximum number of hours to turn off in a sequence.</li><li>The matrix is filled with how much you save by turning off hour x for y hours.</li><li>The matrix is processed calculating all possibilities for turning off a number of hours in a sequence and by that saving money. In this process all non-saving sequences are discarded. Also, if the average saving per hour is less than what you have configured as minimum amount to save per kWh, the sequence is discarded.</li><li>The remaining sequences are sorted by how much that is saved, in descending order.</li><li>Next, a table with one value per hour is created, with all hours in state "on".</li><li>Then the saving sequences is applied one by one, turning off the hours in each sequence, discarding sequences that lead to any violation of the rules set by the config.</li><li>When all sequences are processed, the resulting table shows a pretty good savings plan, that in most cases would be the optimal plan.</li></ol><p>I say "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.</p><h2 id="integration-with-magicmirror" tabindex="-1"><a class="header-anchor" href="#integration-with-magicmirror" aria-hidden="true">#</a> Integration with MagicMirror</h2><p>Are you using <a href="https://magicmirror.builders/" target="_blank" rel="noopener noreferrer">MagicMirror<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a>? Are you also using <a href="https://tibber.com/" target="_blank" rel="noopener noreferrer">Tibber<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a>? If so, there is a module for MM called <a href="https://github.com/ottopaulsen/MMM-Tibber" target="_blank" rel="noopener noreferrer">MMM-Tibber<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a>, that easily can be used to show savings from this node.</p><p><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"></p><p>The purple lines show savings per kWh.</p><p>Read more about this in the <a href="https://github.com/ottopaulsen/MMM-Tibber#show-savings" target="_blank" rel="noopener noreferrer">MMM-Tibber documentation<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a>.</p><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">12/12/2021, 2:17:07 PM</span></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: ottpau@gmail.com">Otto Paulsen</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav"><p class="inner"><!----><span class="next"><a href="/node-red-contrib-power-saver/nodes/ps-strategy-lowest-price.html" class="nav-link" aria-label="ps-strategy-lowest-price"><!--[--><!--]--> ps-strategy-lowest-price <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
63
|
-
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
63
|
+
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.js" defer></script>
|
|
64
64
|
</body>
|
|
65
65
|
</html>
|
|
@@ -5,7 +5,7 @@
|
|
|
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
|
<script src="https://c6.patreon.com/becomePatronButton.bundle.js"></script><link rel="icon" href="/euro.png"><title>ps-strategy-lowest-price | Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
|
|
8
|
-
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
8
|
+
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.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>
|
|
@@ -84,6 +84,6 @@
|
|
|
84
84
|
<span class="token punctuation">}</span>
|
|
85
85
|
<span class="token punctuation">}</span>
|
|
86
86
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br></div></div><p>The <code>schedule</code> array shows every time the switch is turned on or off. The <code>hours</code> array shows values per hour containing the price (received as input), whether that hour is on or off, the start time of the hour and the amount per kWh that is saved on hours that are turned off, compared to the next hour that is on.</p><h2 id="tips-tricks" tabindex="-1"><a class="header-anchor" href="#tips-tricks" aria-hidden="true">#</a> Tips & tricks</h2><h3 id="multiple-nodes-works-together" tabindex="-1"><a class="header-anchor" href="#multiple-nodes-works-together" aria-hidden="true">#</a> Multiple nodes works together</h3><p>You can use multiple nodes simultanously, for different periods, if you want more hours on one part of the day than another part, or to make sure there are at least some hours on during each period.</p><h3 id="highest-price" tabindex="-1"><a class="header-anchor" href="#highest-price" aria-hidden="true">#</a> Highest price</h3><p>If you want to find the <code>x</code> hours with the highest prices, do as follows:</p><ol><li>Calculate <code>y</code> as the total number of hours in the period. For example, if the period is from <code>08:00</code> to <code>20:00</code>, then <code>y = 12</code>.</li><li>Configure <code>Hours On = y - x</code>, so if <code>x = 4</code>, then <code>Hours On = 12 - 4 = 8</code>.</li><li>Use <strong>Output 2</strong> to get a signal when you have the hours with the highest prices. Just remember that the value sent to output 2 is <code>false</code>, not <code>true</code> as it is on output 1.</li></ol><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">12/12/2021, 2:17:07 PM</span></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: ottpau@gmail.com">Otto Paulsen</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav"><p class="inner"><span class="prev"> ← <a href="/node-red-contrib-power-saver/nodes/ps-strategy-best-save.html" class="nav-link" aria-label="ps-strategy-best-save"><!--[--><!--]--> ps-strategy-best-save <!--[--><!--]--></a></span><span class="next"><a href="/node-red-contrib-power-saver/nodes/ps-receive-price.html" class="nav-link" aria-label="ps-receive-price"><!--[--><!--]--> ps-receive-price <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
87
|
-
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
87
|
+
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.js" defer></script>
|
|
88
88
|
</body>
|
|
89
89
|
</html>
|
|
@@ -5,7 +5,7 @@
|
|
|
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
|
<script src="https://c6.patreon.com/becomePatronButton.bundle.js"></script><link rel="icon" href="/euro.png"><title>Strategy input format | Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
|
|
8
|
-
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
8
|
+
<link rel="preload" href="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.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>
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
<span class="token punctuation">]</span>
|
|
36
36
|
<span class="token punctuation">}</span>
|
|
37
37
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br></div></div><p>This format is used for:</p><ul><li>Output of the <code>ps-receive-price</code> node</li><li>Input and output of the <code>ps-xxx-add-tariff</code> nodes</li><li>Input for the strategy nodes (<code>ps-strategy-xxx-xxx</code>)</li></ul><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><span class="meta-item-info">12/12/2021, 2:17:07 PM</span></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: ottpau@gmail.com">Otto Paulsen</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
|
38
|
-
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.
|
|
38
|
+
<script src="/node-red-contrib-power-saver/assets/js/runtime~app.0d53f24f.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.342dc054.js" defer></script>
|
|
39
39
|
</body>
|
|
40
40
|
</html>
|
package/docs/changelog/README.md
CHANGED
|
@@ -6,9 +6,27 @@ sidebar: "auto"
|
|
|
6
6
|
|
|
7
7
|
List the most significant changes, starting in version 1.0.9.
|
|
8
8
|
|
|
9
|
+
## 3.0.6
|
|
10
|
+
|
|
11
|
+
Remove non-existant node from package.json.
|
|
12
|
+
|
|
13
|
+
## 3.0.5
|
|
14
|
+
|
|
15
|
+
- Move dependencies to correct section (node_fetch and lodash.cloneDeep).
|
|
16
|
+
|
|
17
|
+
## 3.0.4
|
|
18
|
+
|
|
19
|
+
- Remove `null`-values from Nordpool data for `tomorrow`.
|
|
20
|
+
|
|
21
|
+
## 3.0.3
|
|
22
|
+
|
|
23
|
+
- Fix bug in lowest price strategy, when period ends at midnight.
|
|
24
|
+
- Fix labels for hours on, so they do not have leading zero.
|
|
25
|
+
- Fix so source should be visible in output 3.
|
|
26
|
+
|
|
9
27
|
## 3.0.2
|
|
10
28
|
|
|
11
|
-
- Bugfix in Lowest Price node
|
|
29
|
+
- Bugfix in Lowest Price node (not successful)
|
|
12
30
|
|
|
13
31
|
## 3.0.1
|
|
14
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-power-saver",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "A module for Node-RED that you can use to turn on and off a switch based on power prices",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"expect": "^27.0.2",
|
|
43
|
-
"lodash.clonedeep": "^4.5.0",
|
|
44
43
|
"mocha": "^6.2.1",
|
|
45
|
-
"node-fetch": "^2.6.6",
|
|
46
44
|
"node-red": "^1.3.5",
|
|
47
45
|
"node-red-node-test-helper": "^0.2.7",
|
|
48
46
|
"vuepress": "^2.0.0-beta.27"
|
|
49
47
|
},
|
|
50
48
|
"dependencies": {
|
|
49
|
+
"lodash.clonedeep": "^4.5.0",
|
|
50
|
+
"node-fetch": "^2.6.6",
|
|
51
51
|
"luxon": "^1.27.0"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/src/handle-input.js
CHANGED
|
@@ -15,9 +15,9 @@ function getPriceData(node, msg) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
priceData = [...input.today, ...input.tomorrow];
|
|
18
|
-
|
|
18
|
+
const source = input.source;
|
|
19
19
|
node.context().set("lastPriceData", priceData);
|
|
20
|
-
return priceData;
|
|
20
|
+
return { priceData, source };
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function validateMsg(node, msg) {
|
|
@@ -74,16 +74,20 @@ function convertMsg(msg) {
|
|
|
74
74
|
}));
|
|
75
75
|
} else if (msg.data?.new_state?.attributes["raw_" + day]) {
|
|
76
76
|
result.source = "Nordpool";
|
|
77
|
-
result[day] = msg.data.new_state.attributes["raw_" + day]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
result[day] = msg.data.new_state.attributes["raw_" + day]
|
|
78
|
+
.filter((v) => v.value)
|
|
79
|
+
.map((v) => ({
|
|
80
|
+
value: v.value,
|
|
81
|
+
start: v.start,
|
|
82
|
+
}));
|
|
81
83
|
} else if (msg.payload?.attributes && msg.payload?.attributes["raw_" + day]) {
|
|
82
84
|
result.source = "Nordpool";
|
|
83
|
-
result[day] = msg.payload.attributes["raw_" + day]
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
result[day] = msg.payload.attributes["raw_" + day]
|
|
86
|
+
.filter((v) => v.value)
|
|
87
|
+
.map((v) => ({
|
|
88
|
+
value: v.value,
|
|
89
|
+
start: v.start,
|
|
90
|
+
}));
|
|
87
91
|
} else {
|
|
88
92
|
result.source = "Other";
|
|
89
93
|
result[day] = msg.payload[day] || [];
|
package/src/receive-price.js
CHANGED
|
@@ -6,14 +6,14 @@ module.exports = function (RED) {
|
|
|
6
6
|
const node = this;
|
|
7
7
|
|
|
8
8
|
node.on("input", function (msg) {
|
|
9
|
-
const priceData = getPriceData(node, msg);
|
|
9
|
+
const { priceData, source } = getPriceData(node, msg);
|
|
10
10
|
if (!priceData) {
|
|
11
11
|
// Set status failed
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Send output
|
|
16
|
-
node.send({ payload: { priceData } });
|
|
16
|
+
node.send({ payload: { priceData, source } });
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
{
|
|
109
109
|
value: "hourson",
|
|
110
110
|
options: (() => {
|
|
111
|
-
const res = hours.map((h) => ({ value: h, label: h }));
|
|
111
|
+
const res = hours.map((h) => ({ value: "" + parseInt(h), label: "" + parseInt(h) }));
|
|
112
112
|
res.push({ value: "24", label: "24" });
|
|
113
113
|
return res;
|
|
114
114
|
})(),
|
|
@@ -41,14 +41,14 @@ function doPlanning(node, _, priceData, _, dateDayBefore, _) {
|
|
|
41
41
|
const periodStatus = [];
|
|
42
42
|
const startIndexes = [];
|
|
43
43
|
const endIndexes = [];
|
|
44
|
-
let currentStatus = from < to ? "Outside" : "StartMissing";
|
|
44
|
+
let currentStatus = from < (to === 0 && to !== from ? 24 : to) ? "Outside" : "StartMissing";
|
|
45
45
|
let hour;
|
|
46
46
|
priceData.forEach((pd, i) => {
|
|
47
47
|
hour = DateTime.fromISO(pd.start).hour;
|
|
48
48
|
if (hour === to && to === from && currentStatus === "Inside") {
|
|
49
49
|
endIndexes.push(i - 1);
|
|
50
50
|
}
|
|
51
|
-
if (hour === to && to !== from) {
|
|
51
|
+
if (hour === to && to !== from && i > 0) {
|
|
52
52
|
currentStatus = "Outside";
|
|
53
53
|
endIndexes.push(i - 1);
|
|
54
54
|
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "Tibber",
|
|
3
|
+
"priceData": [
|
|
4
|
+
{
|
|
5
|
+
"value": 0.4675,
|
|
6
|
+
"start": "2021-12-14T00:00:00.000+01:00"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"value": 0.4488,
|
|
10
|
+
"start": "2021-12-14T01:00:00.000+01:00"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"value": 0.4344,
|
|
14
|
+
"start": "2021-12-14T02:00:00.000+01:00"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"value": 0.4124,
|
|
18
|
+
"start": "2021-12-14T03:00:00.000+01:00"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"value": 0.413,
|
|
22
|
+
"start": "2021-12-14T04:00:00.000+01:00"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"value": 0.4232,
|
|
26
|
+
"start": "2021-12-14T05:00:00.000+01:00"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"value": 0.4,
|
|
30
|
+
"start": "2021-12-14T06:00:00.000+01:00"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"value": 0.4067,
|
|
34
|
+
"start": "2021-12-14T07:00:00.000+01:00"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"value": 0.504,
|
|
38
|
+
"start": "2021-12-14T08:00:00.000+01:00"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"value": 0.5341,
|
|
42
|
+
"start": "2021-12-14T09:00:00.000+01:00"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"value": 0.5179,
|
|
46
|
+
"start": "2021-12-14T10:00:00.000+01:00"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"value": 0.5375,
|
|
50
|
+
"start": "2021-12-14T11:00:00.000+01:00"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"value": 0.535,
|
|
54
|
+
"start": "2021-12-14T12:00:00.000+01:00"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"value": 0.5403,
|
|
58
|
+
"start": "2021-12-14T13:00:00.000+01:00"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"value": 0.5291,
|
|
62
|
+
"start": "2021-12-14T14:00:00.000+01:00"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"value": 0.5175,
|
|
66
|
+
"start": "2021-12-14T15:00:00.000+01:00"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"value": 0.4914,
|
|
70
|
+
"start": "2021-12-14T16:00:00.000+01:00"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"value": 0.4698,
|
|
74
|
+
"start": "2021-12-14T17:00:00.000+01:00"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"value": 0.4609,
|
|
78
|
+
"start": "2021-12-14T18:00:00.000+01:00"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"value": 0.4408,
|
|
82
|
+
"start": "2021-12-14T19:00:00.000+01:00"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"value": 0.4263,
|
|
86
|
+
"start": "2021-12-14T20:00:00.000+01:00"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"value": 0.3946,
|
|
90
|
+
"start": "2021-12-14T21:00:00.000+01:00"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"value": 0.3852,
|
|
94
|
+
"start": "2021-12-14T22:00:00.000+01:00"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"value": 0.373,
|
|
98
|
+
"start": "2021-12-14T23:00:00.000+01:00"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"value": 0.4675,
|
|
102
|
+
"start": "2021-12-15T00:00:00.000+01:00"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"value": 0.4488,
|
|
106
|
+
"start": "2021-12-15T01:00:00.000+01:00"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"value": 0.4344,
|
|
110
|
+
"start": "2021-12-15T02:00:00.000+01:00"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"value": 0.4124,
|
|
114
|
+
"start": "2021-12-15T03:00:00.000+01:00"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"value": 0.413,
|
|
118
|
+
"start": "2021-12-15T04:00:00.000+01:00"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"value": 0.4232,
|
|
122
|
+
"start": "2021-12-15T05:00:00.000+01:00"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"value": 0.4,
|
|
126
|
+
"start": "2021-12-15T06:00:00.000+01:00"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"value": 0.4067,
|
|
130
|
+
"start": "2021-12-15T07:00:00.000+01:00"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"value": 0.504,
|
|
134
|
+
"start": "2021-12-15T08:00:00.000+01:00"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"value": 0.5341,
|
|
138
|
+
"start": "2021-12-15T09:00:00.000+01:00"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"value": 0.5179,
|
|
142
|
+
"start": "2021-12-15T10:00:00.000+01:00"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"value": 0.5375,
|
|
146
|
+
"start": "2021-12-15T11:00:00.000+01:00"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"value": 0.535,
|
|
150
|
+
"start": "2021-12-15T12:00:00.000+01:00"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"value": 0.5403,
|
|
154
|
+
"start": "2021-12-15T13:00:00.000+01:00"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"value": 0.5291,
|
|
158
|
+
"start": "2021-12-15T14:00:00.000+01:00"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"value": 0.5175,
|
|
162
|
+
"start": "2021-12-15T15:00:00.000+01:00"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"value": 0.4914,
|
|
166
|
+
"start": "2021-12-15T16:00:00.000+01:00"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"value": 0.4698,
|
|
170
|
+
"start": "2021-12-15T17:00:00.000+01:00"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"value": 0.4609,
|
|
174
|
+
"start": "2021-12-15T18:00:00.000+01:00"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"value": 0.4408,
|
|
178
|
+
"start": "2021-12-15T19:00:00.000+01:00"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"value": 0.4263,
|
|
182
|
+
"start": "2021-12-15T20:00:00.000+01:00"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"value": 0.3946,
|
|
186
|
+
"start": "2021-12-15T21:00:00.000+01:00"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"value": 0.3852,
|
|
190
|
+
"start": "2021-12-15T22:00:00.000+01:00"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"value": 0.373,
|
|
194
|
+
"start": "2021-12-15T23:00:00.000+01:00"
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|