Power consumption Graph

Is anyone using HE data to graph power consumption? If so, what are you using and how do you set it up? I want to see what a device is using over time.

Take a look at influxdb..

here is my HEMv1 for the entire house.

1 Like

WOW! influx is way too expensive!

Ummmm, it’s free to run on your own local server

1 Like

How are you exporting data?

I don’t see that on their website.

https://portal.influxdata.com/downloads

Then I missed something. I see their website, $249 a month. Higher if you want to use their cloudserver. Nowhere does it say free, other than 15 day free trial.
Please post a link where it can be used for free on your own local server.

Been using it and grafana for years. Free all the way.


2 Likes

Are you using separate HEMs for all those in HE?

Multiple HEM's, Iris/ST outlets, Aotec Smart Plugs and strips. Most are still on ST as HE really doesn't like smoothly reporting power from most of them.

I use "to the second" power reports for a lot of automations, so I still have a lot of cross integration with ST and HE.

Take a look here for instruction. Some of us already ported the smartapp over to HE but it's not 100% but functional for data logging. Just don't enable logging of hub properties and you'll be fine.

1 Like

I supposed you were using something else because me with one HEM in HE means trouble...

Thanks for the info.

I would like this functionality, but unfortunately it looks too complicated for my experience. :frowning:

Not being able to see the "free to run on your own local server" plainly is by design. They want you to buy things so they can stay in business. But a single-node instance of influxdb can definitely be used for free.

The link that @ogiewon posted earlier is what you want. Click on the "v.1.6.3":

image

You'll see a bunch of different options for how you can run it depending on your platform.

What driver do you use for your HEM in HE?

I'm using this driver.

/**
 *  Aeon HEM1
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *  Aeon Home Energy Meter v1 (US)
 *
 */
metadata {
    definition (name: "My Aeon Home Energy Monitor v3", namespace: "jscgs350", author: "SmartThings") 
	{
    	capability "Energy Meter"
    	capability "Power Meter"
    	capability "Configuration"
    	capability "Sensor"
    	capability "Refresh"
    	capability "Polling"
    	capability "Battery"
    
    	attribute "energy", "string"
    	attribute "energyDisp", "string"
    	attribute "energyOne", "string"
    	attribute "energyTwo", "string"
    
    	attribute "power", "string"
    	attribute "powerDisp", "string"
    	attribute "powerOne", "string"
    	attribute "powerTwo", "string"
    
    	command "reset"
    	command "configure"
    	command "resetmaxmin"
    
    fingerprint deviceId: "0x2101", inClusters: " 0x70,0x31,0x72,0x86,0x32,0x80,0x85,0x60"

}

	preferences {
		input "kWhCost", "string", title: "\$/kWh (0.16)", defaultValue: "0.16" as String, displayDuringSetup: true
	}
}


def parse(String description) {
    //log.debug "Parse received ${description}"
	def result = []
	//log.debug "desc: ${description}"
    def cmd = zwave.parse(description, [0x31: 1, 0x32: 1, 0x60: 3])
    if (cmd) {
        result << createEvent(zwaveEvent(cmd))
    }
    //if (result) log.debug "Parse returned ${result}"
    def statusTextmsg = ""
    statusTextmsg = "Min was ${device.currentState('powerOne')?.value}\nMax was ${device.currentState('powerTwo')?.value}"
    sendEvent("name":"statusText", "value":statusTextmsg)
    //log.debug statusTextmsg
    return result
}

