16.05.2018, 14:19
(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)
Hi
Works perfectly, thanks!

Now to my next question, how to read a input from Zennio Getface IP ?
is there an easy way?
Br Even.