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 Api command to Zennio Getface IP
#12
(16.05.2018, 12:38)admin Wrote: Attach this code to an event script (boolean object). It will contol switch 1 depending on object value. Make sure that Switch API is enabled without encryption and authentication. log(...) call at the end should be removed if script is working correctly.

Code:
require('socket.http')

switch = 1

value = event.getvalue()
if value then
  action = 'on'
else
  action = 'off'
end

url = 'http://192.168.1.101/api/switch/ctrl?switch=' .. switch .. '&action=' .. action
res, err = socket.http.request(url)

log(res, err)

Hello dear Admin
If I want to do the job reverse, means I want to receive a command/trigger from the Getface IP, what is the http command from the zennio getface should look like?
Best Regards,
Reply


Messages In This Thread
RE: Http Api command to Zennio Getface IP - by khalil - 23.10.2023, 11:12

Forum Jump: