Custom macro

Hi guys, im trying to create a custom macro, similar to:
macros.port_usage_perc , but I want to retrieve current bps rate.
I dont want to change it since im using and dont want to broke something.
How should I create my own macro? it would be something like:
ports.ifInOctets_rate*8.
Where should I add it ? How is it bounded to mysql query ?
I would like to create a rule for instance like:
if port traffic is greater than 200mpbs … alarm is triggered.

btw: Im doing this just because existing rule (macros.port_usage_perc) does not allow me to compare against float values like 1.5.

Regards,
Leandro.

Take a look here for your threshold issue Threshold for traffic alertings

and to create a custom macro you specify it in config.php https://docs.librenms.org/Alerting/Macros/

thanks!!! very usefull