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.

KNX PIR detection should execute url (WLED)
#1
Hello all,

I am currently struggling with the integration of my WLED environment.
https://github.com/Aircoookie/WLED

The goal is that when my KNX motion detectors detect a movement their group address jumps to 1, that then a URL is called which activates the preset provided in the WLED controller. At 0, the 2nd URL should be executed, which again deactivates the lights.
With the URLs no value must be given, but only the URL must be called.
How must the script look, or where do I have to store this, so that it does not require too much performance.
Scripting => Event-Controlled => Add new script????

Here is the final score of my futile attempts:

################## START ######################

PIR1 = grp.getvalue('1/1/19')
PIR2 = grp.getvalue('1/1/20')
WLEDon = 'http://192.168.178.128/win&T=1'
WLEDoff = 'http://192.168.178.128/win&T=0'

http = require('socket.http')

if PIR1 or PIR2 == 1 then
http = 'http://192.168.178.128/win&T=1'
else
url = 'http://192.168.178.128/win&T=0'
end

################## END ########################

Error Message: 
[wiser.Client] 13.11.2021 02:59:46

RPC_SOCKET_SYSTEM:


Many thanks for your support.

Best regards.
Martin
Reply


Messages In This Thread
KNX PIR detection should execute url (WLED) - by MaGer - 13.11.2021, 18:44

Forum Jump: