Aeon Labs Home Energy Monitor Gen 5 (ZW095) - Readings Double of Actual

I have had the above installed for about two weeks now but noticed a problem with the data being read almost immediately. When compared to actual reading from my meter (as well as my electrical company data), the HEM numbers appeared to be twice that of actual. For the past 6+ days I started logging the data every hour and comparing the readings to that provided by my electric company. Sure enough, the HEM numbers were, on average, double. In fact, this was so consistent that over the past 6 days the HEM readings divided by 2 then compared to actual meter readings were off by a negligible amount of 200 watts. Recently, I modified the DH Aeon HEM Gen5(zwave plus) by Dillon A. Miller to divide the amps/watts/Kwh readings by 2. All seems good.

I contacted Aeon Labs and after much ado they suggested it may be defective and I send it back to them (if I am in the US, which I am not). I am not convinced its defective. The readings are too consistent. What I am questioning is my actual hookup as shown below

This hookup is identical to the instruction provided with this device however, is it possible that the close proximity of the White cable could be causing the numbers to double???

Other things I have tried
Remove one or the other clamps - Remaining clamp still reads double.
Connected the device to Aeon Labs USB stick and Home Assistant software - readings still double.

You have this connected correctly. The clamp proximity to the white neutral will not cause any issues.
Watts, which is what you are measuring here is a product of current (amps) times voltage.
The aem voltage is a configuration parameter within the aim. If the configured voltage in the device is different from your actual mains voltage your readings will be off.
If your divisor hack is producing correct output I would call it done.

1 Like

Thanks for the reply. The only thing I can think of that would cause these numbers to be double the actual is the device firmware. As far as I can tell, there is no way to check/update the FW version on this HEM. Right?

@cdikland, there is a firmware update available for the HEM’s:

http://aeotec.com/z-wave-home-energy-measure/1262-hem-firmware.html

How do you update it?? :scream:This unit doesnt have a usb port that I can see.

I have the HEM v1, and the USB port is next to where the clamps connect to the device. The Gen 5 doesn’t? How about inside somewhere?

Not that I can see. The description of this unit includes the following:

Other Special Features:
 Support "Over the Air Firmware Updating" and “Z-Wave Security”. 

What ever that means

Hi,

Any luck with getting better reporting from your device?

Thanks!
KO

Hi,

I have the same issue that the reading is double. Could you share the code change you did to divide the values in the DH?

Thanks!

Sure can. If I don’t respond by 2morrow afternoon feel free to repost and remind me

I am assuming you are using the same DH I am. The top of the DH code contains
/*

  • Aeon HEM Gen5(zwave plus) - original unmodified version
  • Copyright 2016 Dillon A. Miller
  • v0.8 of Aeon HEM Gen5(zwave plus) code, released 04/15/2016 for Aeotec Model zw095-a
  • This Gen5 device handler is not backward compatible with the Aeon V1 or V2 device. If your model number is not zw095-a, don’t use it.
    */

If so, replace the original def zwaveEvent(physicalgraph.zwave.commands.meterv3.MeterReport cmd) and def zwaveEvent(physicalgraph.zwave.commands.multichannelv3.MultiChannelCmdEncap cmd) functions with the two below. Note that I have added an attribute called divFactor . It divides all the double redings I was getting by… you guessed… 2 :slight_smile:

def zwaveEvent(physicalgraph.zwave.commands.meterv3.MeterReport cmd) {
	def divFactor=2
    def newValue
    def meterTypes = ["Unknown", "Electric", "Gas", "Water"]
    def electricNames = ["energy", "energy", "power", "count",  "voltage", "current", "powerFactor",  "unknown"]
    def electricUnits = ["kWh",    "kVAh",   "W",     "pulses", "V",       "A",       "Power Factor", ""]

    //NOTE ScaledPreviousMeterValue does not always contain a value
    def previousValue = cmd.scaledPreviousMeterValue ?: 0

    //Here is where all HEM polled values are defined. Scale(0-7) is in reference to the Aeon Labs HEM Gen5 data for kWh, kVAh, W, V, A, and M.S.T. respectively.
    //If scale 7 (M.S.T.) is polled, you would receive Scale2(0-1) which is kVar, and kVarh respectively. We are ignoring the Scale2 ranges in this device handler.
    def map = [ name: electricNames[cmd.scale], unit: electricUnits[cmd.scale], displayed: state.display]
    switch(cmd.scale) {
        case 0: //kWh
						previousValue = device.currentValue("energy") ?: cmd.scaledPreviousMeterValue ?: 0
                        log.trace "Previous KWh = $previousValue"
						BigDecimal costDecimal = (cmd.scaledMeterValue * (kWhCost as BigDecimal)) / divFactor
						def costDisplay = String.format("%5.2f",costDecimal)
						sendEvent(name: "cost", value: costDisplay, unit: "", descriptionText: "Display Cost: \$${costDisp}")
						newValue = Math.round(cmd.scaledMeterValue * 100  / divFactor) / 100
						map.value = newValue
                        log.trace "Current KWh ${newValue}"
            break;
        case 1: //kVAh (not used in the U.S.)
            map.value = cmd.scaledMeterValue
            break;
        case 2: //Watts
            previousValue = device.currentValue("power") ?: cmd.scaledPreviousMeterValue ?: 0
            map.value = Math.round(cmd.scaledMeterValue / divFactor)
            log.trace "Total Watts: ${cmd.scaledMeterValue/ divFactor}"
            break;
        case 3: //pulses
						map.value = Math.round(cmd.scaledMeterValue/ divFactor)
        //   log.trace "No idea1: ${cmd.scaledMeterValue}"
            break;
        case 4: //Volts
            previousValue = device.currentValue("voltage") ?: cmd.scaledPreviousMeterValue ?: 0
			newValue = Math.round(cmd.scaledMeterValue * 100) / 100
            map.value = newValue
   //        log.trace "Voltage: ${cmd.scaledMeterValue}"
            break;
        case 5: //Amps
            previousValue = device.currentValue("current") ?: cmd.scaledPreviousMeterValue ?: 0
			newValue = Math.round(cmd.scaledMeterValue * 100 / divFactor) / 100
            map.value = newValue
   //        log.trace "Total Amps: ${cmd.scaledMeterValue}"
            break;
        case 6: //Power Factor
        case 7: //Scale2 values (not currently implimented or needed)
            map.value = cmd.scaledMeterValue / divFactor
            break;
        default:
            break;
    }
createEvent(map)
}

