for my home automation's presence information I have been using a script to recognize when certain devices are registered in my wifi.
It seems this script stopped working due to an update but unfortunately I didn't recognize it quickly enough to still remember which update it was. Most likely 7.12 -> 7.13 though.
Here is the shortened script:
name="Presence" owner="admin" policy=read,write,policy,test dont-require-permissions=no
Code: Select all
:global WolfgangON
{
:local exists [/interface/wifi/registration-table find mac-address="CA:FF:EE:CA:FF:EE"];
:if ($exists!="") do={
:if ($WolfgangON != 1) do={
/tool fetch url="http://192.168.250.12:8080/rest/items/SensorPhoneWolfgang" http-header-field="content-type:text/plain" http-data="ON" ascii=yes http-method=post;
:set WolfgangON 1
}
} else={
:if ($WolfgangON != 0) do={
/tool fetch url="http://192.168.250.12:8080/rest/items/SensorPhoneWolfgang" http-header-field="content-type:text/plain" http-data="OFF" ascii=yes http-method=post;
:set WolfgangON 0
}
}
}
Any hints?