eTrack - An Indigo Energy Tracking System (DISCONTINUED)

Posted on
Sat Apr 28, 2012 2:31 am
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

eTrack - An Indigo Energy Tracking System (DISCONTINUED)

eTrack 1.3.1 (DISCONTINUED)

Note that this software is no longer supported.

Overview:
This Indigo Pro 4, 5, or 6 Attachment AppleScript helps track energy usage by various devices. By simply calling the trackEnergy() or trackHVACEnergy() functions from within a trigger action, energy usage can be tracked for any thermostat, relay device, dimming device, or low-voltage controller. Calling either of these two handlers will automatically create all the variables needed for a device, if they don't already exist in Indigo, but a wattage (or therms-per-hour value for furnaces) must be assigned to a device before tracking will begin.

Features:
  • Track total energy usage and cost for each of the following device types…
    • Dimmers (SwitchLinc, KeypadLinc, LampLinc, In-Line Linc, etc)
    • Relays (SwitchLinc, KeypadLinc, ApplianceLinc, In-Line Linc, etc)
    • Power Synchronizers (SynchroLinc)
    • Energy Meters (iMeter Solo)
    • Low-Voltage Controllers (I/O-Linc)
  • HVAC Controllers (Venstar Thermostats and Thermostat Adapters)
  • Track total energy usage and cost for all devices combined.
  • Enable or disable energy tracking for a device (by setting it's wattage or therms-per-hour rating to zero).
  • Enable or disable all energy tracking by changing the value of one Indigo variable between "true" and "false".
  • Easily reset all energy and cost values for a new energy billing cycle using one Action Group.
  • Easily reset all energy, cost, wattage and therms values using another Action Group.

Limitations:
  • With the exception of energy meters like the iMeter Solo, energy usage is entirely based on mathematical calculations of energy consumption based on your input, not on actual measured usage, so the reported usage and cost may differ from what you actually use or pay.
  • eTrack does not support tiered energy cost schemes (used by many utility companies). It also does not support time-of-day-based energy cost calculations. Thus, when entering a cost per kWh or cost per Therm during setup, use an average cost per kWh/Therm. However, you can manually create an Indigo Schedule (Date/Time Action) to change the eTrackCostPerKWH and eTrackCostPerTherm variables at specific times of the day if your energy company uses a time-of-day calculation method.
  • eTrack can only track electrical energy usage and gas furnace energy usage, not other utility usages.
  • eTrack can't accurately calculate energy usage and costs for heat pump-type heating and cooling systems.
  • When tracking energy usage for an I/O-Linc Controller device, eTrack only creates triggers based on whether that device's output changes, not on whether it's input changes. The I/O-Linc also cannot be in "momentary mode," otherwise energy will not be calculated correctly. You can modify the triggers created by eTrack to track energy based on input changes if needed.
  • eTrack only works on Indigo systems that run 24-hours a day. It will not work with standalone controllers like an ISY-99i or 2414U.

Details:
Though this attachment does not require it, using the included eTrack Setup applet to setup all the variables and triggers within Indigo is highly recommended. That setup program will walk you through defining wattage levels for every compatible device, creating the needed Indigo variables and triggers for you afterwards. It also creates an Action Group which will reset all cost, kWh, and Therms tracking variables, and another Action Group to reset all data, including wattages and therms (respectively).

Each tracked device has a number of Indigo variables associated with it which are used by the eTrack functions to keep track of energy usage and cost.

  1. eTrackKWH_<deviceName> (eTrackTherms_<deviceName>Furnace): 
Number of kilowatt-hours (or Therms for furnaces) used during the most recent "event". For example, the kitchen light was turned on at 6:00 PM then turned off at 8:00 PM (which we're calling an "event"). When it was turned off at 8:00 PM, eTrack calculated how many kilowatt-hours were used by the light for that 2-hour period and stored that amount in this variable (as well as added it to the total kWhs used for the device and for all devices).
  2. eTrackCost_<deviceName>:
 Cost of using the device (in dollars) from the last "event."
  3. eTrackTotalKWH_<deviceName> (eTrackTotalTherms_<deviceName>Furnace):
 Total kilowatt-hours (or Therms) used by the device including the most recent "event."
  4. eTrackTotalTime_<deviceName>: Total time the device has been turned on (since eTrack has been reset).
  5. eTrackTotalCycles_<deviceName>: Total number of times device has been turned on (since eTrack has been reset).
  6. eTrackTotalCost_<deviceName>:
 Total cost of using the device so far, including the most recent "event."
  7. eTrackWatts_<deviceName> (eTrackThermsPerHour_<deviceName>Furnace):
 Your estimate of how many watts of power (or Therms per hour) are required to power the device (at 100% power). These are not created for iMeter Solo devices.
  8. eTrackData_<deviceName>:
 Data used by eTrack functions to calculate the number of kilowatt-hours (or Therms) used from the last device state change to the next time the device changes states. The first value is the date and time the device last changed states. The second value is the current on-level (percent brightness) of the device. This is not created for iMeter Solo devices.

There are also some globally used variables created by eTrack functions (if they don't already exist).

  1. eTrackEnabled:
 This is set to "true" by default and allows eTrack functions to proceed. Set this to "false" to prevent eTrack from tracking energy costs for all devices.
  2. eTrackCostPerKWH: This is the cost per kilowatt-hour you've told eTrack to use when calculating energy costs. eTrack does not support tiered energy calculations (where costs go up after you use more than a "baseline" total amount) or time-of-day energy calculations. However, for time-of-day calculations, you could manually create an Indigo Schedule (Date/Time Action) to change the value of this variable at specific times of the day and eTrack will calculate all future energy use based on the new cost per kWh.
  3. eTrackCostPerTherm: This is the cost per Therm you've told eTrack to use when calculating gas energy costs. eTrack does not support tiered energy calculations (where costs go up after you use more than a "baseline" total amount) or time-of-day energy calculations. However, for time-of-day calculations, you could manually create an Indigo Schedule (Date/Time Action) to change the value of this variable at specific times of the day and eTrack will calculate all future energy use based on the new cost per Therm.
  4. eTrackGrandTotalKWH:
 The sum of all device total kilowatt-hours, including the most recent "events" from all tracked devices.
  5. eTrackGrandTotalTherms:
 The sum of all device total Therms, including the most recent "events" from all tracked furnace devices.
  6. eTrackGrandTotalCost: 
The sum of all device total costs, including the most recent "events" from all tracked devices.

The eTrack Setup applet also creates device state change triggers for each of the tracked devices. Each trigger created by the eTrack Setup applet is named "eTrack - <device name>". Event logging is suppressed for all eTrack triggers so their execution doesn't clog up your Indigo logs. Triggers for HVAC energy tracking are named "eTrack - <thermostat name> [AC|Heat|Fan|Furnace]" (i.e. ending in either "AC", "Heat", "Fan", or "Furnace"). These triggers track the on and off state of each of the HVAC's 3 equipment components as well as the gas energy usage for the heater's furnace.

Finally, the eTrack Setup applet creates two Action Groups. The first, "eTrack - Reset", when executed, resets all eTrack cost and kWh variables, but leaves the wattage and data variables as they are. This allows you to easily reset energy and cost values for a new energy billing cycle. The second Action Group, "eTrack - Reset All", resets all eTrack variables, including wattages/therms and data variables. This could be useful if you'd like to stop tracking all devices and make changes to individual device wattage/therm-per-hour settings, or to erase any system-wide miscalculations.

Installation:
Download the .zip file, uncompress it (if it isn't done automatically) then run the included eTrack Setup program to install eTrack into the Indigo attachment folder. You can also put it there manually, then manually reload attachments within the Indigo Client.

Uninstallation:
Use the included Uninstall eTrack program to permanently delete this attachment and all associated Indigo variables, triggers, and action groups.

Requirements:
Indigo Pro 4, 5, or 6 and at least 1 trackable device. iMeter Solo support requires Indigo 5 or later.

EDIT: Now at version 1.3.1. Fixed bug that caused the eTrack installer to return a "Maximum of 3 buttons" error if more than 2 supported versions of Indigo were installed. The installer now only gives the option of installing eTrack for the two most recent supported versions of Indigo if more than 2 are installed.
Last edited by nsheldon on Thu May 24, 2012 4:13 am, edited 6 times in total.

Posted on
Sat Apr 28, 2012 10:03 am
matt (support) offline
Site Admin
User avatar
Posts: 18747
Joined: Jan 27, 2003
Location: Texas

Re: eTrack - A New Indigo Energy Tracking System

Wow. This is really cool, and really useful.

The setup app is very useful -- it does everything. It copies the script to the folder for the user, and then uses a wizard like approach to prompt for all of the information (cost per kWh, wattage for individual devices), and even has helpful tips on estimating HVAC wattage usage.

I do have one big suggestion, and I'll bet you can guess what it is. :-) This would make a *great* Indigo 5 plugin. From a coding perspective, I believe using a plugin approach would actually make it simpler. And from a user / usability perspective there are some big advantages as well. Some examples:

1) Plugins can add arbitrary meta properties and states to Devices. So instead of having all of the eTrack* variables, you could just add those as properties and states on the Devices themselves. Users can then inspect those states on Control Pages, and use them in Triggers or Conditionals. You would still probably have the house global eTrack* variables, of course, since those aren't device specific.

2) Plugins can create Folders and move objects in to folders. So the global eTrack* variables could automatically be moved into an eTrack folder for better organization.

3) Plugins can subscribe to a callback for when there are any device changes via indigo.devices.subscribeToChanges(). So you wouldn't need to create the Triggers at all. The plugin would automatically get called whenever there is any device change so that it can update its tracking states.

4) The Reset and Reset All actions could become real plugin Actions, so no glue Action Groups would be needed for those. You could also create a plugin GUI Action for changing the cost kWh, so users could do that via a schedule -- with no scripting at all.

