1
General Discussion / Presence detection but different
« on: October 15, 2022, 05:18:35 pm »
Hello,
I asked the same question in Dutch so i hope this does not count as crossposting. If i get the answer in Dutch i will post it here so everybody can make use of it.
The question is can opnsense give a signal if a sudden device logs in. I want a signal when my phone or my wifes phone connects to the wifi.
the signal is preferebly a webhook
when i enter this:
http://192.168.1.5/json.htm?type=command¶m=switchlight&idx=1015&switchcmd=On
And when i leave this:
http://192.168.1.5/json.htm?type=command¶m=switchlight&idx=1015&switchcmd=Off
Maybe you recognize the above code it is from Domoticz and it switches a viirtual switch. All local no passwords or anything needed just curl the code.
if i type:
curl 'http://192.168.1.5/json.htm?type=command¶m=switchlight&idx=1015&switchcmd=On'
it actualy works. So now the trick how can i trigger the system to do this for me?
At this moment the phones get a fixed ip, but in stead of pinging i would like it the other way around.
I'm not a programmer, i'm more like a 50 year old scriptkiddie who can copy and paste code.
Thanks in advance
I asked the same question in Dutch so i hope this does not count as crossposting. If i get the answer in Dutch i will post it here so everybody can make use of it.
The question is can opnsense give a signal if a sudden device logs in. I want a signal when my phone or my wifes phone connects to the wifi.
the signal is preferebly a webhook
when i enter this:
http://192.168.1.5/json.htm?type=command¶m=switchlight&idx=1015&switchcmd=On
And when i leave this:
http://192.168.1.5/json.htm?type=command¶m=switchlight&idx=1015&switchcmd=Off
Maybe you recognize the above code it is from Domoticz and it switches a viirtual switch. All local no passwords or anything needed just curl the code.
if i type:
curl 'http://192.168.1.5/json.htm?type=command¶m=switchlight&idx=1015&switchcmd=On'
it actualy works. So now the trick how can i trigger the system to do this for me?
At this moment the phones get a fixed ip, but in stead of pinging i would like it the other way around.
I'm not a programmer, i'm more like a 50 year old scriptkiddie who can copy and paste code.
Thanks in advance