HMI Pad Forums Main Forums HMI Pad Support REST Connectors

This topic contains 7 replies, has 2 voices, and was last updated by  Grzegorz 5 months, 1 week ago. This post has been viewed 832 times

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #21873

    Grzegorz
    Participant

      Hi,

      I need to use my REST devices with HMIDraw, for example:

      My status of light is available from Webbrowser using:

      Http://192.168.1.4/api/light/state

      How to use it in HMIDraw REST Connectors

      I have:

      BaseApiUrl “http://192.168.1.4″
      Method “GET”
      restPath “/api”
      httpHeaders – {what here write?}
      requestBody – {what here write?}

      thanks for any ahelp

      #21874

      Grzegorz
      Participant

        Other questions,
        how to convert in HMIDraw str.HEX “ff” To DEC.value 255?

        thanks

        #21877

        gregM
        Participant

          I don’t quite understand what you’re trying to convert?

          #21879

          gregM
          Participant

            I have a simple example file on using REST with Hue lights.
            I can email it to you if you use the Contact Us Form to send me a email.

            #21880

            Grzegorz
            Participant

              Hi @gregM

              How to convert HEX value “00″…”FF” to DEC 0..255 integer?

              I use value.to_i but alway result is 0.

              With REST Connectors problem already solved.

              • This reply was modified 5 months, 1 week ago by  Grzegorz.
              #21882

              gregM
              Participant

                you will need to prefix “ff” with “0x”

                #21883

                Grzegorz
                Participant

                  Hi,

                  I read from REST device:

                  BleBox_LED1.response.values[0]["currentColor"] result is a string “0A”

                  I need convert this to DEC 10 integer, have U a example

                  #21884

                  Grzegorz
                  Participant

                    OK,

                    I have solved this
                    correct is:
                    (“0x”+(BleBox_LED1.response.values[0]["currentColor"])).to_i
                    result is in DEC integer.

                  Viewing 8 posts - 1 through 8 (of 8 total)

                  You must be logged in to reply to this topic.

                  Copyright © SweetWilliam, S.L 2009-2013. All rights reserved.
                  Science and Technology Park of the University of Girona, Emili Grahit, 91 (NarcĂ­s Monturiol building, Office P3-B03) 17003-Girona. Phone +34972183244