I'm sure there are other possibilities and advantages to using a plugin as well; the list above is just some quick thoughts.

Thanks for sharing this with everyone.

Image

Posted on
Sat Apr 28, 2012 12:25 pm
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - A New Indigo Energy Tracking System

Hey Matt.

Thanks! I'd hoped it'd be useful to people. Hahaha. It'd make a great plug-in? ;-) Yep. I saw that coming. You make some very good points about the advantages of plug-ins. I actually didn't know about the ability to add meta-data to devices through a plug-in. That would certainly be better than all the variables IMO. I knew about the folder assignment advantages. That would definitely help with organization. I'm slowly picking up on the Python thing. Learning how to use the various Indigo API methods along with the very different Python syntax takes a bit of time and a lot of googling.

Posted on
Sat Apr 28, 2012 12:43 pm
matt (support) offline
Site Admin
User avatar
Posts: 18747
Joined: Jan 27, 2003
Location: Texas

Re: eTrack - A New Indigo Energy Tracking System

You've probably already found the main plugin docs:

http://www.perceptiveautomation.com/wik ... ugin_guide
http://www.perceptiveautomation.com/wik ... _reference

But also be sure and check out this tutorial:

http://www.perceptiveautomation.com/wik ... g_tutorial

It is very incomplete (tons of "Fix Me!" as you will notice), but it does have some good code snippets including adding meta data on to a device.