def zwaveEvent(physicalgraph.zwave.commands.multichannelv3.MultiChannelCmdEncap cmd) {
	def divFactor=2
	//This is where the HEM clamp1 and clamp2 (subdevice) report values are defined. Scale(2,5) is in reference to the Aeon Labs HEM Gen5 (subdevice) data for W, and A respectively.
	//Z-Wave Command Class 0x60 (multichannelv3) is necessary to interpret the subdevice data from the HEM clamps.
	//In addition, "cmd.commandClass == 50" and "encapsulatedCommand([0x30: 1, 0x31: 1])" below is necessary to properly receive and inturpret the encasulated subdevice data sent to the SmartThings hub by the HEM.
	//The numbered "command class" references: 50, 0x30v1, and 0x31v1 do not seem to be true Z-Wave Command Classes and any correlation is seemingly coincidental.
	//It should also be noted that without the above, the data received will not be processed here under the 0x60 (multichannelv3) command class and you will see unhandled messages from the HEM along with references to command class 50 as well as Meter Types 33, and 161.
	//sourceEndPoint 1, and 2 are the Clamps 1, and 2.
	def dispValue
	def newValue
	def formattedValue
	def MAX_AMPS = 220
	def MAX_WATTS = 24000
	if (cmd.commandClass == 50) { //50 is likely a manufacturer specific code, Z-Wave specifies this as a "Basic Window Covering" so it's not a true Z-Wave Command Class.   
		def encapsulatedCommand = cmd.encapsulatedCommand([0x30: 1, 0x31: 1]) // The documentation on working with Z-Wave subdevices and the technical specs from Aeon Labs do not explain this adequately, but it's necessary.
	//log.debug ("Command from endpoint ${cmd.sourceEndPoint}: ${encapsulatedCommand}")
		if (encapsulatedCommand) {
			if (cmd.sourceEndPoint == 1) {
				if (encapsulatedCommand.scale == 2 ) {
						newValue = Math.round(encapsulatedCommand.scaledMeterValue / divFactor) 
	                    if (newValue > MAX_WATTS) { return }
						formattedValue = newValue
						dispValue = "${formattedValue}"
						sendEvent(name: "power1", value: dispValue as String, unit: "", descriptionText: "L1 Power: ${formattedValue} Watts")
				}
				if (encapsulatedCommand.scale == 5 ) {
						newValue = Math.round(encapsulatedCommand.scaledMeterValue * 100  / divFactor) / 100
	                    if (newValue > MAX_AMPS) { return }
						formattedValue = String.format("%5.2f", newValue)
						dispValue = "${formattedValue}"
						sendEvent(name: "current1", value: dispValue as String, unit: "", descriptionText: "L1 Current: ${formattedValue} Amps")
				}
			}
			else if (cmd.sourceEndPoint == 2) {
				if (encapsulatedCommand.scale == 2 ) {
						newValue = Math.round(encapsulatedCommand.scaledMeterValue / divFactor) 
	                    if (newValue > MAX_WATTS) { return }
						formattedValue = newValue 
						dispValue = "${formattedValue}"
						sendEvent(name: "power2", value: dispValue as String, unit: "", descriptionText: "L2 Power: ${formattedValue} Watts")
				}
				if (encapsulatedCommand.scale == 5 ) {
						newValue = Math.round(encapsulatedCommand.scaledMeterValue * 100 / divFactor) / 100 
	                    if (newValue > MAX_AMPS) { return }
						formattedValue = String.format("%5.2f", newValue)
						dispValue = "${formattedValue}"
						sendEvent(name: "current2", value: dispValue as String, unit: "", descriptionText: "L2 Current: ${formattedValue} Amps")
				}
			}
		}
	}
}

Thank you very much! I will give it a try and see if the numbers add up now :slight_smile:

KO

How do you update the firmware?

For the older version of the HEM it was done via a USB port, but I have no idea for the Gen 5. @cdikland, did you ever figure out how?

How do you update via USB?

It came with a short USB cable, and you plug it into your PC and run the update EXE you download from their site.

When I talked to Aeon Tech support last spring they said there was no FW updates (yet) for this device. When there is, updates are done OTA. No idea how this will work but he told me that because I also have an aeon z-wave usb stick, OTA firmware update will be done using this device. Wait and see I guess.

No such capability for the Hem Gen 5. See my post above re OTA FW update