Haiku HH: Logging and Graphing Light Usage

jeremyg

Member
I am looking for a script that will keep a log of the ON duration of all lighting units. Is there a quick way to do that?
 
It should be relatively easy, but how do you want to log it?
 
 
You can use onUnitOn/onUnitOff or onUnitStateChange to get notified of changes.
 
Then you can just use timestamps to compare the time between the on/off states and record them somewhere, such as in a hash or just simply log it, depending on your needs.
 
I guess logging to an external file would be sufficient. I am most interested on comparing usage and electric bills over time.
 
Okay then you can use the logging functions to log to a text file. You can use a CSV and easily analyze it in a spreadsheet for example.
 
Back
Top