Come to think of it, I misspoke above regarding device states. Although a plugin can add arbitrary meta-data on to Devices (and variables/triggers/schedules) via dev.pluginProps and dev.replacePluginPropsOnServer(), it cannot add states on to existing devices it doesn't own. That is, a plugin can create a new subclassed device type (which inherits relay/dimmer/thermostat behavior) and can add states on to those devices, but there isn't currently a way for a plugin to add states on to an existing native device.

So your energy meta data can be added as properties on the devices themselves, but the disadvantage of that is properties, unlike states, cannot be inspected on Control Pages or used in Device State Change triggers or conditionals. Only devices states (or variable values) are available there.

There are a couple of approaches you can take though. One, you could keep them in Indigo Variables as the AppleScript does. Or another option is to have your plugin define its own "energy tracker" device type. That device would contain all the of the energy information as states (and thus viewable on Control Pages, etc.) AND it would contain a property that points to the real device. So there would be one energy tracker device per physical device. These energy tracker devices could have actions to reset their cumulative kWh and also to set their maximum load wattage.

Image

Posted on
Sat Apr 28, 2012 1:07 pm
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - A New Indigo Energy Tracking System

Thanks for the links!

Yea, I did look over the plug-in guide. I had only briefly looked at the IOM reference. I love definitions, but, as a non-pro casual coder, I live off examples (which is probably why my first step is to google for example code). ;-) The tutorial link is quite helpful for me in that respect. You guys really did put a lot of work into the Indigo Object Model and use of Python. It really does allow Indigo to be extended on a grand scale and puts Indigo well into the realm of enterprise-grade products, IMO.

I like the idea of a separate "energy tracker" device for each INSTEON/X10 device. It may not be quite as cool as extending the status of a native device, but it'd cut down on the number of variables lying around. :-)

I'll have to look into the plug-in thing some more I think. Perhaps version 2.0 will be a plug-in. :-D

Posted on
Sun Apr 29, 2012 1:41 pm
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - A New Indigo Energy Tracking System

MAJOR FIX:

If you have version 1.0b1 or the short-lived 1.0b2 installed, you'll definitely want to get 1.0b3 (link in original post is updated to the latest version) as there was a major typo and calculating error in HVAC energy usage which has been corrected.

Posted on
Sun May 06, 2012 2:04 am
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - A New Indigo Energy Tracking System

FEATURE UPDATE:

Now eTrack can track your HVAC's furnace gas energy usage. Test it out everyone and let me know what you think and if there are any bugs that need fixing.

Posted on
Wed May 16, 2012 12:09 am
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - A New Indigo Energy Tracking System

New version 1.1b3 released. See first post in this thread for download link and bug fix details.

Posted on
Thu May 24, 2012 4:13 am
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - A New Indigo Energy Tracking System

New version 1.1b4

Adds support for the iMeter Solo. See original post for download link and more details.

Posted on
Tue Jul 03, 2012 1:42 am
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - A New Indigo Energy Tracking System

New version 1.2

Added variables to track total time a device has been turned on and total number of times the device has been turned on. Also, eTrack is now a final release.

Posted on
Tue Mar 26, 2013 2:17 pm
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - An Indigo Energy Tracking System

New version 1.3

Added support for Indigo 6.

Posted on
Mon May 27, 2013 4:28 pm
nsheldon offline
Posts: 1970
Joined: Aug 09, 2010
Location: CA

Re: eTrack - An Indigo Energy Tracking System

New version 1.3.1

Fixed "Maximum of 3 buttons..." bug in eTrack installer.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest