Ping MAC

Hello, please help. I do a script to check the availability of equipment, by ping to the MAC address of the device. I can’t ping directly since different IP addresses on local interfaces, and from the Internet to the equipment of access aren’t present. But the script does not work, because it is necessary. What am I doing wrong?

:global mac XX:XX:XX:XX:XX:XX
:if ([:ping $mac count=10 interval < 0ms] < 5) do= {/tool fetch url="https://api.telegram.org/botXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/sendmessage?chat_id=XXXXXX&text=TEXT"}

You will not be able to ping MAC. I think you need to find corresponding IP with other script or fucntion using ip arp.
E.g store value of IP from ip arp print of matches particular MAC and than just ping IP.

I hope it will help a bit