more G-Labs products

Author Topic: Latest update broke Aeon Labs HEM?  (Read 2971 times)

June 28, 2015, 04:28:59 PM
Read 2971 times

vortmax

  • *
  • Information
  • Newbie
  • Posts: 8
A while back I managed to finally get my HEM to kind of sort of work with Home Genie.  After the last update, it suddenly isn't working at all.  Now I'd like to finally figure out what is wrong and try and get to up to 100%

First off...configuration.  I followed the steps I found online and added 85 to the nodeInfo field.  This enabled the configurations menu for the device.  Before I upgraded to the new version of HomeGenie, I was able to access and set all of these parameters.  I could select a number in the drop down box and text would appear detailing the configuration options.  Now, with the new version, the only number that appears is "1", and there is no description text.  I can change this variable (get/set), but can't access any of the others.

Secondly, in the configuration options, down toward the bottom, there is a "Meter" option that lets you select "Watts, "kWh", etc with a 'get' and 'reset' button.  (I've attached a picture).  Before the upgrade, this would affect the data being shown in the "Analyze" (now statistics) pane.  Now it doesn't seem to do much of anything.  What is the intended purpose of this option and how do I properly use it?

If I look at the power meter widget and the logs, I can see that the meter is sending out power readings (second attachment).  It even looks like power.1 and power.2 are reasonable numbers for the power on each of the two clamps.  However, "Power", which I'm assuming is the total power, isn't the sum of the two..and then there is the lightning bolt icon with a different number, and a 'man walking" icon with no number.   How am I supposed to read this, and how can I configure it to just show the individual and total power from the HEM?

Even though it looks like I'm getting power numbers in, it doesn't appear they are being used anywhere else.  The Energy Monitor widget (same picture) isn't plotting anything even though it shows a number next to the lightning bolt (which I'm assuming is some sort of total power, as it is equal to the lightning bolt number from the power meter plus the readings from my other lamp modules that report power as well).  With the old software, I would get an occasional bar here, but it seemed to only be related to when the lamp modules were powered on and off...so it's never shown output from the HEM.  Now it never shows anything.

Finally, I'm not getting anything showing up in the "statistics" plot.  Before the update, I was actually getting data and it was plotting well.  I could select the Power Meter as an option and it would give me the option for kWh, Watts.1, Watts.2, and Watts and Power.  I could plot Watts.1 and Watts.2 separately or both together with Watts (Power never showed anything, however).  kWh never appeared to work either.  Now, the only option I get is "Watts", and it doesn't actually plot anything.  So it appears either that data are not being logged to the DB, or the software isn't reading it for some reason.

What I'm looking for isn't necessarily a "do this, then that" answer.  If someone has a quick fix, that would be great, but I also really want to understand what is going on behind the scenes...what those settings are really doing, what the numbers and icons mean, etc and how to get this tuned and working properly.

June 29, 2015, 09:00:09 PM
Reply #1

RoChess

  • ***
  • Information
  • Full Member
  • Posts: 61
Did you update firmware on your HEM?

I had a lot of inconsistencies myself until I updated.

June 29, 2015, 09:48:33 PM
Reply #2

vortmax

  • *
  • Information
  • Newbie
  • Posts: 8
Yea, I had to update it to get it to work the first time around

July 07, 2015, 04:01:38 AM
Reply #3

hybridview

  • **
  • Information
  • Jr. Member
  • Posts: 37
Months ago, I did a ton of research on using HEM v1 with HG and got deep into the related code. I haven't updated my HG application in 3 months, so perhaps I will do that this week and see if I encounter the same HEM v1 issues. If someone doesn't beat me to it, I'll also try to answer some questions about how those values get into the stats page (if the code hasn't changed too much since I last worked with it).

July 26, 2015, 04:44:01 PM
Reply #4

hybridview

  • **
  • Information
  • Jr. Member
  • Posts: 37
The summer has been crazy busy with my 2 kids, so sorry for the late response. Here is some quick info that might help:

If you configure your HEM to report Power 1 and Power 2 on separate reports, then they are reported asynchronously. EX: Power 1 and total power are reported at time T; Power 2 is reported at time T+2 seconds; When Power 2 is reported, Power 1 and total may have already changed, so Power 1 + Power 2 may not always equal the total. The way to resolve this is to have ALL 3 values report on a single multilevel report from the HEM.

Regarding values not being shown in STATS, I might have the same issue so hopefully I can help. HG records the power values of HEM using a variable name that is not the same as the default that STATs first opens with. After opening stats, click the options button, click the GLOBAL dropdown, and see if you can find your HEM in there. If it is not in there, try again a few more times. In my case, it eventually shows up. If you choose it, you should then be able to choose the readings from clamp 1, 2, and TOTAL. The chart will then show this info. If this does not work for you, then your issue might be different.

