ChrisK2 Thank you for the example. Unfortunately, it does not work for me at all. I have a Plus 1PM and a Plus 2PM with 0.10 3 firmware. I tried on both. I get the following error and the script does not start: "MJS error: [HTTPServer] is not defined". Do you have any idea why? Does it require any configuration setting?
Harryl Could you get it to work?
yes i have it working now, can't remember what the issue was.. but i fixet it.. but thanks for the reply will check if yours are better
Beiträge von Harryl
-
-
i have try'd both with and without "http://" alså fixing the syntax.. the url is an object as should be supported by shelly.call as params.
Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen. Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen. -
in an Shelly.addStatusHandler() that seems to work and if i use switch.set ir works and all.. bu below does not work i get the error below shelly.call
Codelet ip = '10.0.1.153'; let heater_url = 'http://' + ip + '/rpc/Switch.Set?id=0&on='true; shelly.call("http.get",{url: 'http://' + heater_url },function (result, code, msg, ud) {},null);
erroronStatusChange callback error: [shelly] is not defined
-
and the docs links does not work either..
https://repo.shelly.cloud/firmware/ng-api/gen2/
Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen. Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen. Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen. -
Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen. try'd both in edge and Chrome on Windows 11
-
Hi..
i am missing some example code for "
HTTPServer
" i have found "https://shelly-api-docs.shelly.cloud/gen2/Scripts/S…anguageFeatures#httpserver" and it does work some.. but it seems, i have to send back 200 http code(header) to get the browser to stop hanging(it waits).. i have try'd some i have prev used..and i have not been able to finde anything via google.also im unsure how to get the http post/get data info as a variable.. im GET like so "http://10.0.1.153/script/1/tester?test3"
i can normalle code in php/python/javascript/bash but i am unfamiliar with msj/
HTTPServer
.Anyone here who knows the
HTTPServer
object ?? @Dimitar (Shelly Team) -
Hi..
i am missing some example code for "
HTTPServer
" i have found "https://shelly-api-docs.shelly.cloud/gen2/Scripts/S…ures#httpserver" and it does work some.. but it seems, i have to send back 200 http code(header) to get the browser to stop hanging(it waits).. i have try'd some i have prev used..and i have not been able to finde anything via google.also im unsure how to get the http post/get data info as a variable.. im GET like so "http://10.0.1.153/script/1/tester?test3"
i can normalle code in php/python/javascript/bash but i am unfamiliar with msj/
HTTPServer
.