|
los93sol
|
 |
« on: May 24, 2010, 02:40:33 pm » |
|
I'm working on a new device that logs power usage, and will be making use of/enhancing the DataLogger Plugin to get the data to the user in a meaningful way. Currently, I can already harvest all the data off the device and have it stored in a few hashes ready to be pumped out as events to the DataLogger Plugin. I looked at the C++ code for the plugin and see a function ProcessEvent, as I understood it, that should be a command that the device accepts, but checking out the template in the web admin, I do not see any events or commands in the template. I also searched through Advanced>DCE>Commands and through Events and did not find Process Event anywhere? Is Process Event generic in the sense that I literally just create a new event and send it to the DataLogger from my device and it falls into the ProcessEvent function by default?
|
|
|
|
|
Logged
|
|
|
|
|
sambuca
|
 |
« Reply #1 on: May 24, 2010, 07:50:56 pm » |
|
The events and commands defined in the device template is the events the device emits and the commands it accepts. In the case of the datalogger plugin, I believe it registers itself to receive all events within lmce, check out the ::Register method.
So it will receive any events, also new ones that you may need to create.
best regards, sambuca
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #2 on: May 24, 2010, 11:31:22 pm » |
|
correct, it registers to all events. Btw, it only logs temp/hum/brightness/co2 level changed events for now.
br Hari
|
|
|
|
|
Logged
|
|
|
|
|
los93sol
|
 |
« Reply #3 on: May 25, 2010, 06:27:09 am » |
|
Aha! That's exactly what I was after guys, thanks for the clarification...been a few months since I was into the C++ devices...I need to brush up on things again.  In that case, my job from here should be relatively straightforward to get the data to the logger, just need to decide what data to send in the event and create the events/send the data on over. A side note: Apagg, I saw your note in the dev channel, dropped you a pm there as well, feel free to post back here, what information does your graphing require to be generated and is it currently tied to the datalogger plugin? Since I'm already gathering all the data from the device I'm using and you're graphing already works, I'd like to meet somewhere in the middle to adapt what I have to work with what you have and possibly extend your work to provide more infromation based on what I can provide. Please let me know, I've got the data already, just need to pass it in the form of an event appropriately.
|
|
|
|
|
Logged
|
|
|
|
|
apagg
|
 |
« Reply #4 on: May 25, 2010, 08:25:07 pm » |
|
my code for the energyMonitor can be fond here http://code.google.com/p/apagg-lmce/source/browse/#svn/trunkI have added logging of "state changed" to DataLogger_Plugin.cpp and used unit=5 for the database The energyGraph that I am working on uses the "state" from the datalogger and the "energy consumption" parameter I have added to template 37, 38 and 1897. I am still struggling to plot the correct data in the graph, but I think that energyMonitor.php should display the correct data. all my devices that report state are z-wave I dont know how things like X-10 or KNX will work.
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #5 on: May 25, 2010, 09:53:52 pm » |
|
why don't you use our own svn?
br Hari
|
|
|
|
|
Logged
|
|
|
|
|
apagg
|
 |
« Reply #6 on: May 25, 2010, 10:13:18 pm » |
|
why don't you use our own svn? 1. This is the first time I have coded anything and I dont want to brake anything  2. I dont have access to the svn regards apagg
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #7 on: May 25, 2010, 10:18:26 pm » |
|
2.) is easy to fix :-)
|
|
|
|
|
Logged
|
|
|
|
|
coley
|
 |
« Reply #8 on: May 27, 2010, 11:35:14 am » |
|
Guys, What kind of energy monitors are you using to gather the data? I've a CurrentCost monitor and would be willing to try and help and add support for this into your work. It outputs an xml string of its state every five seconds.
-Coley.
|
|
|
|
|
Logged
|
|
|
|
|
los93sol
|
 |
« Reply #9 on: May 29, 2010, 05:25:51 pm » |
|
Coley: I'm working with the TED5000 currently, please drop by the dev channel to discuss your device.
|
|
|
|
|
Logged
|
|
|
|
|
los93sol
|
 |
« Reply #10 on: May 30, 2010, 02:33:13 am » |
|
For those interested in this, I have a little screenshot action for you. This is my current progress. Feedback is welcome! 
|
|
|
|
|
Logged
|
|
|
|
|
apagg
|
 |
« Reply #11 on: May 30, 2010, 08:56:38 am » |
|
Looks nice  Did you have to make any changes to dataLogger.php or graph.php?
|
|
|
|
|
Logged
|
|
|
|
|
los93sol
|
 |
« Reply #12 on: May 30, 2010, 04:49:22 pm » |
|
No changes in viewDatalog.php or graph.php yet, I want to see what else I can do in there to enhance the graphing a bit so that may change, for example, I'd like to be able to provide some additional information to the graph, like month to date figures, etc. Below is the running list of changes so far for this...
-Found a dependency problem with graph.php, it requires php-image-graph package -Added new event category, Energy Monitoring -Added new events, Voltage Changed, Energy Cost Changed, and Power Usage Changed -New manufacturer, TheEnergyDetective -New device template, TED5000 -Enhanced DataLogger_Plugin to log Voltage, Energy Cost, and Power usage -Applied enhancement from Apagg for DataLogger_Plugin to log State Changed events
I think that's everything, there might be more...
|
|
|
|
|
Logged
|
|
|
|
|
l3mce
|
 |
« Reply #13 on: May 30, 2010, 05:42:20 pm » |
|
Nice work!!
|
|
|
|
|
Logged
|
I never quit... I just ping out.
|
|
|
|
|
|