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.