Add(+) the KWh of Three Meters Together (for plotting)

Posted on
Wed Jul 25, 2018 11:04 pm
kpurintun offline
Posts: 16
Joined: Feb 03, 2017

Add(+) the KWh of Three Meters Together (for plotting)

I have three of the Z-wave 2 leg meters, on on each AC unit, and the other on the rest of the house. i have a split panel that allows me to do that.

I would like to add the value of each of the three devices together for whole house power usage reference, and for plotting in IndigoPlotD. I got in, set the reset schedule for once a month, then started looking around.

IndigoPlotD has the ability to "math" two things together. but I can't see how to do three. I looked at adapters. its pretty cool, but does not seem do do math between multiple devices. scripting seems to be the only way. I am not a scripter at all. I jumped in there like a little boy into the cockpit of a 747. i was fully lost.

anyone have some ideas?

Thanks,

Kyle

Posted on
Wed Jul 25, 2018 11:49 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Add(+) the KWh of Three Meters Together (for plotting)

Yes indigoplotd right now can add 2 data sources into one line.
Let me think about how to do 3.


Sent from my iPhone using Tapatalk

Posted on
Mon Jul 30, 2018 8:05 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Add(+) the KWh of Three Meters Together (for plotting)

Code: Select all
### to sum up 3 energy values, put this into the action (server/execute script) of a schedule and run it once / minute
### then in variable   totalEnergy   you should have the total and that you can plot.


# replace energy1 .. with the 3 names of your devices and StateName with the name of the state that shows the energy
var1 = float(indigo.devices["energy1"]["stateName"])
var2 = float(indigo.devices["energy2"]["stateName"])
var3 = float(indigo.devices["energy3"]["stateName"])

# add it up 
total = var1+var2+var3

# and format it ( eg 2345.1 )
totalText = "%.1f"% (total)

# just for .. of it log the result
indigo.server.log("total= "+ totalText)

# this varibale should already exist, and will contain the total
indigo.variable.updateValue("totalEnergy", totalText)


this should do it

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests