Announcement

Collapse
No announcement yet.

Add non Temp 'Stuff' to the graphs

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

    Add non Temp 'Stuff' to the graphs

    I would like to be able to graph the status of my roof fans on the temp chart to see their affect in temps. Any way to do this?

    SteveP

    I Pledge Allegiance to the flag of the United States of America and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.
    The REAL Pledge of Allegiance

    #2
    If the fan status or fan control is managed by mcsTemperature then it is already available for graphing. You just need to setup a display group that includes it.

    There is a script interface that will allow you to store the on/off status of a device. Bill Walton uses this to store his motion sensor transitions. There are a couple examples posted in the threads and it is documented in the manual.

    CreateDiscrete and StoreDiscrete are the script methods of interest.

    Comment


      #3
      so you should be able to do it. For the motion sensors, I use Custom Action Code in DooMotion to update a digital device in mcsTemperature, but the garage door uses two events with tiny scripts attached:
      <pre class="ip-ubbcode-code-pre">
      sub main()
      set mcs = hs.Plugin("mcsTemperature")
      mcs.StoreDiscrete "GarageOverheadDoor", 1
      end sub </pre>
      <pre class="ip-ubbcode-code-pre">
      sub main()
      set mcs = hs.Plugin("mcsTemperature")
      mcs.StoreDiscrete "GarageOverheadDoor", 0
      end sub </pre>

      You need to create a discrete device on the Discrete(x) tab in mcsTemperature, and then use its table name in a script like the ones above to record ON and OFF (1 and 0 in the scripts) transitions. The device should appear in the Trend Groups page and you can add it to a chart. The only problem I ran into was getting the scale of the discrete device (values are just "0" and "1") to work on a chart of analog values like temperatures. You might have to start and stop HS a couple of times, and perhaps edit the virtual device that mcsTemperature creates, to get the device name to be reasonable. The actual virtual device isn't used for anything except to trigger creation of the table and provide a hook for the display in mcsTemperature, so in HS its value will appear "Unknown" but that doesn't matter since there's a table in the Temperature database that has the values to display.

      --
      Bill

      Comment


        #4
        Bill, thanks for the elaboration.

        The design intent is to draw discretes at 20% of full scale unless only discretes are displayed then it is at 100%.

        You should also be able to store directly out of the event rather than needing a small script. For example:

        <pre class="ip-ubbcode-code-pre">

        &hs.GetPlugins("mcsTemperature").StoreDiscrete "GarageOverheadDoor", 1
        </pre>

        Similarily if you have a device for which status changes on/off based upon the discrete then you can take advantage of the deviceStatus (2=on, 3-off) and use a single event. The problem area is 17=unknown, so you cannot let it take on that state.

        <pre class="ip-ubbcode-code-pre">
        &hs.GetPlugins("mcsTemperature").StoreDiscrete "GarageOverheadDoor", 3-hs.DeviceStatus("A1")
        </pre>

        Comment


          #5
          I got it working now. Seems like a lot of work just to see indicators but it works. Got my flags on the charts page.

          thanks!

          SteveP

          I Pledge Allegiance to the flag of the United States of America and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.
          The REAL Pledge of Allegiance

          Comment


            #6
            <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR> You should also be able to store directly out of the event rather than needing a small script. <HR></BLOCKQUOTE>
            I should have known that. I was clipping a piece out of DooMotion Custom Action Code and didn't really pay attention to the fact that it didn't need to be two lines.

            --
            Bill

            Comment


              #7
              Not sure how you would want to handle this but....

              when I show the state of two attic fans on the chart, they overlay each other. It's not easy or possible to tell that both fans are on.

              Maybe we could do something like assigning values of 1, .98, .96, etc to devices so that they would show up as parallel lines in the charts. If this isn't a correct approach, that's fine. I would just like to have some way to allow multiple lines to show on the chart.

              SteveP

              I Pledge Allegiance to the flag of the United States of America and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.
              The REAL Pledge of Allegiance

              Comment


                #8
                I changed the algorithm to increase the discrete magnitude by 10% for each discrete drawn. Get it from 4.1.5

                Comment


                  #9
                  probably too much. You might be able to do as little as 2% and see both lines. The gap is pretty big right now.

                  I think you have a good solution to this. Now I can compare when the fans come on to how the temp drops.

                  SteveP

                  I Pledge Allegiance to the flag of the United States of America and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.
                  The REAL Pledge of Allegiance

                  Comment


                    #10
                    I put the scaling on the Display Tab of the setup page. 2% is the default in V4.1.6.

                    Comment


                      #11
                      Just noticed today that one of my fans still shows on in the graph. I see it is in the database as 0 and its variable r29 is off. so what does the graph use to determine whether to draw the line as 'on' or 'off'.

                      everything looks setup ok.

                      SteveP

                      I Pledge Allegiance to the flag of the United States of America and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.
                      The REAL Pledge of Allegiance

                      Comment


                        #12
                        The database stores the time when a transition occurs. Is it your report that the level of the discrete is not showing correctly when no transisitons occur during the entire display period. The virtual device value has no bearing on the graphs.

                        Comment


                          #13
                          transitions within the time period of the report or not.

                          I am setting it manually now on and off and I see it acting right in the chart.

                          SteveP

                          I Pledge Allegiance to the flag of the United States of America and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.
                          The REAL Pledge of Allegiance

                          Comment

                          Working...
                          X