Announcement

Collapse
No announcement yet.

mcsTemperature Charting of Discrete Durations

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

    mcsTemperature Charting of Discrete Durations

    I updated mcsTemperature to provide charts that show the duration of discrete signals. This type of display is useful if a discrete device is used to monitor the ON time of a piece of equipment. In the attached chart the time when gas is flowing into the furnace is being monitored. Since gas flow rates into the furnace do not modulate the ON time is proportionial to the volume of propane that is being consumed.

    This chart shows three lines. One is the amount of time the gas valve is on each day. The other two are analog measurements of the Kitchen/Inside temperature and the solar radiation. The inside temperature is maintained at a relatively constant level with slight day to night variation. The solar reflects the energy that is being added or removed from the sun and outside temperature. There is also a fireplace that is used to add heat, but this is not shown in this graph to reduce complexity and ease understanding and not over clutter the chart.

    The table above the chart show the statistics over the period of interest. For the discrete it shows the average ON time per day. This is the daily consumption rate of gas for the week being shown. It also shows the minimum and maximum daily times. For periods of under a week the aggregation is on an hourly basis. In this case the statistics whould show the hourly consumption rate and the min and max of a one-hour period.
    Attached Files

    #2
    When the short duration 6-hour scale is used to show discrete information then the trend chart shows the 0/1 leves of the discrete signal rather than the amount of time that the signal is on over a given interval. The attached chart shows a 6 hour period from the same period as the chart in the prior post. In this case the pulsed ON-OFF transitions show how the thermostat is controlling the gas flow into the furnace. This happens to be one of the Honeywell thermostats that modulates so assure overshoot and undershoot conditions are minimized.
    Attached Files

    Comment


      #3
      I use 3 discret on/off switch, but, i see average number (26),and the min (1:01/h) and max (1:00:00/h)

      and error log
      2005-03-05 10:27:52~!~mcsTemperature~!~BarChartDuration SELECT * FROM Foldszint_Occupancy WHERE SampleDate >= #2005-03-02 11:00# AND Duration is NUll ORDER BY Time DESC on line 90 No value given for one or more required parameters.
      2005-03-05 10:27:53~!~mcsTemperature~!~BarChartDuration SELECT * FROM Padlofutes WHERE SampleDate >= #2005-03-02 11:00# AND Duration is NUll ORDER BY Time DESC on line 90 No value given for one or more required parameters.
      2005-03-05 10:27:53~!~mcsTemperature~!~BarChartDuration SELECT * FROM Radiatorfutes WHERE SampleDate >= #2005-03-02 11:00# AND Duration is NUll ORDER BY Time DESC on line 90 No value given for one or more required parameters.

      Comment


        #4
        In my xAP implementation the date field name is not an option with SampleDate being the name used. I updated for mcsTemperature to use the user-provided date field name. V4.33.2.

        I thought you were using SQL. It looks to me as if the date format is an Access format. It will work with either database, just curious why you went back to Access.

        Comment


          #5
          2005-03-07 09:30:02~!~mcsTemperature~!~BarChartDuration SELECT * FROM Radiatorfutes WHERE [Time] >= #2005-03-06 10:00# AND Duration is NUll ORDER BY [Time] DESC on line 90 No value given for one or more required parameters.
          2005-03-07 09:30:02~!~mcsTemperature~!~BarChartDurationMaxMin on line 90 No value given for one or more required parameters.

          My table :ID, SampleDate, Discete,Duration

          Comment


            #6
            Ps
            I use 2 systems, one my company testing and develop (mssql) and home 7x24 hours working (mdb).

            Comment


              #7
              It looks like it it trying to use the date/time field from the Forecast Database Table [Time]. I dont see how this is happening. I added a debug line in the area in V4.33.3 so it you could try it again with debug enabled then maybe I see something from it.

              Comment


                #8
                The debug lines

                2005-03-19 01:02:44~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=T_Nappali
                2005-03-19 01:02:45~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=5, Field=Foldszint_Occupancy
                2005-03-19 01:02:45~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=5, Field=Padlofutes
                2005-03-19 01:02:45~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=5, Field=Radiatorfutes
                2005-03-19 01:02:45~!~mcsTemperature Debug~!~Database(1)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=Time, Table=Forecast, DeviceType=0, Field=V_Temp
                2005-03-19 01:02:45~!~mcsTemperature Debug~!~DrawDigital Query=SELECT SampleDate, Discrete FROM Foldszint_Occupancy WHERE SampleDate >= #2005-03-16 2:00# AND SampleDate < #2005-03-19 2:00# ORDER BY SampleDate
                2005-03-19 01:02:45~!~mcsTemperature Debug~!~DrawDigital Query=SELECT SampleDate, Discrete FROM Padlofutes WHERE SampleDate >= #2005-03-16 2:00# AND SampleDate < #2005-03-19 2:00# ORDER BY SampleDate
                2005-03-19 01:02:46~!~mcsTemperature Debug~!~DrawDigital Query=SELECT SampleDate, Discrete FROM Radiatorfutes WHERE SampleDate >= #2005-03-16 2:00# AND SampleDate < #2005-03-19 2:00# ORDER BY SampleDate
                2005-03-19 01:02:46~!~mcsTemperature Debug~!~DrawGraph Query=SELECT (Format([SampleDate],"yyyy/mm/dd hh:00")) AS SampleDate, Avg(T_Nappali) AS Temp FROM Temperature WHERE T_Nappali<>0 AND SampleDate >= #2005-03-16 2:00# AND SampleDate < #2005-03-19 2:00# GROUP BY (Format([SampleDate],"yyyy/mm/dd hh:00")) ORDER BY (Format([SampleDate],"yyyy/mm/dd hh:00"))
                2005-03-19 01:02:47~!~mcsTemperature Debug~!~DrawGraph Query=SELECT (Format([Time],"yyyy/mm/dd hh:00")) AS SampleDate, Avg(V_Temp) AS Temp FROM Forecast WHERE V_Temp<>0 AND Time >= #2005-03-16 2:00# AND Time < #2005-03-19 2:00# GROUP BY (Format([Time],"yyyy/mm/dd hh:00")) ORDER BY (Format([Time],"yyyy/mm/dd hh:00"))
                2005-03-19 01:02:47~!~mcsTemperature Debug~!~Chart SQL=SELECT (Format([SampleDate],"yyyy/mm/dd hh:00")) AS StartDate, Avg(T_Nappali) AS Q1 FROM Temperature WHERE SampleDate >= #2005-03-16 2:00# AND SampleDate < #2005-03-19 2:00# GROUP BY (Format([SampleDate],"yyyy/mm/dd hh:00"))
                2005-03-19 01:02:47~!~mcsTemperature Debug~!~Chart SQL2=SELECT Time AS StartDate, V_Temp AS Q5 FROM Forecast WHERE Time >= #2005-03-16 2:00# AND Time < #2005-03-19 2:00#
                2005-03-19 01:02:47~!~mcsTemperature Debug~!~Chart SQL3=
                2005-03-19 01:02:48~!~mcsTemperature Debug~!~Data Elements=72, Data Names=2
                2005-03-19 01:02:48~!~mcsTemperature Debug~!~X Axis Data Completed
                2005-03-19 01:02:48~!~mcsTemperature Debug~!~Y Axis Data Completed

                But now release no error. Ok no last draw actions null to one event too

                Comment


                  #9
                  Charts

                  the 6 hours and the 24 hours
                  Attached Files

                  Comment


                    #10
                    The durations are computed at each transition. The last sample in the database will have a null duration. The 6 hour chart will show the last recorded sample's level. The 24 and other charts will not show the last sample because it's duration will not be known until it is no longer the last sample recorded. This is just something we need to live with now. It might be possible to process the last sample separately, but it is not now implemented as a special case.

                    Comment


                      #11
                      4.34.0

                      the discrete lines drwing 0 value all time

                      2005-03-27 12:26:05~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=T_Nappali
                      2005-03-27 12:26:06~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=5, Field=Foldszint_Occupancy
                      2005-03-27 12:26:06~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=5, Field=Padlofutes
                      2005-03-27 12:26:06~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=5, Field=Radiatorfutes
                      2005-03-27 12:26:07~!~mcsTemperature Debug~!~Database(1)=C:\Program Files\HomeSeer\\Data\mcsTemperature.mdb, DateField=Time, Table=Forecast, DeviceType=0, Field=V_Temp
                      2005-03-27 12:26:07~!~mcsTemperature Debug~!~DrawDigital Query=SELECT SampleDate, Discrete FROM Foldszint_Occupancy WHERE SampleDate >= #2005-03-20 13:00# AND SampleDate < #2005-03-27 13:00# ORDER BY SampleDate
                      2005-03-27 12:26:07~!~mcsTemperature Debug~!~DrawDigital Query=SELECT SampleDate, Discrete FROM Padlofutes WHERE SampleDate >= #2005-03-20 13:00# AND SampleDate < #2005-03-27 13:00# ORDER BY SampleDate
                      2005-03-27 12:26:07~!~mcsTemperature Debug~!~DrawDigital Query=SELECT SampleDate, Discrete FROM Radiatorfutes WHERE SampleDate >= #2005-03-20 13:00# AND SampleDate < #2005-03-27 13:00# ORDER BY SampleDate
                      2005-03-27 12:26:07~!~mcsTemperature Debug~!~DrawGraph Query=SELECT (Format([SampleDate],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([SampleDate])/30)*30),2) ) AS SampleDate, Avg(T_Nappali) AS Temp FROM Temperature WHERE T_Nappali<>0 AND SampleDate >= #2005-03-20 13:00# AND SampleDate < #2005-03-27 13:00# GROUP BY (Format([SampleDate],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([SampleDate])/30)*30),2) ) ORDER BY (Format([SampleDate],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([SampleDate])/30)*30),2) )
                      2005-03-27 12:26:09~!~mcsTemperature Debug~!~DrawGraph Query=SELECT (Format([Time],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([Time])/30)*30),2) ) AS SampleDate, Avg(V_Temp) AS Temp FROM Forecast WHERE V_Temp<>0 AND Time >= #2005-03-20 13:00# AND Time < #2005-03-27 13:00# GROUP BY (Format([Time],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([Time])/30)*30),2) ) ORDER BY (Format([Time],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([Time])/30)*30),2) )
                      2005-03-27 12:26:09~!~mcsTemperature Debug~!~Chart SQL=SELECT (Format([SampleDate],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([SampleDate])/30)*30),2) ) AS StartDate, Avg(T_Nappali) AS Q1 FROM Temperature WHERE SampleDate >= #2005-03-20 13:00# AND SampleDate < #2005-03-27 13:00# GROUP BY (Format([SampleDate],"yyyy/mm/dd hh:") & Right("00" & CStr(Int(Minute([SampleDate])/30)*30),2) )
                      2005-03-27 12:26:09~!~mcsTemperature Debug~!~Chart SQL2=SELECT Time AS StartDate, V_Temp AS Q5 FROM Forecast WHERE Time >= #2005-03-20 13:00# AND Time < #2005-03-27 13:00#
                      2005-03-27 12:26:09~!~mcsTemperature Debug~!~Chart SQL3=
                      2005-03-27 12:26:10~!~mcsTemperature Debug~!~Data Elements=336, Data Names=2
                      2005-03-27 12:26:11~!~mcsTemperature Debug~!~X Axis Data Completed
                      2005-03-27 12:26:11~!~mcsTemperature~!~PopulateBarChart on line 380 Subscript out of range
                      2005-03-27 12:26:11~!~mcsTemperature~!~PopulateBarChart on line 380 Subscript out of range
                      2005-03-27 12:26:11~!~mcsTemperature Debug~!~Y Axis Data Completed
                      Attached Files

                      Comment


                        #12
                        I can take care of the out-of-range error message. I suspect the lack of digital display is due to the other negative values on the chart. Can you confirm this by selecting a different period or excluding the line that have negative values.

                        Comment


                          #13
                          this my 2 discrete table one from:
                          sub main()
                          set mcs = hs.Plugin("mcsTemperature")
                          mcs.StoreDiscrete "Foldszint_Occupancy", 1
                          end sub
                          and second:
                          sub main()
                          set mcs = hs.Plugin("mcsTemperature")
                          mcs.StoreDiscrete "Padlofutes", 1
                          end sub
                          Attached Files

                          Comment


                            #14
                            The occupancy table has a space rather than an uderscore in its name so that will cause problems. I believe the basic discrete charting is working fine and the problem that you are seeing relates to showing the discretes in combination with analog data that has negative values. I use the analog data magnitude for the scaling of discrete so there may be an interaction there. I would just like you to confirm that by changing the period or changing the analog data selections so that only positive data is displayed. I would like to isolate as much as possible the potential causes of the problem before I dig into it.

                            Comment


                              #15
                              Without all analog data the week chart is empty
                              without negative analog data, but looking internal thermostat data (pos values) the week chart this
                              Foldszint occ:Now 1, Avg 26, Min 2:41:40/d, Max 24:00:00/d
                              Attached Files

                              Comment

                              Working...
                              X