05.12.2022, 12:53
Try this and check that you get correct URL and response in Logs:
If your device supports MQTT you can use it instead of HTTP: https://forum.logicmachine.net/showthread.php?tid=3010
Code:
http = require("socket.http")
http.TIMEOUT = 5
cmd = grp.getvalue() and "on" or "off"
url = "http://192.168.1.51/relay/0?turn=" .. cmd
log(url)
res, err = http.request(url)
log(res, err)
If your device supports MQTT you can use it instead of HTTP: https://forum.logicmachine.net/showthread.php?tid=3010