add rule functions and RFID scan js functions