[OBSOLETE] Aeotec Home Energy Meter Gen 5 composite DTH

So I’ve added a few features to this to meet my needs and if I get a bit more time I’ll make them more configurable.

Mainly I’ve added energy costs and the abilty to reset in software without resetting the actual reading on the device.

I couldn’t have done this without the aweseome code that @ClassicGOD wrote, I was going to fork the project but the repo is already a fork of the whole ST repo so it wasnt’ possible.

I’ve setup a new repo here → GitHub - Tmp2k/AeotecHEMgen5: SmartThings Device Handler for Aeotec Home Energy Meter Gen 5 feel free to put any of my code back into the original DH.

Added:

  • Energy costs displayed based on “Cost per unit” in prefernces
  • Resetting the meter doesnt change the energy reading on the device, it jsut adds an offset in software to zero the reading. This means you can reset as often as you like but you’ll never loose the total energy usage.
  • There is another offset value in preferences so that you can match the meter readings up to your existing meter value to keep things consistent.

Changed:

  • Fixed the refesh routeen, made parent refresh refresh all children and set it to perform a refresh every 5 mins
  • Changed some of the units and rounding so the display is simpler
  • Changed default display in devices list to cost instead of kW

Todo:

  • Add a reset date so that standing charges can be added to cost based on the last reset date
  • Add configurable currency and other options for calculating costs
  • Allow choice of unit to display on device list via preferences e.g. cost / kWh / kW etc.
4 Likes

Great update. Do you know what one needs to do to make it work well with the new version of the SmartThings app ? It works fine on the classic.

valueTile("totalCost", "device.totalCost", decoration: "flat", width: 2, height: 2) {
		state "totalCost", label:'${currentValue}', unit: "€"
	}

Managed to find the value places where the Units are shown. It would be a great idea to actually define the currency as a parameter.

I am also using ActionTiles and see that the units shown on ActionTiles are W while the DTH is providing the values in kW. Changed the following:

case 2: type = “power”; unit = “W”; value = Math.round(cmd.scaledMeterValue); break;

Where can I actually see the result of adding cost per unit? I don’t see it on the device page in classic :confused:

You should be able to see the cost on the device list page as the default attribute. Then when you view the device there should be 6 small tiles below the main tile.

[ Main tile ]
[kWh] [Volt] [Amp]
[Cost] [Meter reading] [Reset]

If that’s not what you’ve got see if you can post a screen shot.

Cost is just missing for me. I don’t think my meter is pairing correctly, as I have to manually refresh the tile to shaw any updates, although as far as I can tell it is paired securely, as it has Ls in the raw description in the IDE;

zw:Ls type:3101 mfr:0000 prod:0000 model:0000 ver:1.04 zwv:4.54 lib:03 cc:5E,86,72,32,56,60,8E,70,59,85,7A,73,98,5A sec:32,60,8E,70,59,85,7A,73 role:05 ff:9000 ui:9000 epc:3

Should it be zeros for mfr, prod & model?


Also, what does the reports group thing do? I can’t fathom that either…

Had to reinstall the device and now I cannot see the updated values for the children. I can see them being captured per clamp in the log but they are not shown in SmartThings Groovy IDE or the apps. Any ideas?

Re-did the installation of the device and confirmed its is in secure mode. Logging shows the children values but not in the UI ?! :pleading_face:

I had installed the HEM Gen5 and the ClassicGod device handler per the Aeotec setup instructions. Things seem to be functioning ok except the HEM wouldn’t auto report and I needed to manually click the refresh button for a new reading. I was given the following steps by Aeotec support that helped remedy the issue. I thought I’d pass a these along to maybe help someone with the similar issue.

From Aeotec Support:
It is likely that the association did not set properly during the pairing process (typically i see this happen if you don’t get auto reports and clicking refresh updates all sensor status).

You can fix this using Z-Wave Tweaker:

