Keine Ankündigung bisher.

sending HTTP PUT commands using virtual output

  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • sending HTTP PUT commands using virtual output


    I have a problem with the virtual output command. Everything works fine when I use fiddler and assembly my command. But when I want to use Loxone to do this, it's not working. I grabbed what loxone is sending and there seems to be some syntax error in what I put there.
    command I am sending:
    content-length: 13

    body: {"on":true}

    I want to learn how to do this, since these lights are not the only thing I want to create in this way. I also want to link with my raspberry in this manner.

    what I did in loxone:
    1) I set the address accordingly in the virtual Output
    2) I create a command for this virtual output with the settings:
    Command for ON -> {"on":true}
    HTTP method for ON -> PUT
    Command for OFF -> {"on":false}
    HTTP method for OFF -> PUT

    where do I set the headers? if I sniff with Loxone logger I see the attached image. content-type: text/plain charset=utf-8 I think this is the mistake

    I appreciate your feedback.

    Kind regards,
    Angehängte Dateien

  • #2
    Try it with the POST syntax, maybe it works:

    PS: Are you sure you really need a PUT not a POST? PUT is uncommon for simple APIs.
    Zuletzt geändert von Christian Fenzl; vor einer Woche.
    PN/PM: Ich bevorzuge die Beantwortung von Fragen in öffentlichen Threads, wo andere mithelfen und mitprofitieren können. Herzlichen Dank!


    • #3
      For this project I had to use PUT.
      After another trial and error session today, I found out how I have to configure my loxone:
      in the virtual output:
      in the output command:
      HTTP extensions for ON : host:\r\nContent-Type: application/json
      HTTP POST command for ON : {"on": true}
      HTTP method for ON : PUT
      same for OFF...

      This makes my light turn on and off. I still have 1 problem where it sends the ON when I turn it off but I will look into that some other day.