Device usage report ?

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
roussell
Advanced Member
Posts: 268
Joined: Wed Dec 15, 2004 9:07 am
Location: Pelham, AL

Device usage report ?

Post by roussell »

I got an email from a competing HA technology today that showcased some of the things it forum members had done. One of the items was a device usage report that when ran would show all of the devices in the system (light's mostly) and how many minutes each device was on for the queried day. The report was a simple two coulomb (Device, Minutes On) with the queried date as the header and a date box and submit button in the footer. Simple enough...

I was thinking that this is a pretty good trick for HB and so was going to write one but wanted to ask you guys first - what is the best way to get the on-times for various devices in HB. if you have constant loads like lights then it would be easy math to convert on-times into power used and money spent on each device per day. I see the following options for pulling the data:

1. Have each device you want to monitor write to a log file and then parse that
2. Once/minute check the power status of each property you wan to monitor and log that to a db/file/property/array/etc...
3. Read the HB db directly looking for status changes once/minute and log from that.

I guess I'm leaning toward #2 but are there any other ideas? If not which one of the above seems to be the best fit?

I was thinking that whatever I write would just return raw data so that the end user could use it for a web report, swremote display, graph, whatever...

What's in my mind at the moment is based on #2 above and would be similar to this :

*************************************************
(Setup)
Create a "monitor" script device with an alphalist property where each line is formatted as:
Device.Property to monitor, property state to monitor
example: Post Lamp.Power State, On

(Pseudo code)

Code: Select all

 once/minute
   for each device.property in alphalist:
      if the current state = monitored state then 
         add one minute to the variable representing the total time for that device.property
once/day (midnight ??)
   store in db (sqllite, access, flat-text) --> device, property, datestamp, totaltime
*********************************************

It would be cool if each device already kept up with it's on/off duration somewhere, perhaps a feature request if there is sufficient interest...

What are your thoughts, is it worth writing? It seems to be a simple endeavor...

TIA,

Terry
Steve Horn
HouseBot Guru
Posts: 785
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Device usage report ?

Post by Steve Horn »

just my 2 cents...
At this point, I'm more interested in the heavy users of my kilowatts and am leaning toward purchase of the emonitor device. Of course, if I was controlling the major power pigs (fridge, HT, office,..) with HB devices, your proposal would work like a champ. But all my control of electrical devices via HB/Insteon are low wattage items, whose usage I suspect would get lost in the noise. From a "pattern spotting" standpoint though (rather than $ and watts) , your approach makes good sense and it would be interesting to implement.
fwiw,
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Device usage report ?

Post by Richard Naninck »

Same here. All of my lights are low power lights or are dimmable. Knowing how long my lights are on could never tell me how much power is consumed due to the fact that my lights are always at some dim level. Furthermore you would have to add in a calculation how much watts each device uses.
RFXCOM powermeters would do a better job here because they show true power usage (+/- 3%) and include all devices at once because you are right at the source.
My lights switch on automatically when an alarm sensor triggers and shut off after a timer times out. That's how I control my lights and I can't narrow that down anymore to more comfort or less usage.

Always nice to build something new though however it would only go for devices with a true on/off state and just about 90% of my devices aren't of the on/off type, but hold many different labels to visualize stuff in my remote.
roussell
Advanced Member
Posts: 268
Joined: Wed Dec 15, 2004 9:07 am
Location: Pelham, AL

Re: Device usage report ?

Post by roussell »

I used the lights just as an example, and you guys have valid points, however my house is filled with non-dimmable CFLs, so my switches are almost all true on/off. Obviously there are other things that it can be used for when accessorized appropriately - like putting current monitors on the TVs and monitoring the on time of those. Maybe I just have some unique situations, for the most part though, I just like replicating stuff with HB that is see in much more expensive packages. 8)

I'll probably go ahead and throw something together and post it in case anyone else has any interest. I may include an operator in the list so that other than strictly x=y I could also have x>y and x<y if I want to use it for anything other than a on/off status.

Thanks for the feedback,
Terry
Steve Horn
HouseBot Guru
Posts: 785
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Device usage report ?

Post by Steve Horn »

Terry, I'd still be interested in looking at your work and learning (or trying) something. BUT>>> if you want to apply yourself and someone (me or any other HB user) purchases the emonitor pkg, it streams its data out as an XML data file of some sort that could be useful in a HB presentable format. Supposedly, the doc. included with the pkg describes the data format of the output file.
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Device usage report ?

Post by Richard Naninck »

emonitor looks nice and xml is easy to parse so as to make the data available to HB, but the price is scary, I should have the 2 emonitor device and at alittle short of 1800$, I think that is pretty steep. However, one day I will hook HB up to a power usage system. Not sure however which one it will be. I heard you can but completely new power hardware which has an rs232 port to provide data. That would ultimately be the best solution.
Sorry for going OT BTW 8)
Post Reply