Edited for Unifi compatibility