HTTP virtual input for getting text

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

    #1

    HTTP virtual input for getting text

    Dear

    I am trying to obtain text from a web service which returns:

    <current><city id="2783308" name="Zedelgem"><coord lon="3.14" lat="51.14"></coord><country>BE</country><sun rise="2016-06-06T03:34:06" set="2016-06-06T19:58:56"></sun></city><temperature value="291.81" min="286.15" max="297.04" unit="kelvin"></temperature><humidity value="82" unit="%"></humidity><pressure value="1022" unit="hPa"></pressure><wind><speed value="6.2" name="Moderate breeze"></speed><gusts></gusts><direction value="20" code="NNE" name="North-northeast"></direction></wind><clouds value="20" name="few clouds"></clouds><visibility></visibility><precipitation mode="no"></precipitation><weather number="801" value="licht bewolkt" icon="02d"></weather><lastupdate value="2016-06-06T11:13:48"></lastupdate></current>


    I am able to get the weather number by requesting command <weather number ="\v. I would like to obtain the value but don't know how to tackle this. I am noticing 2 issues:

    * value is occuring multiple times in the XML text

    * The value is a text and I am only succeeding in getting values from this XML by using the "Virtual HTTP input"

    How do I solve this?

    Thanks Pieter
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    #2
    If I'm not mistaken - but I hope someone can tell me wrong - HTTP input cannot take text strings. The only way I know of to get text strings into the Loxone is using option 3 in as on this page http://www.loxone.com/enen/service/d...irtual-io.html
    I use this option to send string regarding multi-room audio (track info, etc) to my Loxone. The problem is that some other device must send it to the Loxone server.

    If it behaves like UDP inputs, then it is possible to get a single character from the textstring. If you find a character that is unique, then it is possible to use this in combination with a status block. This is done here (the google doc file): http://www.loxwiki.eu/pages/viewpage...?pageId=918116
    It is in German, but if you go to the section "Playerstatus (Playing, Paused, Stopped, Off)", you will see the example. The string that they want to read is either "Playing", "Paused", "Stopped" or "Off". In the command, \1 is used to skip one character, as the second character is enough to identify which of the 4 strings it is. The ascii value of the character is then used with a status block to translate it back to text.

    Hope this helps somewhat, or at least gets other people to chip in their knowledge...

    Kommentar


    • Gast
      Gast kommentierte
      Kommentar bearbeiten
      HI JV, can't you get the entire textstring? I'm trying to do the same thing from my squeezebox Artist and Titel, but need the entire text string and not just a single character
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    #3
    For the Squeezebox, there is a whole topic here:
    Hier findest du eine Anleitung, wie du den Logitech Media Server (LMS) bzw. Squeezebox Server in die Loxone einbinden kannst. https://docs.google.com/document/d/1..

    It is in German, but the google doc is so well structured that it should be understandable.
    From what I understand, there is a plugin for Max2Play that can send strings to a Squeezebox, using the xpl or xap protocol to get the info from LMS and then send it to the Loxone using the virtual io system I linked to.

    I did it differently: as my Logitech Music Server is running on Windows, and I already use EventGhost to control things, I use the (new) xap plugin for EventGhost to receive the strings from LMS and send them using eventghost to Loxone. The way of doing it is the same as what others do with Max2Play, but my approach requires a windows up and running (which is ok if it is you LMS, that one also has to be up and running).

    Kommentar

    Lädt...