Announcement

Collapse
No announcement yet.

Read XML-File

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

  • #16
    Hello mrhappy,

    you are my hero

    Code:
    3) Do you definately have the line at the top of the script 'Imports System.XML'?
    I've had the line on the bottom on settings.ini

    Now I 've changed to the top and what shall I say:

    It works. The device called "x1" now shows the currently value of the valve, at this time 0% (0.0000000)

    That was a great step forward.

    Now I'll make some experiments with it to gather experience.

    I recall you later to advise my progress.


    Bye


    Michael
    Last edited by Darklord; September 17th, 2010, 11:54 AM.

    Comment


    • #17
      Thats a relief its working, I was worried there...if you need anything else let me know and I can try to help.
      My Plugins:

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

      Comment


      • #18
        Hello,

        sorry for my late reply but I was very busy last weeks.

        After testing this script I'm ready for the next step.
        It's easy (for me) to get different values like "Temp Soll" or "Ventilstatus" and all the other values when I write an own script for each value.

        Now I want to query most of this values from all my rooms (like Bath-;Livingroom and so on) with only one script.

        How can I do this?
        A simple example should help me.

        Thanks for your support.

        Bye

        Michael

        Comment


        • #19
          Glad its still working OK for you, you should be able to do this as many times as you want;

          Imports System.XML

          Sub Main(ByVal Data As String)

          Dim ValXML As New XmlDocument
          Dim ValXMLNodeList As XmlNodeList
          Dim ValXMLNode As XmlNode
          Dim FValue As Decimal

          ValXML.Load("http://XX.YYY.XY.XY/config/xmlapi/statelist.cgi")

          ValXMLNodeList = ValXML.SelectNodes("//datapoint[@name='Ventilstellung Kueche']")

          For Each ValXMLNode In ValXMLNodeList

          FValue = System.Math.Round(CDec(ValXMLNode.Attributes("value").Value) , 2)

          hs.setdevicevalue("X1", FValue * 100)
          hs.setdevicestring("X1", "Value Is: " & ValXMLNode.Attributes("value").Value)

          Next

          ValXMLNodeList = ValXML.SelectNodes("//datapoint[@name='Temp Max Kueche']")

          For Each ValXMLNode In ValXMLNodeList

          FValue = System.Math.Round(CDec(ValXMLNode.Attributes("value").Value) , 2)

          hs.setdevicevalue("X2", FValue * 100)
          hs.setdevicestring("X2", "Value Is: " & ValXMLNode.Attributes("value").Value)

          Next

          End Sub
          IE you do multiple select nodes and as many as you want to do, there are perhaps more efficient ways of doing it but that works when i've done it before...
          My Plugins:

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

          Comment


          • #20
            Hi mrhappy,

            this way works. I thought this will be more difficult but it was very simple.
            Thank You for Your assistance.

            My next two steps are to find a way to save this data and to create flow charts. I'll search the forum now to find some anserws.

            Any ideas for some keywords?

            Have a nice day


            Michael

            Comment


            • #21
              Sorry I have no idea on how to produce flow charts from the data, you might have to use some sort of external application to do that - there are a few ways to produce graphs though.

              One thought to some sort of flow chart would be to produce an image in Visio or similar, create a HTML web page and then build a table over the top of the image that a table cell was on top of the flow chart boxes, you could then using some ASP commands display the device strings inside these boxes. Hope i've explained that correctly but whilst it may be one of the easier ways to do it the charts are going to be quite fixed.

              To save the document you are working on there is a .save method so you could add ValXML.Save("C:\hs.xml") line at the end of the script. That would save it in the initial format to how it was downloaded.
              My Plugins:

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

              Comment

              Working...
              X