Charmed Quark Systems
Google
WWW CharmedQuark.com

Go Back   Charmed Quark Systems > General Discussion > Beta Driver Development
Register FAQ Members List Calendar Mark Forums Read

Beta Driver Development Discussion of new drivers, finding someone to write a new driver, etc...

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-23-2008, 04:11 PM
beelzerob beelzerob is offline
 
Join Date: Mar 2006
Location: Central PA
Posts: 4,662
Default Brultech ECM-1220.H Driver Development

This thread is for development of a driver for the Brultech ECM-1220 and 1220H home power monitoring system. If you own the device, please feel free to install this driver pack and provide input on any errors encountered.

*NOTE*: To use this beta version driver, you must be updated to CQC version 2.4.20 or later.

The current driver supports the following fields (all read only):
  • Channel 1 Current (amps)
  • Channel 2 Current (amps)
  • Total Current (amps)
  • Total Current (amps) (Averaged over 5 sec)
  • Voltage (volts)
  • Channel 1 Watts
  • Channel 2 Watts
  • Watts Total
  • Watts Total (Averaged over 5 sec)
  • Channel 1 kWattHours consumed since reset
  • Channel 2 kWattHours consumed since reset
  • Total kWattHours consumed since reset
  • kWh_Costs_Day
  • kWh_Costs_Day_Projected
  • kWh_Costs_Hour
  • kWh_Costs_Hour_Projected
  • kWh_Costs_Last_Day
  • kWh_Costs_Last_Hour
  • kWh_Costs_BillingPeriod
  • kWh_Costs_BillingPeriodProjected
  • kWh_Last_Hour
  • kWh_Used_Current_Hour
  • kWh_Used_Current_Day
  • kWh_Used_Current_Billing_Period
  • CurrentRatePeriod
  • CurrentRate
The following rate structures are planned for support:

1) Straight rate per kWH (currently supported).
2) Tiered rate based on kWH usage. (currently supported).
3) Special peak rate
4) Time of day and day of week rates. (in work)

To use the cost calculations, you must create a config-type file and place it in the following directory (on the PC this driver is installed on):

\CQC\CQCData\MacroFileRoot\Drivers\Brultech

The file must be named rate_info.txt and the info put into it depends on the rate structure you have.

NOTE: Everything below is subject to change as the code matures and better formats for the config file are determined. Your patience is appeciated.

The file must have this basic structure (?? represents user selected values):
Code:
BillingDate=9 RateType=??(Straight, TimeOfUse or Tiered) StartRates RateName=?? ???????? (See examples) EndRate EndRates END

Examples are included in the rate_info_examples.zip file attached to this post. REMEMBER, the file in your directory must be named rate_info.txt.

When specifying months or days in a TimeOfUse rate, be sure and use the full month or weekday name ("January", "Saturday"), and not the abbreviated name. Capitalization is not important.



Logging to a file
If you write True to the LogData field, then a log file will be created in the same directory as the rate config file. The file name will be of the form:

datalog_[Month][Day]_[Hours]_[Min].csv

The driver will then log data into the file every minute. The data is one entry per line, and each entry contains several values separated by commas. This should make importing (and thus graphing) in Excel or OpenOffice Calc very easy.

The driver will continue to log until you write False to the LogData field, or remove the driver.

Each line in the file will contain the following fields (separated by commas):
Date/Time
TotalKwh (since last reset)
TotalWatts
TotalAmps
Costs_LastHour
Costs_Hour
Costs_HourProj
Costs_LastDay
Costs_Day
Costs_DayProj

Note: If you write True to the LogStoredData field instead of the LogData field, then the driver will go offline, and read the stored data from the device and log it to the file, before coming back online, and data will continue to be stored from that point on. So, if you want to capture in a file all of the data stored in the device, that is the way to do it.

Unit Configuration
In order to be able to use the data stored in the device, you must do the following (only once):

1) Using the unit menu, set a new interval of not less than 5 (minutes), and not more than 60.
2) After setting that, you must use the menu to reset the device. When you reset it is very important...you must reset it on the interval you chose. For instance, if you chose 5 minutes for an interval, then you will need to reset the device at :00, :05, :10...:45, :50, or :55. So, when the interval evenly divides into the minutes. This has to be done to synch the device logging to your wall clock, as there is no internal clock in the device. As another example, if you set the interval to 15, then you need to reset the device at :00, :15, :30 or :45 during the hour.
Attached Files
File Type: cqcdrvpack Brultech_ECM1220_dev_v.2.7.CQCDrvPack (21.4 KB, 10 views)
File Type: zip rate_info_examples.zip (800 Bytes, 6 views)

Last edited by beelzerob : 01-28-2009 at 05:43 PM.
Reply With Quote
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:47 PM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.