Author Topic: Energy Monitor configuration?  (Read 259 times)

hamster

  • Newbie
  • *
  • Posts: 7
    • View Profile
Energy Monitor configuration?
« on: March 16, 2014, 10:15:42 am »
I have a Aeon 2 clamp zwave energy monitor.  It's working well, I can graph data in the data logger section of the web interface no problem, but I can't seem to get the energy monitor to show anything other than a missing image.

I'm seeing some errors in the apache log:

[Sun Mar 16 03:05:08 2014] [error] [client 192.168.2.162] PHP Notice:  Undefined variable: Dataset in /var/www/lmce-admin/operations/datalog/energyGraph.php on line 128, referer:
[Sun Mar 16 03:05:08 2014] [error] [client 192.168.2.162] PHP Fatal error:  Call to a member function count() on a non-object in /usr/share/php/Image/Graph/Plotarea.php on line 341, referer:

Digging around looking at the energyGraph code, I see it is doing a select from the database, and it seems the select is coming back with an empty set.

I'm seeing this in my DECRouter.log:

07      03/16/14 3:08:41.676            Received Message from 32 (Multilevel Sensor / Family Room) to -1001 (unknown / ), type 2 id 85 Event:Power Usage Changed, retry none, parameters: <0xb41fdb40>
07      03/16/14 3:08:41.676              Parameter 69(Watts):  <0xb41fdb40>
07      03/16/14 3:08:41.676              Parameter 71(WattsMTD): 39.184 <0xb41fdb40>
07      03/16/14 3:08:41.690            Event #85 has no handlers <0xb41fdb40>

I'm obviously missing some step somewhere, any clues?

Thanks!

sambuca

  • Guru
  • ****
  • Posts: 448
    • View Profile
Re: Energy Monitor configuration?
« Reply #1 on: March 16, 2014, 11:56:37 am »
If I remember correctly, the energy monitor uses state changes on devices coupled with the user-defined energy usage of said devices to calculate the energy usage. It is not equipped to show anything useful for devices that report exact energy usage.
So for your case, the energy device does not report any state changes, thus no data and you get an error.

If you feel up to it, we would appreciate someone digging into the code (its all in php) and try to get it to support both ways. (For instance, if no state changes are found, look for reported energy usage instead)

br,
sambuca

hamster

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Energy Monitor configuration?
« Reply #2 on: March 18, 2014, 07:21:35 am »
OK, I'll have to dig into it.  I don't understand a lot of linuxmce right now, haha.

I note that the mysql select looks for a specific FK_DeviceData and a FK_Unit.  Where would I find the documentation on what that stuff references?

$deviceQuery = mysql_query('SELECT EK_Device, Description, IK_DeviceData FROM Datapoints, pluto_main.Device, pluto_main.Device_DeviceData WHERE FK_Unit='.$unit.' AND EK_Device=PK_Device AND EK_Device=FK_Device AND FK_DeviceData=289
GROUP BY EK_Device ORDER BY FK_Room');

Thanks!

sambuca

  • Guru
  • ****
  • Posts: 448
    • View Profile
Re: Energy Monitor configuration?
« Reply #3 on: March 18, 2014, 07:35:38 am »
I'm not sure there are much documentation unfortunately. If there are any, it should be in the wiki.

But look in the lmce_datalog database, there are only a handful of tables there, so it should be fairly easy to see the connections.
The query you posted also references the main pluto_main database, more specifically, the Device and Device_DeviceData tables. It does this to look for devices with the "Energy Consumption" device data. (This coupled with the on/off state, as mentioned, is used to calculate total energy usage for that device.)

br,
sambuca