This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

http(s) server as REST api?
#11
(08.02.2021, 07:20)admin Wrote: Example for writing to group addresses without password.
You have to enable FTP server in System Config, connect via FTP by using apps username and upload write.lp file into public directory.
write.lp file contents:
Code:
<?
require('apps')
addr = getvar('addr') or ''
value = getvar('value') or ''
value = json.pdecode(value)
if type(value) ~= nil then
  grp.write(addr, value)
end

Example URLs:
http://LM_IP/public/write.lp?addr=1/1/1&value=1 - write 1/ON to 1/1/1
http://LM_IP/public/write.lp?addr=32/1/1&value=123 - write 123 to 32/1/1

I'm trying to use this "workaround" within a shelly script, but the http.get request from the shelly device fails:

"shelly_http_client.:611 0x3ffeb688: Finished; bytes 340, code 301, redir 1/3, auth 0, status ABORTED: Abandoned"

An idea why the webserver from my W4K answers with code 301?
Reply


Messages In This Thread
http(s) server as REST api? - by Hert - 03.02.2021, 10:30
RE: http(s) server as REST api? - by admin - 03.02.2021, 10:31
RE: http(s) server as REST api? - by Hert - 03.02.2021, 10:41
RE: http(s) server as REST api? - by Hert - 05.02.2021, 19:32
RE: http(s) server as REST api? - by admin - 06.02.2021, 09:41
RE: http(s) server as REST api? - by Hert - 06.02.2021, 14:16
RE: http(s) server as REST api? - by admin - 06.02.2021, 14:20
RE: http(s) server as REST api? - by admin - 08.02.2021, 07:20
RE: http(s) server as REST api? - by idhe - 28.04.2021, 14:56
RE: http(s) server as REST api? - by cgn - 18.01.2025, 21:52
RE: http(s) server as REST api? - by admin - 29.04.2021, 07:31
RE: http(s) server as REST api? - by admin - 20.01.2025, 12:46
RE: http(s) server as REST api? - by cgn - 21.01.2025, 15:22
RE: http(s) server as REST api? - by cgn - 23.01.2025, 16:14

Forum Jump: