node-red-contrib-energymeterplus 0.3.6 → 1.0.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ##### **EnergyMeterPlus** Node Version 1.0.1
2
2
  @ arcfrankye 26-06-26
3
-
3
+ {The first stable release is here at last!}
4
4
 
5
5
 
6
6
  ###### Overview
@@ -130,7 +130,94 @@ Note: field names are `energyDaily`, `energyWeekly`, `energyMonthly`, `energyYea
130
130
  * Initial release: integrates power to energy, cost calc, rollovers, persistence, and basic baseline support.
131
131
 
132
132
 
133
-
133
+ ###### Quick Start Demo Flow
134
+ To help you get started with **EnergyMeterPlus**, here is a small demo flow you can import directly into Node RED. It shows how to use the new Apply and Reset features, as well as runtime messages.
135
+
136
+ **Steps**
137
+ Open Node RED.
138
+
139
+ Click the menu (top right) → Import → Clipboard.
140
+
141
+ Paste the JSON below into the box.
142
+
143
+ Click Import.
144
+
145
+ You should see two Inject nodes wired into **EnergyMeterPlus** and a "Energy Output" debug node.
146
+
147
+ Click the Inject buttons to test Apply/Reset and watch the payloads in the Debug sidebar.
148
+
149
+ **Demo Flow JSON**
150
+ json
151
+ [
152
+ {
153
+ "id": "inject-apply",
154
+ "type": "inject",
155
+ "z": "flow1",
156
+ "name": "Apply Baseline (2 kWh daily)",
157
+ "props": [
158
+ { "p": "payload" },
159
+ { "p": "topic", "vt": "str" }
160
+ ],
161
+ "payload": "{\"daily\":2,\"weekly\":0,\"monthly\":0,\"yearly\":0}",
162
+ "payloadType": "json",
163
+ "topic": "applyBaseline",
164
+ "x": 180,
165
+ "y": 120,
166
+ "wires": [["energyMeterPlus"]]
167
+ },
168
+ {
169
+ "id": "inject-reset",
170
+ "type": "inject",
171
+ "z": "flow1",
172
+ "name": "Reset Editor Applied",
173
+ "props": [
174
+ { "p": "topic", "vt": "str" }
175
+ ],
176
+ "topic": "resetEditorApplied",
177
+ "x": 170,
178
+ "y": 180,
179
+ "wires": [["energyMeterPlus"]]
180
+ },
181
+ {
182
+ "id": "energyMeterPlus",
183
+ "type": "energyMeterPlus",
184
+ "z": "flow1",
185
+ "name": "EnergyMeterPlus",
186
+ "unitCost": "0.15",
187
+ "currency": "USD",
188
+ "filePath": "/config/node_red/solargen_data.json",
189
+ "inputUnit": "W",
190
+ "baselineDaily": "0",
191
+ "baselineWeekly": "0",
192
+ "baselineMonthly": "0",
193
+ "baselineYearly": "0",
194
+ "applied": false,
195
+ "x": 420,
196
+ "y": 150,
197
+ "wires": [["debug-output"]]
198
+ },
199
+ {
200
+ "id": "debug-output",
201
+ "type": "debug",
202
+ "z": "flow1",
203
+ "name": "Energy Output",
204
+ "active": true,
205
+ "tosidebar": true,
206
+ "console": false,
207
+ "tostatus": false,
208
+ "complete": "payload",
209
+ "targetType": "msg",
210
+ "x": 650,
211
+ "y": 150,
212
+ "wires": []
213
+ }
214
+ ]
215
+ **What it does**
216
+ Apply Baseline (2 kWh daily) → sends a runtime applyBaseline message that adds 2 kWh to the daily baseline immediately.
217
+
218
+ Reset Editor Applied → clears the remembered editor baseline so the same values can be applied again on next Deploy.
219
+
220
+ Debug Output → shows the updated payload with energy totals and costs.
134
221
 
135
222
 
136
223
 
@@ -122,6 +122,15 @@ RED.nodes.registerType('energyMeterPlus', {
122
122
  });
123
123
  </script>
124
124
 
125
+ <!-- Tool tip -->
126
+ <script type="text/x-red" data-help-name="energyMeterPlus">
127
+ <p><b>EnergyMeterPlus</b>: Converts instantaneous power readings into accumulated energy totals and cost, with robust baseline handling with archiving.</p>
128
+ <p><b>EnergyMeterPlus</b>: node integrates instantaneous power readings into daily, weekly, monthly, and yearly energy totals, with rollover logic that can be aligned to your reporting cycle.</p>
129
+ <p> Baseline offsets are applied once using the editor’s Apply button, preventing accidental double‑application, while the Reset button allows intentional re‑application when needed.</p>
130
+ <p>Totals and costs are persisted in context and written to file, with optional archiving of yearly data for long‑term analysis. Outputs are rounded for clean dashboard display.</p>
131
+ </script>
132
+
133
+
125
134
  <!-- Template -->
126
135
  <script type="text/x-red" data-template-name="energyMeterPlus">
127
136
  <div class="form-row">
@@ -1,5 +1,5 @@
1
1
  /**
2
- * energyMeterPlus runtime
2
+ * energyMeterPlus runtime #arcfrankye - 27/06/2026
3
3
  * - Applies editor baseline offsets exactly once when editor sets `applied` and you Deploy.
4
4
  * - Uses lastAppliedEditor in node context to avoid double application.
5
5
  * - Supports runtime messages:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-energymeterplus",
3
- "version": "0.3.6",
3
+ "version": "1.0.1",
4
4
  "description": "A custom Node-RED node that integrates power readings into energy totals with persistence and cost calculation.",
5
5
  "author": "Arcfrankye",
6
6
  "license": "MIT",