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.

Shelly http command
#1
Hi.

Can someone answer where I do wrong in this script for controling a shelly plug.
The url works as it suppose to when paste it in a web browser.
The shelly plug is just turn OFF either if I put the controling GA to "ON" or "OFF".

Code:
http = require("socket.http")
http.TIMEOUT = 5

ShellyPlugON = "http://192.168.1.51/relay/0?turn=on"
ShellyPlugOFF = "http://192.168.1.51/relay/0?turn=off"

value = grp.getvalue()

if value == true then
  http.request(ShellyPlugON)
  else
  http.request(ShellyPlugOFF)
end
Reply


Messages In This Thread
Shelly http command - by victor.back - 03.12.2022, 17:54
RE: Shelly http command - by admin - 05.12.2022, 12:53
RE: Shelly http command - by victor.back - 05.12.2022, 16:00
RE: Shelly http command - by admin - 05.12.2022, 16:02
RE: Shelly http command - by victor.back - 05.12.2022, 16:11
RE: Shelly http command - by ivob - 27.11.2023, 19:36
RE: Shelly http command - by admin - 28.11.2023, 07:04
RE: Shelly http command - by ivob - 28.11.2023, 07:50
RE: Shelly http command - by Daniel - 28.11.2023, 08:10
RE: Shelly http command - by ivob - 28.11.2023, 10:16
RE: Shelly http command - by ivob - 30.11.2023, 09:41
RE: Shelly http command - by admin - 30.11.2023, 09:42

Forum Jump: