Tracking many devices energy usage values? Lists? Multiple variables? Key/Value pairs?


#1

1) Give a description of the problem
I’m trying to make a piston to send me emails with my daily / weekly / monthly power usage for a handful of devices around the house (currently 10 devices, plus 1 summed value from 2 of the devices). I’d like to find an easier way to track the kWh readings from these devices rather than having at least 3 variables per device (yesterday, last week, last month), or 4 if I create a cost variable for each (to throw in my html email that I’m generating)… That’s 30-40 variables, just to track energy and cost!

2) What is the expected behavior?
I’d like to be able to use some kind of lists or key/value pair type variables to store these values in, and be able to address them as such in the code.

3) What is happening/not happening?
Just looking for an easier way to handle this many data points

4) Post a Green Snapshot of the pistonimage
Here’s what it looks like so far (I just added the decimal[ ] lists, haven’t updated the code to use them yet…

5) Attach any logs (From ST IDE and by turning logging level to Full)
No logs yet, as the piston is not implemented at this time…


#2

I am on mobile right now and can’t get a good screen grab from this one. Also I can’t remember who originally wrote this but I believe it was @ady624.

Use restore code eve7c

You only need to add your power devices to the variable. It handles the rest.


#3

Cool, I will check it out tomorrow. I was in progress of doing the ~40 variable solution to notify me of daily, weekly, monthly, and yearly usage / cost