Page 1 of 1

PUT Method in HTTP Device

Posted: 05 Jun 2016 20:36
by darkyat
Dear ps,
Dear all,

I have seen several people hacking their Philips Hue Implementation with CodeDevices[1] while it could be fixed by implementing PUT into the HTTP Device.

POST and GET is unfortunately not sufficient for the Philips Hue API.

Accordingly to the Developer API we can only use "GET/POST/HEAD" and therefore I don't see any way to implement this myself: http://razberry.z-wave.me/docs/zwayDev.pdf (Page 40)

Happy to hear your feedback.

Regards,
darkyat

[1] https://forum.z-wave.me/viewtopic.php?f ... 66&p=58033

Re: PUT Method in HTTP Device

Posted: 31 Jul 2016 02:02
by PoltoS
Do you mean what we need to add PUT method to our http.request() ?

Re: PUT Method in HTTP Device

Posted: 11 Oct 2016 09:41
by klaasjoerg
Yes, I would also support to have a "PUT"-Method, because controlling HUE-Lamps do really need GET, POST AND PUT as a method.
Right now I have to call a universal bash-script with some CURL-Parsing doing this job.
e.g. system("/usr/local/bin/hue-universal-schalter.sh on %% 25000 254 4"); for a Codedevice.
However, this basically works, but the problem will be, if you have e.g. 10 HUE-Lamps in your home, calling a system-call will definetively slow down the whole system (Rasbperry pi3 in my case) a lot! If you are going to create/recall scenes with more than one hue (unless you do all the work within the bash-script, but that's not really nice to do....)

So, would be great to have HTTP PUT Methods in some places.

Re: PUT Method in HTTP Device

Posted: 15 Oct 2016 13:14
by PoltoS
Just checked, PUT is supported by http.request() as well as DELETE and HEAD. I'll update the doc once you confirm that it works for you.

Re: PUT Method in HTTP Device

Posted: 11 Nov 2016 01:02
by klaasjoerg
Hi, ok, but it's not really shown then in the app.
There is only GET and POST selectable...

Re: PUT Method in HTTP Device

Posted: 06 Jan 2017 19:24
by PoltoS
HTTP Device to support only GET and POST. And this makes sence. Because usually only those are used.

But those who uses PUT require real REST API, mens getter work with GET, setter with PUT. So a dedicated module should be done for such cases.

For Hue I would suggest a special module like: http://developer.z-wave.me/?uri=public#/web/apps/317

Re: PUT Method in HTTP Device

Posted: 07 Jan 2017 00:46
by klaasjoerg
In my case, it was only needed for hue control, which i curently handling with bash-shell-scripts and curl.
However, the Hue-Module you just mentioned, simply doesn't work currently. An error is thrown and effective not working at all. Unfortunately.

Re: PUT Method in HTTP Device

Posted: 08 Jan 2017 06:34
by Squar0L
This module shows how to use PUT. It works great.

https://github.com/ggsubs/HikvisionAlert