Announcement

Collapse
No announcement yet.

TED Pro Script variables

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

  • TED Pro Script variables

    Moving to HS3 is challenging !
    I must be the only guy still using TED. I have the TED Pro? TED 6000? version with 16 spyder sensors.

    In HS2:
    for i = 1 to 16
    xmlfile = "http://xyz.com/history/export.xml?T=2&D=1&M="&i&"&C=1"
    XMLDoc.Load(xmlfile)
    ....select node stuff...here
    next

    This loaded each of my 16 spyder values (T=2 for hours, D=1 for Spyder Devices, M= Which Spyder , C=Number of records to return.

    I then assigned the values to Devices & recorded them to a database. (Challenges for another day, today writing to the log will suffice)

    In HS3 this line is giving me fits.

    The problem is in the "i" variable, if I manually insert an integer (ie 3) in the M= spot, I do get the spyder#3 watt value returned 16 times (3 is my water heater)
    I have tried every combination of ("&i&") I can think of.
    How do you insert "i" into the path?

    Thanks,
    Paul

    BTW I have bought some of the Aeon Z-wave devices & am finding them to be more accurate. I am hoping to compare the data from both & maybe fine tune my TED measurements.

  • #2
    Originally posted by Pnord View Post
    Moving to HS3 is challenging !
    I must be the only guy still using TED. I have the TED Pro? TED 6000? version with 16 spyder sensors.

    In HS2:
    for i = 1 to 16
    xmlfile = "http://xyz.com/history/export.xml?T=2&D=1&M="&i&"&C=1"
    XMLDoc.Load(xmlfile)
    ....select node stuff...here
    next

    This loaded each of my 16 spyder values (T=2 for hours, D=1 for Spyder Devices, M= Which Spyder , C=Number of records to return.

    I then assigned the values to Devices & recorded them to a database. (Challenges for another day, today writing to the log will suffice)

    In HS3 this line is giving me fits.

    The problem is in the "i" variable, if I manually insert an integer (ie 3) in the M= spot, I do get the spyder#3 watt value returned 16 times (3 is my water heater)
    I have tried every combination of ("&i&") I can think of.
    How do you insert "i" into the path?

    Thanks,
    Paul

    BTW I have bought some of the Aeon Z-wave devices & am finding them to be more accurate. I am hoping to compare the data from both & maybe fine tune my TED measurements.
    have you tried

    VBScript:

    Code:
    & CStr(i) &
    or

    VB.NET

    Code:
    & Convert.ToString(i) &

    Cheers
    Al
    HS 3.0.0.532: 1963 Devices 1141 Events
    Z-Wave 3.0.1.261: 122 Nodes on one Z-Net

    Comment


    • #3
      It should work looking on the face of it, just try separating by a space (M=" & i & "&C=) but it should still work regardless, what actually do you get when it is run? It could point to something else being wrong. Also try

      for i as byte = 1 to 16
      My Plugins:

      Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
      Yeelight 3P | Nanoleaf 3P

      Comment


      • #4
        Works !!!
        I'm now recording all 16 values to hs.writelog
        All three of your suggestions , Convert.ToString(i), Cstr(i) & Spaces between everything M=" & i & "&C=1 worked


        Thanks for helping out old people.
        Paul

        Stay tuned to see how badly i can mess up the "adodb.connection"
        Last edited by Pnord; January 6th, 2017, 09:46 PM.

        Comment


        • #5
          Return to TED

          Hi,
          First of all, thanks Sparkman & Mr Happy for your help, it did the trick !
          I've returned to this TED project fun with all new ideas !
          AND new problems.
          I went to the TED support forum page & asked:

          I have a VB script running in Homeseer reading the TED XML values.

          For the MTU:
          TEDAddress = TEDURL & "/history/export.xml?D=0&M=0&C=1&T=3"
          TEDXML.Load(TEDAddress)
          TEDNode = TEDXml.SelectSingleNode("HISTORY/HOUR/POWER").InnerText

          and similarly for the Spyders i = 1 to 16:
          TEDAddress = TedURL & "/history/export.xml?D=1&M=" & i & "&C=1&T=2"
          TEDXML.Load(TEDAddress)
          TEDNode = TEDXml.SelectSingleNode("HISTORY/HOUR/POWER").InnerText

          The above DOES work great !!!! For HOUR data. Now I want to get minute data.

          I should (in my mind) be able to adjust the T= parameter down one to T=2(MTU) or T=1 for spyder, change the "HOUR" to "MINUTE"
          in the XML read and have that work also, NOPE!. I've tried several combinations and the above HOUR script is the only
          combo that I can make work. The XML (viewed in a browser with with different D,M,T & C values set) works for any value I enter & the tree structure appears the same for any T= except the <HOUR>tag changes & becomes <SECOND> or <MINUTE> etc.
          Whats the trick?
          The reply I got from them was:
          I would agree that what you are doing should produce the results you expect. I just wonder if the TEDXML.Load() function is doing something to the parameters passed to it. I don't think that this is a TED problem, and you may want to repost your question in a Homeseer support forum.
          So, here i am. once again missing a piece.
          Help,
          Paul

          P.S. I've got a TED PRO with 16 Spyder CT's
          D = Device type ( 0 for Main MTU, 1 for Spyder units)
          M = Device number
          T = Time 1= second, 2 = minute etc. (offset by 1 for for D = 1 or 2)
          C = count, number of records returned

          Comment

          Working...
          X