This page lists the groovy code and installation instructions to install a custom device handler over your SmartThings hub and form part of the larger Home Energy Meter Gen5 user guide.


For users using SmartThings Hub, HEM Gen5 may require custom device type support until SmartThings adds native compatibility with the sensor.


SmartThings Hub Instructions for creating your own Device Handler.

http://docs.smartthings.com/en/latest/device-type-developers-guide/quick-start.html


HEM Gen5 Github code by ClassicGod.

https://github.com/ClassicGOD/SmartThingsPublic/blob/master/devicetypes/classicgod/aeotec-hem-gen5.src/aeotec-hem-gen5.groovy (Main device handler)


https://github.com/ClassicGOD/SmartThingsPublic/blob/master/devicetypes/classicgod/aeotec-hem-gen5.src/aeotec-hem-gen5-child-device.groovy (Device handler for child devices)

 


Installing the Device Handler.


In the below steps, you will need to install 2 separate devices handlers individually. Steps 4 - 13 will advise the device handlers to install specifically, while step 17 is where you would need to install the parent device handler named "Aeotec HEM Gen5".


Follow the steps below:


  1. Login to Web IDE (https://graph.api.smartthings.com/)
  2. Click on "Locations" and select the gateway location
  3. You may need to sign in, if not, continue to the next step. 
  4. Click on "My Device Handlers" tab.
  5. Create a new Device Handler by  clicking on "New Device Handlers" button in the upper-right  corner.
  6. Click on "From Code."
  7. Copy ClassicGod code from Github, and paste it into the code section. (From this link for the main device handler: https://github.com/ClassicGOD/SmartThingsPublic/blob/master/devicetypes/classicgod/aeotec-hem-gen5.src/aeotec-hem-gen5.groovy).
  8. Click Save, wait until the spinning circle finishes which indicates a successful save.
  9. Click on Publish -> Publish for me.
  10. Click on "My Device Handlers" tab.
  11. Create a new Device Handler by  clicking on "New Device Handlers" button in the upper-right  corner.
  12. Click on "From Code."
  13. Copy ClassicGod code from Github, and paste it into the code section. (From this link for the main device handler: https://github.com/ClassicGOD/SmartThingsPublic/blob/master/devicetypes/classicgod/aeotec-hem-gen5.src/aeotec-hem-gen5-child-device.groovy).
  14. Click Save, wait until the spinning circle finishes which indicates a successful save.
  15. Click on Publish -> Publish for me.
  16. Install it on your HEM Gen5 by going to "My Devices" page in the IDE
  17. Find your HEM Gen5.
  18. Go to the bottom of the page for the current HEM Gen5 and click on "Edit."
  19. Find the "Type" field and select your device handler. (If using ClassicGod device handler, install only the HEM Gen5 main device handler named "Aeotec HEM Gen5" which can be found near the bottom of the list or at the bottom of the drop down list)
  20. Click on "Update"
  21. Save Changes



Configuring HEM Gen5

Make sure that you configure the internal settings through the HEM Gen5 preference page otherwise the HEM Gen5 will not report. There are a few notable settings, 3 separate groups for setting what sensors you want reported, and another 3 settings that determine how fast each group reports.

  1. Open up SmartThings App
  2. Go to the Home page where all the devices are listed
  3. Open up the main Home Energy Meter Gen5 node
  4. At the top right corner, there should be a gear icon. Click on this icon to open the preference page
  5. Scroll down and activate the settings you want for your HEM Gen5.
  6. Click Save when you are finished.