The steps to install Z-Wave Tweaker (You only need to do this once, if already installed, skip this section):

  1. Login to your SmartThings IDE
  2. Click on Locations and then select your gateway
  3. Select “My Device Handlers” then click on “Add new Device Handler”
  4. Select “From Code”
  5. Go into the Z-Wave Tweaker Code, and copy all of the code from line 0 to the very last line. (can be found here directly: https://github.com/codersaur/SmartThings/blob/master/devices/zwave-tweaker/zwave-tweaker.groovy)
  6. PRO TIP - Click on the “Raw” button which exposes only code, then ctrl + a (highlight all), then ctrl + c (copy highlighted).
  7. Paste this into your SmartThings IDE.
  8. Save the code.
  9. Then click on Publish -> “Publish for me”

Now install Z-Wave Tweaker over HEM Gen5 :

  1. Click on “My Devices”
  2. Look for your ​ HEM Gen5 and click on it
  3. Scroll to the bottom then click “Edit”
  4. Find “Type” and bring out the drop down menu
  5. First make note of the original device handler that you were using (you will need to revert back to the original device handler later)
  6. Find “Z-Wave Tweaker” and select it
  7. click on “Update”

Using Z-Wave Tweaker to Set a GROUP ASSOCATION

  1. Go into your “SmartThings Classic” App over your Smartphone
  2. Find the ​ HEM Gen5 and open up its page, you’ll notice that everything is incredibly different. Please make note of the GREEN “Sync” symbol at the bottom.
  3. On the top right, click on the GEAR icon
  4. Scroll down and look for the “CONFIGURE ASSOCIATION GROUP” section, there are multiple parts in this section (Association Group ID, Association Group Members, Command Class)
  5. On " Association Group ID " set this to = 1
  6. On " Association Group Members " set this to ​= 01 (this is the NodeID identification of your SmartThings hub)

image

  1. On “Command Class” set this to “Auto-detect”
  2. Now click on “Save” located on the top right.
  3. From step 2 you made note of the GREEN “Sync” symbol, if the color is ORANGE “Unsynced” then you will need to wait for this to change to GREEN “Sync” before moving onto the next section.
  4. If your Z-wave device is a battery device, Wake up the battery device now to take in the new changes.
  5. If you see GREEN “Sync” at the bottom of the device page, you are now done with this section.

Now install the original device handler over ​ HEM Gen5 :

  1. Click on “My Devices”
  2. Look for your ​ HEM Gen5 and click on it
  3. Scroll to the bottom then click “Edit”
  4. Find “Type” and bring out the drop down menu
  5. Find the original device handler and select it
  6. click on “Update”
1 Like

Thanks . They passed it to me already and it works great.

Hello!

I’m trying to use your DTH, but I get the following error

[class java.lang.Number] @line 374 (zwaveEvent)
9fb18e1a-a188-4a96-a131-77d788ffdd5e 18:50:59: error groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Long#plus.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class java.lang.Character]
[class java.lang.String]
[class java.lang.Number] @line 374 (zwaveEvent)

I have an Aeotec HEM gen5 with one clamp and is connected in secured mode

Raw Description zw:Ls type:3101 mfr:0086 prod:0002 model:005F ver:1.35 zwv:4.54 lib:03 cc:5E,86,72,98,56 ccOut:5A sec:86,72,32,56,60,8E,70,59,85,7A,73,5A role:05 ff:9000 ui:9000 epc:1

I appreciate any suggestions.
Regards

I just installed this power meter and is working fine but I don’t get the child devices installed. I have installed all three files from Github.

Ok, removed the Hem from ST, installed the DTH (all three files), included back the meter and now it shows 2 child devices, bue I can’t get any info out of the child devices. Any suggestions?

Thank you for this! I bought a new device thinking my existing one (for the last year and half) was defective but the new one did the same thing (IF I could get it working it would stop working after a power failure). Doing this procedure fixed it and its been running great for a month.

This is one of my favorite devices in my setup!

Read and follow remys post (3 posts up)

Try this

This issue sounds like since it is updating, it is missing its Group Association to the controller via Group #1 as it does update if you press refresh.

This is a little bit complex, but i tried to write a step by step process to try and streamline the process for manual group association programming using Z-Wave Tweaker:

The steps to install Z-Wave Tweaker (You only need to do this once, if already installed, skip this section):

  1. Login to your SmartThings IDE
  2. Click on Locations and then select your gateway
  3. Select “My Device Handlers” then click on “Add new Device Handler”
  4. Select “From Code”
  5. Go into the Z-Wave Tweaker Code, and copy all of the code from line 0 to the very last line. (can be found here directly: https://github.com/codersaur/SmartThings/blob/master/devices/zwave-tweaker/zwave-tweaker.groovy)
  6. PRO TIP - Click on the “Raw” button which exposes only code, then ctrl + a (highlight all), then ctrl + c (copy highlighted).
  7. Paste this into your SmartThings IDE.
  8. Save the code.
  9. Then click on Publish → “Publish for me”

Now install Z-Wave Tweaker over HEM Gen5:

  1. Click on “My Devices”
  2. Look for your HEM Gen5 and click on it
  3. Scroll to the bottom then click “Edit”
  4. Find “Type” and bring out the drop down menu
  5. First make note of the original device handler that you were using (you will need to revert back to the original device handler later)
  6. Find “Z-Wave Tweaker” and select it
  7. click on “Update”

Using Z-Wave Tweaker to Set a GROUP ASSOCATION

  1. Go into your “SmartThings Classic” App over your Smartphone
  2. Find the HEM Gen5 and open up its page, you’ll notice that everything is incredibly different. Please make note of the GREEN “Sync” symbol at the bottom.
  3. On the top right, click on the GEAR icon
  4. Scroll down and look for the “CONFIGURE ASSOCIATION GROUP” section, there are multiple parts in this section (Association Group ID, Association Group Members, Command Class)
  5. On “Association Group ID” set this to 1
  6. On “Association Group Members” set this to 01 (which is the Network ID of your SmartThings Controller)
  7. On “Command Class” set this to “Auto-detect”
  8. Now click on “Save” located on the top right.
  9. From step 2 you made note of the GREEN “Sync” symbol, if the color is ORANGE “Unsynced” then you will need to wait for this to change to GREEN “Sync” before moving onto the next section.
  10. If your Z-wave device is a battery device, Wake up the battery device now to take in the new changes.
  11. If you see GREEN “Sync” at the bottom of the device page, you are now done with this section.

Now install the original device handler over HEM Gen5:

  1. Click on “My Devices”
  2. Look for your HEM Gen5 and click on it
  3. Scroll to the bottom then click “Edit”
  4. Find “Type” and bring out the drop down menu
  5. Find the original device handler and select it
  6. click on “Update”

Try this

​This issue sounds like since it is updating, it is missing its Group Association to the controller via Group #1 as it does update if you press refresh.

​This is a little bit complex, but i tried to write a step by step process to try and streamline the process for manual group association programming using Z-Wave Tweaker:

The steps to install Z-Wave Tweaker (You only need to do this once, if already installed, skip this section):

  1. Login to your SmartThings IDE
  2. Click on Locations and then select your gateway
  3. Select “My Device Handlers” then click on “Add new Device Handler”
  4. Select “From Code”
  5. Go into the Z-Wave Tweaker Code, and copy all of the code from line 0 to the very last line. (can be found here directly: https://github.com/codersaur/SmartThings/blob/master/devices/zwave-tweaker/zwave-tweaker.groovy)
  6. PRO TIP - Click on the “Raw” button which exposes only code, then ctrl + a (highlight all), then ctrl + c (copy highlighted).
  7. Paste this into your SmartThings IDE.
  8. Save the code.
  9. Then click on Publish → “Publish for me”

Now install Z-Wave Tweaker over HEM Gen5:

  1. Click on “My Devices”
  2. Look for your HEM Gen5 and click on it
  3. Scroll to the bottom then click “Edit”
  4. Find “Type” and bring out the drop down menu
  5. First make note of the original device handler that you were using (you will need to revert back to the original device handler later)
  6. Find “Z-Wave Tweaker” and select it
  7. click on “Update”

Using Z-Wave Tweaker to Set a GROUP ASSOCATION

  1. Go into your “SmartThings Classic” App over your Smartphone

  2. Find the HEM Gen5 and open up its page, you’ll notice that everything is incredibly different. Please make note of the GREEN “Sync” symbol at the bottom.

  3. On the top right, click on the GEAR icon

  4. Scroll down and look for the “CONFIGURE ASSOCIATION GROUP” section, there are multiple parts in this section (Association Group ID, Association Group Members, Command Class)

  5. On “Association Group ID” set this to 1

  6. On “Association Group Members” set this to ​01 (which is the Network ID of your SmartThings Controller)

  7. On “Command Class” set this to “Auto-detect”

  8. Now click on “Save” located on the top right.

  9. From step 2 you made note of the GREEN “Sync” symbol, if the color is ORANGE “Unsynced” then you will need to wait for this to change to GREEN “Sync” before moving onto the next section.

  10. If your Z-wave device is a battery device, Wake up the battery device now to take in the new changes.

  11. If you see GREEN “Sync” at the bottom of the device page, you are now done with this section.

Now install the original device handler over HEM Gen5:

  1. Click on “My Devices”
  2. Look for your HEM Gen5 and click on it
  3. Scroll to the bottom then click “Edit”
  4. Find “Type” and bring out the drop down menu
  5. Find the original device handler and select it
  6. click on “Update”


Cheers,

Chris Cheng

Field Application Engineer

Aeotec Inc.

www.Aeotec.com

Why is this DTH not working with the samsung connect app?

Can you guys help me with 2 things?

-I want to use with actiontiles, so can you help me how to show the cost in actiontiles?
-How to change from KW to W ? I want to see the current consumption in Watts

Thank you
Brian

Hi Guy’s,

Having some issues getting the Aeotec Home Energy Meter Gen5 - 3 clamp up and running.

When adding to SmartThings the device is first discovered as “Z-Wave Device Multichannel”

I can edit the device to change it to the DH “Aeotec HEM Gen5”.

Device status stays at “SYNC IN PROGRESS”

Live logging gives the following from adding the device to association with DH. Device was added using “press twice” on the action switch for secure z-wave.

RAW description
zw:Ls type:3101 mfr:0000 prod:0000 model:0000 ver:1.04 zwv:4.54 lib:03 cc:5E,86,72,32,56,60,8E,70,59,85,7A,73,98,5A sec:32,60,8E,70,59,85,7A,73 role:05 ff:9000 ui:9000 epc:3

e00fed25-dfa6-450c-9ac3-24ad82ce3462 12:49:21: error java.lang.NullPointerException: Cannot get property ‘state’ on null object @line 263 (doCall)

e00fed25-dfa6-450c-9ac3-24ad82ce3462 12:47:13: debug 'zw device: 33, command: 600A, payload: 03 31 01 32 59 5E 85 8E 98 ’ parsed to [[name:epInfo, value:[“310132595E858E98”,“310132595E858E98”,“310132595E858E98”], displayed:false, descriptionText:, linkText:Z-Wave Device Multichannel, isStateChange:true]]

e00fed25-dfa6-450c-9ac3-24ad82ce3462 12:47:13: debug endpointInfo: [‘310132595E858E98’, ‘310132595E858E98’, ‘310132595E858E98’]

e00fed25-dfa6-450c-9ac3-24ad82ce3462 12:47:13: debug 'zw device: 33, command: 600A, payload: 02 31 01 32 59 5E 85 8E 98 ’ parsed to [[name:epInfo, value:[“310132595E858E98”,“310132595E858E98”,null], displayed:false, descriptionText:, linkText:Z-Wave Device Multichannel, isStateChange:true], 600903]

e00fed25-dfa6-450c-9ac3-24ad82ce3462 12:47:12: debug 'zw device: 33, command: 600A, payload: 01 31 01 32 59 5E 85 8E 98 ’ parsed to [[name:epInfo, value:[“310132595E858E98”,null,null], displayed:false, descriptionText:, linkText:Z-Wave Device Multichannel, isStateChange:true], 600902]

e00fed25-dfa6-450c-9ac3-24ad82ce3462 12:47:12: debug 'zw device: 33, command: 6008, payload: 40 03 00 ’ parsed to [[name:epInfo, value:[null,null,null], displayed:false, descriptionText:, linkText:Z-Wave Device Multichannel, isStateChange:true], 600901]

e00fed25-dfa6-450c-9ac3-24ad82ce3462 12:47:11: warn couldn’t extract ep from rawDescription

Anyone any suggestions?