def zwaveEvent(hubitat.zwave.commands.meterv1.MeterReport cmd) {
    //log.debug "zwaveEvent received ${cmd} ${cmd.payload} ${cmd.format()}"
    def dispValue
    def newValue
    def timeString = new Date().format("yyyy-MM-dd h:mm a", location.timeZone)
    if (cmd.meterType == 33) {
        if (cmd.scale == 0) {
            newValue = cmd.scaledMeterValue
            log.debug state
            if (newValue != state.energyValue) {
                dispValue = String.format("%5.2f",newValue)+"\nkWh"
                sendEvent(name: "energyDisp", value: dispValue as String, unit: "")
                state.energyValue = newValue
                BigDecimal costDecimal = newValue * ( kWhCost as BigDecimal)
                def costDisplay = String.format("%3.2f",costDecimal)
                sendEvent(name: "energyTwo", value: "Cost\n\$${costDisplay}", unit: "")
                [name: "energy", value: newValue, unit: "kWh"]
            }
        } else if (cmd.scale == 1) {
            newValue = cmd.scaledMeterValue
            if (newValue != state.energyValue) {
                dispValue = String.format("%5.2f",newValue)+"\nkVAh"
                sendEvent(name: "energyDisp", value: dispValue as String, unit: "")
                state.energyValue = newValue
                [name: "energy", value: newValue, unit: "kVAh"]
            }
        }
        else if (cmd.scale==2) {                
            newValue = Math.round( cmd.scaledMeterValue )       // really not worth the hassle to show decimals for Watts
            if (newValue != state.powerValue) {
                dispValue = newValue+"w"
                sendEvent(name: "powerDisp", value: dispValue as String, unit: "")
                if (newValue < state.powerLow) {
                    dispValue = newValue+"w"+" on "+timeString
                    sendEvent(name: "powerOne", value: dispValue as String, unit: "")
                    state.powerLow = newValue
                }
                if (newValue > state.powerHigh) {
                    dispValue = newValue+"w"+" on "+timeString
                    sendEvent(name: "powerTwo", value: dispValue as String, unit: "")
                    state.powerHigh = newValue
                }
                state.powerValue = newValue
                [name: "power", value: newValue, unit: "W"]
            }
        }
    }
}

def zwaveEvent(hubitat.zwave.commands.batteryv1.BatteryReport cmd) {
    def map = [:]
    map.name = "battery"
    map.unit = "%"
    if (cmd.batteryLevel == 0xFF) {
        map.value = 1
        map.descriptionText = "${device.displayName} has a low battery"
        map.isStateChange = true
    } else {
        map.value = cmd.batteryLevel
    }
    //log.debug map
    return map
}

def zwaveEvent(hubitat.zwave.Command cmd) {
    // Handles all Z-Wave commands we aren't interested in
    log.debug "Unhandled event ${cmd}"
    [:]
}

def refresh() {
    log.debug "Refreshed ${device.name}"
    def cmds = delayBetween([
    zwave.meterV2.meterGet(scale: 0).format(),
    zwave.meterV2.meterGet(scale: 2).format()
	])
log.debug "refresh cmds ${cmds}"
cmds
}

def poll() {
    refresh()
}

def reset() {
    log.debug "${device.name} reset kWh/Cost values"
    state.powerHigh = 0
	state.powerLow = 99999

	def timeString = new Date().format("yyyy-MM-dd h:mm a", location.timeZone)
    sendEvent(name: "energyOne", value: "Energy Data (kWh/Cost) Reset On:\n"+timeString, unit: "")       
    sendEvent(name: "energyDisp", value: "", unit: "")
    sendEvent(name: "energyTwo", value: "Cost\n--", unit: "")

    def cmd = delayBetween( [
        zwave.meterV2.meterReset().format(),
        zwave.meterV2.meterGet(scale: 0).format(),
    	zwave.meterV2.meterGet(scale: 2).format()
    ])
    
    cmd
}

def resetmaxmin() {
    log.debug "${device.name} reset max/min values"
    state.powerHigh = 0
    state.powerLow = 99999
    
	def timeString = new Date().format("yyyy-MM-dd h:mm a", location.timeZone)
    sendEvent(name: "energyOne", value: "Watts Data (min/max) Reset On:\n"+timeString, unit: "")
    sendEvent(name: "powerOne", value: "", unit: "")    
    sendEvent(name: "powerTwo", value: "", unit: "")    

    def cmd = delayBetween( [
        zwave.meterV2.meterGet(scale: 0).format(),
    	zwave.meterV2.meterGet(scale: 2).format()
    ])
    
    cmd
}

