Announcement

Collapse
No announcement yet.

Using mcsTemperature to track energy usage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mario from Spain
    replied
    When I access your site I see mcsTempeatue 4.36.0 is running. 4.36.1 is the one where the counter setup was corrected. I also connected a counter with a clean ini file with 4.36.2 and it correctly discovered wind/gust/flow/flow rate and no extra device as you were showing with 4.36.0.
    Opps! I don't know when/how I rolled back to 4.36.0

    Leave a comment:


  • Michael McSharry
    replied
    The explaination of the ini

    Device Code user entry
    Sensor Index for Temp05 or Com Port for DS9097
    Calibration/Bias user entry
    Error Count
    Resolution user edit

    In earlier versions of the plugin a value of 97 for the index was used to identify it as a DS9097U rather than a Temp08 sensor. I think I changed it when I went to multiple adapter support or it may of been as part of my migration to xAP in mcsEnvironment where the port becomes part of the xAP address

    When I access your site I see mcsTempeatue 4.36.0 is running. 4.36.1 is the one where the counter setup was corrected. I also connected a counter with a clean ini file with 4.36.2 and it correctly discovered wind/gust/flow/flow rate and no extra device as you were showing with 4.36.0.

    Leave a comment:


  • Mario from Spain
    replied
    I did it but something is still wrong...

    This is what the rediscovering discovered:

    [Devices]
    A7000000318E2828="]2,COM9,,,0"
    8A000000052B521DW="]65,COM9,,,0"
    8A000000052B521DG="]66,COM9,,,0"
    8A000000052B521DN1="^44,COM9,,,0"
    8A000000052B521DC1="^45,COM9,,,0"
    8A000000052B521DN="^66,COM9,,,0"

    And the [Database]

    ]2="tA7000000318E2828,0,1"
    ]65="s8A000000052B521DW,2,1"
    ]66="s8A000000052B521DG,3,1"
    ^44="s8A000000052B521DN1,29,1"
    ^45="s8A000000052B521DC1,30,1"
    ^66="s8A000000052B521DN,29,1"

    No clue of the old:

    [Devices]
    A7000000318E2828="]1,97,,5,0"
    8A000000052B521D7="]34,97,,2,0"
    8A000000052B521D8="]35,97,,0,0"

    Also... please, can you explain me the values after the address in the [Devices] like "35,97,,0,0" or "^66,COM9,,,0"?

    I reverted to the old mcsTemperature.ini and everything is working right again with just one counter.

    Many thanks.

    Leave a comment:


  • Michael McSharry
    replied
    What I think you will need to do is remove the counter from the ini file and let it rediscover it normally. The logic was not setup to find a second counter if the first was already recorded. All you database information can be left intact and you can reassign the virtual device codes after then new discovery. If that does not do it for you then let me know and I can look into it when I return this weekend.

    Leave a comment:


  • Mario from Spain
    replied
    Hi Michael.

    I'm triying to setup the wather flow meter but I'm having some issues.

    As the 1-wire counter 14 wasn't showing, I added to the [Devices] Section:

    8A000000052B521DN1="]36,,,1,0"
    8A000000052B521DC1="]37,97,,1,0"

    And to the [Database] section:

    ]36="WaterToday,29,1"
    ]37="WaterRate,30,1"

    But after entering the mcsTemperature and existing for it to learn the new configuration and create the new virtual devices, I can find now a new device:

    8A000000052B521DN="^44,97,,0,0" with the DB entry ^44="s8A000000052B521DN,29,1"

    What it corresponds to? I have just one DS2423 in the 1-wire network right now (I pan to add another as a lighting counter).
    8A000000052B521DN="^44,97,,0,0"

    The old wattage stoped working also.

    The [Database] section looks like:

    ]1="tA7000000318E2828,0,1"
    ]34="WattageToday,31,1"
    ]35="WattageRate,32,1"
    ]36="WaterToday,29,1"
    ]37="WaterRate,30,1"
    ^65="s8A000000052B521DN,29,1"

    And the [Devices] section:

    [Devices]
    A7000000318E2828="]1,97,,5,0"
    8A000000052B521D7="]34,97,,1,0"
    8A000000052B521D8="]35,,,0,0"
    8A000000052B521DN1="]36,,,1,0"
    8A000000052B521DC1="]37,97,,1,0"
    8A000000052B521DN="^65,97,,0,0"

    Leave a comment:


  • Michael McSharry
    replied
    If the counters are working as you expect then I do not thing there is anything else you need to test.

    Leave a comment:


  • Mario from Spain
    replied
    Hi Michael.

    Now it's working pretty well.

    I want to add to the equation a current transformer connected to my ocelot to show the inmediate consumption as the counter bassed way isn't very good for this king of measurament.

    I think the way for any measurament of this kind to be acurate is to use both, a counter meter and a current transformer.

    Do you want me to do any test about the modifications to the two counters before you make this version public?
    Attached Files

    Leave a comment:


  • Mario from Spain
    replied
    It's working!!!

    Tomorrow I'll try the new version.
    Attached Files

    Leave a comment:


  • Michael McSharry
    replied
    You have database names that start with a number. Change the field to start with an alpha. In mcsEnvironment (not yet available) I do not let the users edit the database field names so these type of problems will not occur. I could also check for valid field names.

    Leave a comment:


  • Mario from Spain
    replied
    This is what I get in the log when try a LineSel graph:

    Code:
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~Chart SQL=SELECT SampleDate AS StartDate, (8A000000052B521D8) AS Q1, (8A000000052B521D7) AS Q2 FROM TemperatureNew7 WHERE SampleDate >= #2005-03-30 20:00# AND SampleDate < #2005-03-31 2:00#
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~Chart SQL2=
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~Chart SQL3=
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~FixTable field [TemperatureNew7].[8A000000052B521D8]
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~FixTable SQL UPDATE TemperatureNew7 SET [TemperatureNew7].[8A000000052B521D8] = 0 WHERE ((([TemperatureNew7].[8A000000052B521D8]) Is Null))
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~FixTable field [TemperatureNew7].[8A000000052B521D7]
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~FixTable SQL UPDATE TemperatureNew7 SET [TemperatureNew7].[8A000000052B521D7] = 0 WHERE ((([TemperatureNew7].[8A000000052B521D7]) Is Null))
    31/03/2005 1:11:33~!~mcsTemperature Debug~!~X Axis Data Completed
    31/03/2005 1:11:33~!~mcsTemperature~!~ Draw CD Chart with on line 5410 Object variable or With block variable not set

    Leave a comment:


  • Michael McSharry
    replied
    I just tried to chart the wattage and the rate for my test device and all was well with it. I define a group to put them and drew a 6 hr chart with both displayed.

    The attached should have the 2nd counter problems resolved. If you delete the current DS2423 definitions then it will refind them as wind and water sensors. Change the sensor type from the Analog tab.

    The ini's History keys have been changed to use the device code for which the history is being tracked. This will allow multiple sensors of each type with each able to track history.
    Attached Files

    Leave a comment:


  • Mario from Spain
    replied
    Do you have idea why I can't any kind of graph or table for the wattage devices?

    Leave a comment:


  • Michael McSharry
    replied
    I'll look into the 2nd counter some more. The difficult part it making it work as expected for existing users and provide the new counter going forward.

    If you use a weight of 1.0 then only the last and current sample values are used to compute the rate. If you use 0.5 then the delta between the current sample and prior sample is averaged with the rate computed last iteration. If you use 0.1 then 90% of the rate is determined by the prior rate and 10% by the delta between the last two samples.

    Leave a comment:


  • Mario from Spain
    replied
    You are correct. The devicevalue was not correct.
    Working!

    I added a weight parameter to the Devices/Files tab where the cal factors were defined. A weight of 1 gives the fastest rate response. A value near 0 gives a very slow one.
    A will make some analysis on this. As the time calculations are based in whole seconds, with a fast pool rate (10 seconds) the display value varies a lot as it can see some times two pulses and some times four. I changed the pull rate to 60 seconds and now it's working better.
    Does the weight of 1 any average with the previous number? I'm asking because at first look it seems to be slow to stabilyze.

    Please confirm that an existing user that has a wind speed (or any counter) setup will have no problems with the current 2nd counter logic. The problem only occurs when the DS2423 is new to the plugin.
    I had no problems until I deleted the DS2423 from the [devices] and [database] sections. Is there any more test I can do before giving it to others to try?

    The setup management is complex, but once setup it should work correctly. You can edit the ini file that was attached in your last message so that your counter has D7 and D8 for the counter 15 and DN1 and DC1 for counter 14 setup as a water flow sensor. There should be exactly 4 DS2423 sensor entries in devices group.
    I added this to the [database] section:
    ]65="s8A000000052B521DN1,2,1"
    ]66="s8A000000052B521DC1,3,1"

    and this to the [devices] section:
    8A000000052B521DN1="]65,COM9,,0,0"
    8A000000052B521DC1="]66,COM9,,0,0"

    And again it's creating a 5th device and doind something wrong with the values:

    Code:
     
    30/03/2005 12:20:55~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS2423 8A000000052B521D
    30/03/2005 12:20:55~!~mcsTemperature~!~Creating database fields s8A000000052B521DN1,s8A000000052B521DC1,s8A000000052B521DN in C:\Archivos de programa\HomeSeer\mcsTemperature.mdb\TemperatureNew7
    30/03/2005 12:20:55~!~mcsTemperature Debug~!~Water Counter=62221, Prior Counter=62183, Interval=434 seconds
    30/03/2005 12:20:55~!~mcsTemperature Debug~!~]34 Water Delta Seconds=434, Prior Value=62183, Current Value=62221, Rate=315,2074
    30/03/2005 12:21:55~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS18B20 A7000000318E2828
    30/03/2005 12:21:56~!~mcsTemperature Debug~!~setIO ]1 from 0 to 19
    30/03/2005 12:21:57~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS2423 8A000000052B521D
    30/03/2005 12:21:57~!~mcsTemperature Debug~!~Water Counter=62229, Prior Counter=0, Interval=1,655005E+08 seconds
    30/03/2005 12:21:57~!~mcsTemperature Debug~!~^44 Water Delta Seconds=1,655005E+08, Prior Value=0, Current Value=62229, Rate=0,541447
    30/03/2005 12:21:57~!~mcsTemperature Debug~!~setIO ^44 from 0 to 19
    30/03/2005 12:21:57~!~mcsTemperature Debug~!~setIO ^44 from 0 to 19
    30/03/2005 12:21:57~!~mcsTemperature Debug~!~setIO ]60 from 0 to 19
    30/03/2005 12:22:58~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS18B20 A7000000318E2828
    30/03/2005 12:22:59~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS2423 8A000000052B521D
    30/03/2005 12:22:59~!~mcsTemperature Debug~!~Water Counter=62237, Prior Counter=62229, Interval=62 seconds
    30/03/2005 12:22:59~!~mcsTemperature Debug~!~^44 Water Delta Seconds=62, Prior Value=62229, Current Value=62237, Rate=186,1313
    30/03/2005 12:22:59~!~mcsTemperature Debug~!~setIO ^44 from 0 to 19
    30/03/2005 12:22:59~!~mcsTemperature Debug~!~setIO ]60 from 0 to 19
    30/03/2005 12:22:59~!~mcsTemperature Debug~!~Log Temperature Sensor Count=44, INSERT INTO TemperatureNew7(SampleDate,CSVYear,CSVMonth,CSVDay,CSVHour,CSVMinute,CSVSecond,CSVWindSpeed,CSVWindGust,CSVWindDirection,CSVInsideHumidity,CSVOutsideHumidity,CSVInsideTemperature,CSVOutsideTemperature,CSVBarometer,CSVTotalRain,CSVDailyRain,CSVHourlyRain,CSVWeatherCondition,CSVChannel1Temperature,CSVChannel1Humidity,CSVChannel2Temperature,CSVChannel2Humidity,CSVChannel3Temperature,CSVChannel3Humidity,CSVEvapotranspiration,CSVUVIndex,CSVSolarRadiation,CSVWindChild,CSVIndorHeatIndex,CSVOutdoorHeatIndex,CSVDewPoint,CSVRainRate,CSVOutdoorTempRate,CSVIndoorTempRate,CSVBarometerRate,CSVChannel1TempRate,CSVChannel2TempRate,CSVChannel3TempRate,tA7000000318E2828,8A000000052B521D8,8A000000052B521D7,s8A000000052B521DN1,s8A000000052B521DC1,s8A000000052B521DN) SELECT #2005-03-30 12:22:59# AS QT,200500 AS Q0,300 AS Q1,3000 AS Q2,1200 AS Q3,2200 AS Q4,0 AS Q5,900 AS Q6,1400 AS Q7,1400 AS Q8,4000 AS Q9,3600 AS Q10,2260 AS Q11,1830 AS Q12,101904 AS Q13,4000 AS Q14,0 AS Q15,0 AS Q16,0 AS Q17,0 AS Q18,0 AS Q19,2100 AS Q20,3700 AS Q21,0 AS Q22,0 AS Q23,0 AS Q24,0 AS Q25,0 AS Q26,1830 AS Q27,2260 AS Q28,1810 AS Q29,300 AS Q30,0 AS Q31,170 AS Q32,70 AS Q33,29 AS Q34,0 AS Q35,0 AS Q36,0 AS Q37,2080 AS Q38,606400 AS Q39,28571 AS Q40,0 AS Q41,0 AS Q42,84578 AS Q43
    After go in and out of the setup to create the devices:

    Code:
    30/03/2005 12:27:04~!~mcsTemperature Sensor Info~!~A7000000318E2828, HS:]1, Index:97, DB:tA7000000318E2828,0,1
    30/03/2005 12:27:04~!~mcsTemperature Sensor Info~!~8A000000052B521D7, HS:]34, Index:COM9, DB:8A000000052B521D8,31,1
    30/03/2005 12:27:04~!~mcsTemperature Sensor Info~!~8A000000052B521D8, HS:]35, Index:, DB:8A000000052B521D7,32,1
    30/03/2005 12:27:04~!~mcsTemperature Sensor Info~!~8A000000052B521DN, HS:^44, Index:97, DB:s8A000000052B521DN,29,1
    30/03/2005 12:27:04~!~mcsTemperature Sensor Info~!~8A000000052B521DW1, HS:]65, Index:, DB:s8A000000052B521DN1,2,1
    30/03/2005 12:27:04~!~mcsTemperature Sensor Info~!~8A000000052B521DG1, HS:]66, Index:97, DB:s8A000000052B521DC1,3,1
    30/03/2005 12:27:04~!~mcsTemperature Debug~!~setIO ]61 from 0 to 19
    30/03/2005 12:27:04~!~mcsTemperature Debug~!~PollDS9097Switches:
    30/03/2005 12:27:05~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS18B20 A7000000318E2828
    30/03/2005 12:27:06~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS2423 8A000000052B521D
    30/03/2005 12:27:07~!~mcsTemperature Debug~!~Water Counter=62270, Prior Counter=62262, Interval=64 seconds
    30/03/2005 12:27:07~!~mcsTemperature Debug~!~^44 Water Delta Seconds=64, Prior Value=62262, Current Value=62270, Rate=758,2706
    30/03/2005 12:27:07~!~mcsTemperature Debug~!~setIO ^44 from 0 to 19
    30/03/2005 12:27:09~!~mcsTemperature Debug~!~setIO ]61 from 0 to 19
    30/03/2005 12:27:09~!~mcsTemperature Debug~!~PollDS9097Switches:
    30/03/2005 12:27:14~!~mcsTemperature Debug~!~setIO ]60 from 0 to 19
    30/03/2005 12:27:14~!~mcsTemperature Debug~!~Log Temperature Sensor Count=44, INSERT INTO TemperatureNew7(SampleDate,CSVYear,CSVMonth,CSVDay,CSVHour,CSVMinute,CSVSecond,CSVWindSpeed,CSVWindGust,CSVWindDirection,CSVInsideHumidity,CSVOutsideHumidity,CSVInsideTemperature,CSVOutsideTemperature,CSVBarometer,CSVTotalRain,CSVDailyRain,CSVHourlyRain,CSVWeatherCondition,CSVChannel1Temperature,CSVChannel1Humidity,CSVChannel2Temperature,CSVChannel2Humidity,CSVChannel3Temperature,CSVChannel3Humidity,CSVEvapotranspiration,CSVUVIndex,CSVSolarRadiation,CSVWindChild,CSVIndorHeatIndex,CSVOutdoorHeatIndex,CSVDewPoint,CSVRainRate,CSVOutdoorTempRate,CSVIndoorTempRate,CSVBarometerRate,CSVChannel1TempRate,CSVChannel2TempRate,CSVChannel3TempRate,tA7000000318E2828,8A000000052B521D8,8A000000052B521D7,s8A000000052B521DN1,s8A000000052B521DC1,s8A000000052B521DN) SELECT #2005-03-30 12:27:14# AS QT,200500 AS Q0,300 AS Q1,3000 AS Q2,1200 AS Q3,2600 AS Q4,1500 AS Q5,900 AS Q6,1400 AS Q7,1400 AS Q8,4100 AS Q9,3600 AS Q10,2220 AS Q11,1860 AS Q12,101904 AS Q13,4000 AS Q14,0 AS Q15,0 AS Q16,0 AS Q17,0 AS Q18,0 AS Q19,2100 AS Q20,3700 AS Q21,0 AS Q22,0 AS Q23,0 AS Q24,0 AS Q25,0 AS Q26,1860 AS Q27,2220 AS Q28,1840 AS Q29,320 AS Q30,0 AS Q31,190 AS Q32,30 AS Q33,27 AS Q34,0 AS Q35,0 AS Q36,0 AS Q37,2060 AS Q38,606400 AS Q39,28571 AS Q40,0 AS Q41,0 AS Q42,18630 AS Q43
    30/03/2005 12:27:14~!~mcsTemperature Debug~!~setIO ]61 from 0 to 19
    30/03/2005 12:27:14~!~mcsTemperature Debug~!~PollDS9097Switches:
    30/03/2005 12:27:16~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS18B20 A7000000318E2828
    30/03/2005 12:27:17~!~mcsTemperature Debug~!~DS9x9x Port <COM9>Device = DS2423 8A000000052B521D
    30/03/2005 12:27:18~!~mcsTemperature Debug~!~Water Counter=62272, Prior Counter=62270, Interval=11 seconds
    30/03/2005 12:27:18~!~mcsTemperature Debug~!~^44 Water Delta Seconds=11, Prior Value=62270, Current Value=62272, Rate=716,7806
    30/03/2005 12:27:18~!~mcsTemperature Debug~!~setIO ^44 from 0 to 19
    30/03/2005 12:27:18~!~mcsTemperature Debug~!~Setup Page Unload
    Attached is how it looks. The imaged was grabed after the logs. You can see, the "good" devices (]34 and ]35) and not updating anymore and the ini contains:

    Code:
     
    [Temperature]
    watt_history=;;315,2074;;62221;30/03/2005 12:20:55;56157
    RainCalibrationRate="0.2"
    WaterFlowCalibrationRate="0.4"
    WattCalibrationRate="1"
    gallon_history=;;612,9255;;62280;30/03/2005 12:28:21;62229
      
    [Database]
    ]1="tA7000000318E2828,0,1"
    ]34="8A000000052B521D8,31,1"
    ]35="8A000000052B521D7,32,1"
    ]65="s8A000000052B521DN1,2,1"
    ]66="s8A000000052B521DC1,3,1"
    ^44="s8A000000052B521DN,29,1"
    ]67="s8A000000052B521DW,2,1"
     
    [Devices]
    A7000000318E2828="]1,COM9,,1,0"
    8A000000052B521D7="]34,COM9,,,0"
    8A000000052B521D8="]35,,,,0"
    8A000000052B521DN1="deleted"
    8A000000052B521DC1="deleted"
    8A000000052B521DN="^44,COM9,,,0"
    8A000000052B521DW1="]65,,,,0"
    8A000000052B521DG1="]66,COM9,,,0"
    8A000000052B521DW="]67,97,0,0,0"
    Also, in Temperature.asp there is no way to plot any kind of graph or table for ]34 and ]34.

    I deleted the new entries in the ini and the devices and now everything is working again.
    Attached Files
    Last edited by Mario from Spain; March 30, 2005, 05:34 AM.

    Leave a comment:


  • Michael McSharry
    replied
    You are correct. The devicevalue was not correct.
    I added a weight parameter to the Devices/Files tab where the cal factors were defined. A weight of 1 gives the fastest rate response. A value near 0 gives a very slow one.

    Please confirm that an existing user that has a wind speed (or any counter) setup will have no problems with the current 2nd counter logic. The problem only occurs when the DS2423 is new to the plugin.

    The setup management is complex, but once setup it should work correctly. You can edit the ini file that was attached in your last message so that your counter has D7 and D8 for the counter 15 and DN1 and DC1 for counter 14 setup as a water flow sensor. There should be exactly 4 DS2423 sensor entries in devices group.
    Last edited by Michael McSharry; March 30, 2005, 03:27 PM.

    Leave a comment:

Working...
X