Announcement

Collapse
No announcement yet.

Not getting change on status devices

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

    Not getting change on status devices

    The following actions don't seem to change my device either in the device screen or in the graphing page. Used to work a while ago under 1.7.

    Any ideas what I have wrong in this?

    ---------------------------------------------------------
    Run script: &hs.GetPlugins("mcsTemperature").StoreDiscrete "tblFlagWestFan", 1

    Device Command: Roof Ventilator MCS Flag Attic West On

    #2
    I looked at the source and there is no reason that the data should not be written to the database. The routine used to store data is the same one as used internally to record changes in discrete states and the only difference is the interface through HS to pass the two parameters to the function.

    This function will never update a device status in HS, but it should store data into the database so when charted it can be observed.

    Comment


      #3
      I don't have this setup right and it may be I am thinking HS1.7 days, not how it works now, as I read through the manual. It looks like there should be a separate table for each discrete sensor? My sql is failing due to bad setup from what I can tell.

      How is it 'supposed' to look so I can correct this?

      And if I need tables for each of these flags, what is the setup of those tables?

      Devices on device page are set up as

      Roof Ventilator MCS Flag Attic West, Status, , , R29, tblFlagWestFan
      Roof Ventilator MCS Flag Attic East, Status, , , R30, tblFlagEastFan

      In database mcstemperature, there is a column for tblFlagEastFan and tblFlagWestFan in the temperature table.


      Run script: &hs.Plugin("mcsTemperature").StoreDiscrete "tblFlagEastFan", 1

      Device Command: Roof Ventilator MCS Flag Attic East On

      Results in

      2/17/2008 1:27:45 PM ~!~Info~!~Running script statement immediately: &hs.GetPlugins("mcsTemperature").StoreDiscrete "tblFlagEastFan", 1
      2/17/2008 1:27:45 PM ~!~mcsTemperature Debug~!~LogDiscrete tblFlagEastFan, UseDatabase=True, databaseSchemaIsBeingChanged=False
      2/17/2008 1:27:45 PM ~!~mcsTemperature Debug~!~Log Discrete INSERT INTO tblFlagEastFan (SampleDate,Discrete) SELECT #2008-02-17 1:27:45 PM# AS QT,1 AS Q1
      2/17/2008 1:27:45 PM ~!~mcsTemperature~!~ Log_Discrete: INSERT INTO tblFlagEastFan (SampleDate,Discrete) SELECT #2008-02-17 1:27:45 PM# AS QT,1 AS Q1 on line 250 Could not find output table 'tblFlagEastFan'.
      2/17/2008 1:27:45 PM ~!~Info~!~Device: Roof Ventilator MCS Flag Attic East (R30) ON
      2/17/2008 1:27:45 PM ~!~mcsTemperature Debug~!~setIO R30 from 0 to 2, brightness=0
      2/17/2008 1:27:45 PM ~!~mcsTemperature Debug~!~setDevice R30 from 2 to 2


      The device status string still says "Control Inactive" but shows an update time of Today 12:45:59 PM.

      The graphing screen shows

      Roof Ventilator MCS Flag Attic West 0.0 0.0 0.0 0.0
      Roof Ventilator MCS Flag Attic East 0.0 0.0 0.0 0.0

      So I can't tell if the flag was set to 1 from that.

      The database recorded item with a time of 2/17/2008 12:52:13 PM shows the column tblFlagEastFan with a value of 0, not 1 as expected.

      Comment


        #4
        I did find a table in the old 1.7 stuff that was for the fan flag. I have added a table for each fan status item and I did see data recorded so it's a step forward.

        My graphs still don't show data however. I did notice 2000 as the year in the queries. Doesn't seem right. Seems like it should reflect current periods.

        Any ideas?

        Log activity attached.

        Comment


          #5
          I'm not certain what all you are showing in the prior email, but I can address the table and discrete. mcsTemperature creates a table for each sensor type switch or relay selected for database storage/charting. I've attached a database that shows the layout of the discrete table.

          Device types switch and relay are coded as 10 and 11 respectively. These are remembered in mcsTemperature.ini in the [Database] section such as the relay associated with device code P1 and stored in database table sP1.

          [Database]
          P1="sP1,11,1"
          Attached Files

          Comment


            #6
            Thanks for the sampe database. I was able to verify some things.

            Question:

            From this I gather there should be an sP1 table but not a sP1 column in the temperatures table?

            Mine are set as follows in the ini



            [Database]
            R29="tblFlagWestFan,25,1"
            R30="tblFlagEastFan,25,1"

            Comment


              #7
              Does the added columns (that maybe don't belong in that table) cause me to not get graphs as my query seems to start at 2000 instead of some date much closer?


              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=2, Field=sh480000000DC8C126
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=sEE0000000D42AF26
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=s490008001F236E10
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=sE600080038380710
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=sC70008001EFFF410
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=s270008001F35B310
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=0, Field=s480000000DC8C126
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=2, Field=shEE0000000D42AF26
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=2, Field=BasementHumidity
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=7, Field=tblFlagWestFan
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~Database(0)=C:\Program Files\HomeSeer 2\mcsTemperature.mdb, DateField=SampleDate, Table=Temperature, DeviceType=7, Field=tblFlagEastFan
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(tblFlagWestFan) AS Temp FROM Temperature WHERE tblFlagWestFan<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(tblFlagEastFan) AS Temp FROM Temperature WHERE tblFlagEastFan<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(sh480000000DC8C126) AS Temp FROM Temperature WHERE sh480000000DC8C126<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:12 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(shEE0000000D42AF26) AS Temp FROM Temperature WHERE shEE0000000D42AF26<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:13 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(BasementHumidity) AS Temp FROM Temperature WHERE BasementHumidity<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:13 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(sEE0000000D42AF26) AS Temp FROM Temperature WHERE sEE0000000D42AF26<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:13 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(s490008001F236E10) AS Temp FROM Temperature WHERE s490008001F236E10<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:13 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(sE600080038380710) AS Temp FROM Temperature WHERE sE600080038380710<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:13 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(sC70008001EFFF410) AS Temp FROM Temperature WHERE sC70008001EFFF410<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(s270008001F35B310) AS Temp FROM Temperature WHERE s270008001F35B310<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:14 PM ~!~DooNetwork Info~!~Computer_Room Bladerunner WAN Modem is connected
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~DrawGraph Query=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS SampleDate, Avg(s480000000DC8C126) AS Temp FROM Temperature WHERE s480000000DC8C126<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd")) ORDER BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~SensorCount=11
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~Chart SQL=SELECT "2000/" & (Format([SampleDate],"mm/dd")) AS StartDate, Avg(sh480000000DC8C126) AS Q1, Avg(sEE0000000D42AF26) AS Q2, Avg(s490008001F236E10) AS Q3, Avg(sE600080038380710) AS Q4, Avg(sC70008001EFFF410) AS Q5, Avg(s270008001F35B310) AS Q6, Avg(s480000000DC8C126) AS Q7, Avg(shEE0000000D42AF26) AS Q8, Avg(BasementHumidity) AS Q9, Avg(tblFlagWestFan) AS Q10, Avg(tblFlagEastFan) AS Q11 FROM Temperature WHERE sh480000000DC8C126<>0 AND sEE0000000D42AF26<>0 AND s490008001F236E10<>0 AND sE600080038380710<>0 AND sC70008001EFFF410<>0 AND s270008001F35B310<>0 AND s480000000DC8C126<>0 AND shEE0000000D42AF26<>0 AND BasementHumidity<>0 AND tblFlagWestFan<>0 AND tblFlagEastFan<>0 GROUP BY "2000/" & (Format([SampleDate],"mm/dd"))
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~Chart SQL2=
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~Chart SQL3=
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~X Axis Data Completed
              2/28/2008 7:48:14 PM ~!~mcsTemperature Debug~!~Y Axis Data Completed, SomeData=False

              Comment


                #8
                bump

                Comment


                  #9
                  The extra fields make no difference.

                  It looks as if you are trying to use the "Daily", "Weekly" etc periods. These try to aggrregate all the data collected since 2000. You likley will want 24hr, 72hr etc time scales that use only the more recent data.

                  Comment


                    #10
                    Thank you! That helps a lot. I was able to chart data.

                    Now I need to play around with those 0 - 1 status flags and see if I can get them working and reporting to the graphs. I really needed the basics working.

                    I will have to read about the end field. Not sure how to set it.

                    Any way to specify a start of a reporting range, end, and period?

                    Comment


                      #11
                      The End date/time is normally left blank and in this case the chart will be based upon the most recent period of time. If the page is left up in the browser then it will update forever and move the X axis so it is always showing current data.

                      A specific end date can also be entered were only the date and hour have significance. For example "2/15/2008 10" would be entered to draw a chart for data ending at 10 AM on 2/15/2008.

                      The duration is the pulldown that provides ranges in commonly used periods of time. I think mcsTemperature starts at 6 hours and will go up to 1 year.

                      One the end and duration are specified then the start is automatic. There is no provision to enter other combinations of start - duration - end . Only end and duration.

                      Comment


                        #12
                        Now I am getting line charts so this is a big improvement. And I see your reasoning on the parms. Makes sense.

                        I am not getting any data on my status indicators for my attic fans. They appear to be selecting from the temperature table, not their own tables so I must still have a setup issue. I deleted the flag columns from the temperature table as you said it didn't matter.

                        How do I get it to 'see' the attic fan tables ?

                        Log attached.
                        Attached Files

                        Comment


                          #13
                          Discretes are managed in their own tables where only the transition times and values are stored. This is an optimization to reduce the amout of data this is being stored. Discretes are the sensor types of relay and switch. Change your types for R29 and R30 to be either of these two. If R29 is an output device that can be controlled then select relay. If is is a status feedback then select switch.

                          Comment


                            #14
                            Yes!
                            That was it. I would not have thought to use 'switch' instead of 'status'.

                            Comment

                            Working...
                            X