caseyjhol / node-red-contrib-tplink

A collection of Node-RED nodes for TP-Link Smart Home devices
https://www.npmjs.com/package/node-red-contrib-tplink-iot
MIT License
16 stars 15 forks source link

Adding DayStats capabilities for power consumption #30

Open ggarnier12 opened 4 years ago

ggarnier12 commented 4 years ago

I added two addtitional command cases to leverage getDayStats function from tplink-smarthome-api :

I successfully tested these with nodered pushing the commands through msg.payload input.

StuFrankish commented 3 years ago

I've just seen this PR only after I've raised a feature request for something very similar (if not the same). Can someone confirm if the request I've raised here (#56), will be covered by these changes, and when these changed might be merged and released?

@caseyjhol Any update on this project?

caseyjhol commented 1 year ago

If you could add some documentation for this I can get it merged in.

normanr commented 1 year ago

If you could add some documentation for this I can get it merged in.

Is this "just" a matter of adding two lines to the Commands section in kasa.html (around line ~200)?

Something like:

       <li><code>getMeterInfo</code> - Fetch the current device consumption.</li>
+      <li><code>getMeterCurrentMonthDayStats</code> - Fetch the consumption statistics corresponding to current month.</li>
+      <li><code>getMeterLastMonthDayStats</code> - Fetch the consumption statistics corresponding to last month.</li>
       <li><code>eraseStats</code> - Clear all the meter statistics.</li>

@ggarnier12 could you add this to the PR?