def configure() {
    log.debug "${device.name} configuring device"
    def cmd = delayBetween([
    	//zwave.configurationV1.configurationSet(parameterNumber: 255, size: 4, scaledConfigurationValue: 1).format() 	// Performs a complete factory reset.  Use this all by itself and comment out all others below.  Once reset, comment this line out and uncomment the others to go back to normal
    
        zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, scaledConfigurationValue: 1).format(),      // Disable selective reporting, so always update based on schedule below <set to 1 to reduce network traffic>
        zwave.configurationV1.configurationSet(parameterNumber: 4, size: 2, scaledConfigurationValue: 50).format(),     // (DISABLED by first option) Don't send unless watts have changed by 25 <default is 50>
        zwave.configurationV1.configurationSet(parameterNumber: 8, size: 1, scaledConfigurationValue: 10).format(),     // (DISABLED by first option) Or by 5% <default is 10>

        zwave.configurationV1.configurationSet(parameterNumber: 101, size: 4, scaledConfigurationValue: 4).format(),    // Combined energy in Watts
        zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 30).format(),   // Every 60 Seconds (for Watts)

        zwave.configurationV1.configurationSet(parameterNumber: 102, size: 4, scaledConfigurationValue: 8).format(),    // Combined energy in kWh
        zwave.configurationV1.configurationSet(parameterNumber: 112, size: 4, scaledConfigurationValue: 60).format(),   // every 5 minutes (for kWh)

        zwave.configurationV1.configurationSet(parameterNumber: 103, size: 4, scaledConfigurationValue: 0).format(),    // Disable report 3
        zwave.configurationV1.configurationSet(parameterNumber: 113, size: 4, scaledConfigurationValue: 0).format()     // Disable report 3
      
    ])

    cmd
}

I haven't seen this version of the driver yet. I tried it but don't get the updates as the config shows, or I'm reading it wrong. The value for watts is 30 seconds (vs 60 in comment) and 60 seconds for energy (vs 5 min in comments). Is a factory reset with the commented out line necessary to get it working right? I'm having well over a few minutes between watt updates.

I am not sure. How are you powering it? I am using USB power. I am getting a reading every minute.

dev:5252018-09-22 08:33:05.476:debug[powerLow:-1840644, powerValue:1551, powerHigh:1484259, energyValue:1527.933]

dev:5252018-09-22 08:32:05.455:debug[powerLow:-1840644, powerValue:1551, powerHigh:1484259, energyValue:1527.912]

dev:5252018-09-22 08:31:05.446:debug[powerLow:-1840644, powerValue:1551, powerHigh:1484259, energyValue:1527.885]

dev:5252018-09-22 08:30:05.436:debug[powerLow:-1840644, powerValue:1551, powerHigh:1484259, energyValue:1527.858]

USB as well. One of my HEM's reports roughly every minute even though it's set to 15 seconds, my primary just never is consistent. I've physically reset and re-added a number of times. I have about 4-5 paired to HE right now, very strong mesh in that area as well.

Here's what I see with the built in HEM driver:

power 350 W DEVICE 2018-09-22 9:45:07.543 AM MDT
energy 510.555 kWh DEVICE 2018-09-22 9:44:37.544 AM MDT
power 304 W DEVICE 2018-09-22 9:40:07.505 AM MDT
energy 510.531 kWh DEVICE 2018-09-22 9:39:37.573 AM MDT
power 329 W DEVICE 2018-09-22 9:35:07.470 AM MDT
power 272 W DEVICE 2018-09-22 9:30:07.445 AM MDT
energy 510.481 kWh DEVICE 2018-09-22 9:29:37.445 AM MDT
power 294 W DEVICE 2018-09-22 9:25:07.409 AM MDT
energy 510.456 kWh DEVICE 2018-09-22 9:24:37.410 AM MDT
energy 510.316 kWh DEVICE 2018-09-22 8:54:37.201 AM MDT

And the version of the driver you use after a full reset, no updates since I captured this:

dev:5542018-09-22 09:46:40.728:debug[powerLow:99999, powerValue:1572, powerHigh:0, energyValue:0.002]

dev:5542018-09-22 09:46:40.546:debugEnergy Meter reset max/min values

dev:5542018-09-22 09:46:39.654:debugEnergy Meter reset kWh/Cost values

dev:5542018-09-22 09:46:17.482:debugEnergy Meter configuring device