How to correctly use the Virtual Output

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • Gast

    #1

    How to correctly use the Virtual Output

    Hi everyone,
    I'm a Loxone user for 5 years now and it was about time to make some changes to my configuration. I still have to integrate my heating system to the Loxone web client.
    I don't want Loxone to manage the heating, I just want it to display the room temperatures and be able to set target temperatures.

    I have a General Waterstage Air-Water heat pump system. The management system for this is Domuz multi-zone system.
    Webpage in Dutch, just to have some visuals about what the control system is: https://www.novaya.be/nl_be/producte...eregeling/105/

    I configured 2 Virtual HTTP inputs: Current Temp and Target Temp.
    Which are read out of an http call to an xml file. I can visualize those perfectly.

    The next step I am struggling with.
    I configured a regular Virtual Input, a slider, to select the desired temperature. As soon as this changes, it needs to send this change to a Virtual Output I created.
    (see attached slider image)

    Questions:
    1. can I just link the VI to the VQ? Or should something be in between the 2 components?
    2. what is the easiest way to debug/test the VQ?
    I've configured a Save HTTP reply option, but that page doesn't seem to do anything. I'm assuming that the Virtual Output isn't called right now.
    3. The VQ should send an XML POST command to a certain address: http://192.168.0.189/data/changes.xml
    In the XML that is sent, the temp value should be passed in. I'm trying this by passing <v> in the XML. This should work right?
    Code:
    <?xml version=”1.0” encoding=”UTF-8”?>\r\n<Devices>\r\n <Device>\r\n <ID>EZR012D08</ID>\r\n <HEATAREA nr="1">\r\n <T_TARGET><v></T_TARGET>\r\n </HEATAREA>\r\n </Device>\r\n</Devices>
    If you need any additional information, don't hesitate to ask.
  • Christian Fenzl
    Lebende Foren Legende
    • 31.08.2015
    • 11234

    #2
    At least, the extension for ON requires:
    Content-Type: application/xml

    Don't use "Digital output" when you want to send a value.

    Where have you grabbed the post data from? Is there an api documentation (link?)
    Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine

    Kommentar

    • Gast

      #3
      Yes, digital output is wrong. I changed it to analog now.
      I also attached a mailer to the Virtual Output to see if any change does something. I do get a mail when the analog value changes.

      I've tried with HTTP extensions for On set to Content-Type: application/xml and also tried with text/xml
      But I don't see the expected result.

      The Save HTTP reply also doesn't do anything. When trying to open the file, I get a 404.
      When checking with FTP, the file does not exist.
      I'm trying http://loxone-ip/user/common/changetemp.xml
      And http://loxone-ip/changetemp.xml


      I've tested outside Loxone by doing a POST with PowerShell to the same url, that works.


      I do have documentation about the REST service in Dutch. Here is that part translated to English:
      The data is forwarded via a standard http POST request, and the result of the edit is immediately visible in an xml document that is sent as feedback.
      It is also important to note that the contenttype of the POST request will must be “text/xml”, otherwise it may cause an error.
      In terms of content, the XML text that must be sent is limited to the parameter that must be updated and the identifier (ID) of the controller in question.
      A concrete example: if we want to change the target temperature in from 21.0 ° C to for example 25.0 ° C, then this means that we will forward the following XML text to
      the controller:
      <?xml version="1.0" encoding="UTF-8"?>
      <Devices>
      <Device>
      <ID>EZR011844</ID>
      <HEATAREA nr="1">
      <T_TARGET>25.0</T_TARGET>
      </HEATAREA>
      </Device>
      </Devices>

      And this is what I have configured:
      <?xml version=”1.0” encoding=”UTF-8”?>
      <Devices>
      <Device>
      <ID>EZR011844</ID>
      <HEATAREA nr="1">
      <T_TARGET><v.1></T_TARGET>
      </HEATAREA>
      </Device>
      </Devices>

      Could Loxone perhaps have issues with the quotes in the post command? Should I escape them?

      Kommentar

      • Gast

        #4
        Ok ... did some additional testing and it is working now. The quotes were a problem, I copied them from the documentation but they were ” instead of "
        So together with your suggested changes regarding the Content-Type, it works!
        Thanks

        Kommentar

        Lädt...