You can send e.g. an created own command via Telegram bot to your router.
(There a two example commands in the package BlackVS provided which helps to understand how to do)
E.g. I want to know what devices are online - so I send the key command /onlineDevices via Telegram, the Mikrotik router checks the Telegram bot regularly (via scheduler), receives the command, interpretes it and sends according feedback (current online devices) back to the bot and therfore to my smartphone.
### get DHCP leases START
:local send [:parse [/system script get tg_sendMessage source]]
:local i;
:local hostip;
:local hostname;
:local macaddress;
:local dhcplist "";
#:local cmt "";
:local leaseStatus "";
:local PINGCOUNT "3";
:local CURRENTSTATUS "";
:local leasesall [ :len [ /ip dhcp-server lease find where server=dhcp1 ] ];
/ip dhcp-server lease;
:foreach i in=[find where server=dhcp1 ] do={
:set $hostname [get $i host-name];
:if ( [:len $hostname] = 0) do={
:set $hostname [get $i comment];
:if ( [:len $hostname] = 0) do={
:set $hostname "NoHostName-NoComment";
}
}
:set $leaseStatus [get $i status];
:set $hostip [get $i address];
:if ([/ping $hostip interval=1s count=$PINGCOUNT] > ($PINGCOUNT / 2)) do={
## if host responses at least to half of the pings it seems to be online
:set $CURRENTSTATUS "online";
} else= {
:set $CURRENTSTATUS "offline";
}
:set $dhcplist ("*" . $hostname . "*" . " - status: _" . $CURRENTSTATUS . "_%0A" . $dhcplist);
};
### get DHCP leases END
:put $params;
:put $chatid;
:put $from;
#:log info $dhcplist;
:local text "Router Id:* $[/system identity get name] * %0A\
_DHCP leases_ %0A\
$dhcplist";
:put ("Text: $text");
:log info $text;
$send chat=$chatid text=$text mode="Markdown";
:return true;