Hi to all,
I’m not Mikrotik skilled so far, just an enthusiastic user
In my domotic system I use lease script to perform presence detection based on my smartphones mac address and it works pretty good by activating a nodered web endpoint that trigger a flow
I’m now paying around with CAP using few mAP as remote cAP in my apartment and I was thinking to include the area position in my presence script…
My question is: how could I get the interface name of a specific mac address in capsman the registration table?
my lease script is the follow:
# Global and Local Variables
:global d "[PRESENCE]"
:global arr {
"AA:BB:CC:DD:EE:FF"="marco";
"FF:EE:DD:CC:BB:AA"="simona"
}
:global sV false
:global leaseBound
:global leaseActMAC
# :log info "$d Script Start!";
:foreach mac,host in=$arr do={
# :log info "$d Loop Start ==> $mac = $host";
:if ($leaseActMAC = $mac) do={
:log info "$d found mac $mac ==A> $host lease ==> $leaseBound";
:if ($leaseBound = 1) do={ :set sV true } else={ :set sV false }
/tool fetch mode=http url="https://192.168.xx.yy:1880/presence?host=$host&logged=$sV" dst-path=http_response.txt;
:local httpResponse [/file get http_response.txt contents];
:log info "$d $httpResponse";
}
}
basically my intention is: prior the /tool fetch instruction (mmh maybe better in the leasebound = 1 function block), gather the if-name form the “/caps-man registration-table print” where MAC address is the leased one… and I’m unable to solve it by myself
thanks
Regards
M