HMI Pad › Forums › Main Forums › HMI Pad Support › REST Connectors
This topic contains 7 replies, has 2 voices, and was last updated by Grzegorz 3 years, 8 months ago. This post has been viewed 5247 times
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
Other questions, how to convert in HMIDraw str.HEX “ff” To DEC.value 255?
thanks
I don’t quite understand what you’re trying to convert?
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.
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.
you will need to prefix “ff” with “0x”
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
OK,
I have solved this correct is: (“0x”+(BleBox_LED1.response.values[0]["currentColor"])).to_i result is in DEC integer.
You must be logged in to reply to this topic.