I think I can work around this issue by creating a program that intercept the HEM variables, and re-sends them using the names used in analysis defaults. Ideally, we could just set an option to change this default. I'll take a look at the latest code when I have time and see if I can come up with some suggestions for the devs. For now, I hope this helps.

July 26, 2015, 07:30:57 PM
Reply #5

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
The standard parameter which HG is looking for energy stats is Meter.Watts.
If the parameter coming from your device is stored into a different field (eg. Sensor.Power, Sensor.Power.1, ...), you can map it as Meter.Watts with an automation program:

Code: [Select]
When.ModuleParameterChanged((module, parameter)=>{
     if (parameter.Name == "Sensor.Power") {  // <--- this is the parameter to map into default Meter.Watts field
           Program.RaiseEvent(module, "Meter.Watts", parameter.Value, "Mapped from Sensor.Power event");
     }
     return true;
}


g.


July 28, 2015, 02:23:09 AM
Reply #6

hybridview

  • **
  • Information
  • Jr. Member
  • Posts: 37
That is how I resolved the issue back in January. Thanks for the code sample and for jogging my memory Gene.

September 02, 2015, 12:45:12 AM
Reply #7

naps1saps

  • ***
  • Information
  • Full Member
  • Posts: 79
I can't get the script to compile.  This is C#, right?
*edit*
nevermind you have to add ); at the end of the last bracket.

Still not working when enabled it sits idle with the trigger set to return true.  I'm so clueless right now.  How do I get EnergyMonitor.KwLoad to get a value.  The monitor shows how much power but EnergyMonitor.KwLoad is always 0.  Why?

The HEM variable is Sensor.Power so we are looking at the right things but we need a simple explanation of how the system passes the variables around.  Also, the pictures above are exactly what I am seeing also.  So if vortmax found a way to fix it, please let us all know.

Here is the code for the monitor getting the values and my senor does have a value for Meter.Watts already without that code above.  So why don't it show it in the monitor? Grrr i can't figure it out.

Code: [Select]
// select all modules supporting metering
var meterModules = Modules.WithParameter("Meter.Watts");
var notifyTicks = 5; // minutes

var UpdateEnergyLoad = new Func<bool>(()=>{
  var totalLoad = 0d;
  int devcount = 0, lightcount = 0, switchcount = 0;
  meterModules.Each((mod)=>{
    if (mod.Parameter("Meter.Watts").DecimalValue > 0)
    {
      totalLoad += mod.Parameter("Meter.Watts").DecimalValue;
      if (mod.IsOfDeviceType("Light") || mod.IsOfDeviceType("Dimmer"))
      {
        lightcount++;
      }
      else
      {
        switchcount++; 
      }
      devcount++;
    }
    return false;
  });
« Last Edit: September 02, 2015, 01:44:48 AM by naps1saps »

September 02, 2015, 07:04:44 PM
Reply #8

naps1saps

  • ***
  • Information
  • Full Member
  • Posts: 79
Ok so I found the problem.  No value is being passed with this code
Code: [Select]
var energyUse = Program.EnergyUseCounter;

making this modification gets a value to show on the monitor now lol. I don't think its tracking data because it is not a counter just a local variable to the program :(  But at lease I know where the problem is... kinda.

Code: [Select]
//var energyUse = Program.EnergyUseCounter;
   
    //new code
    var energyUse = 0d;
    meterModules.Each((mod)=>{
    if (mod.Parameter("Meter.Watts").DecimalValue > 0)
    {
      energyUse += mod.Parameter("Meter.Watts").DecimalValue;
    }
    return false;
  });
    //end new code

Need to find where EnergyUseCounter is defined and look at that code.

*edit*
found where it is defined online
Code: [Select]
public double EnergyUseCounter
        {
            get
            {
                return homegenie.Statistics != null ? homegenie.Statistics.GetTotalCounter(Properties.METER_WATTS, 3600) : 0;
            }
        }

Does that code look right?  supposedly labeled as a fix from june.
https://github.com/genielabs/HomeGenie/blob/master/HomeGenie/Automation/Scripting/ProgramHelper.cs
« Last Edit: September 02, 2015, 07:31:46 PM by naps1saps »

October 16, 2015, 07:54:41 AM
Reply #9

naps1saps

  • ***
  • Information
  • Full Member
  • Posts: 79
Check my thread for how I got it to work just now as well as an updated json file.

http://www.homegenie.it/forum/index.php?PHPSESSID=luph5lr2turofsmpovgpqfav15&topic=954.15