info_i_25x25.png See important information about Ubiquiti Devices and KRACK Vulnerability in this article. We will update this document as more information becomes available.

mFi - How to make mFi speak out alarm notifications on Linux controller

Overview

Readers will learn how to enable mFi alarm notifications (sound, notifications) on a Linux-based controller. If all goes well your mFi controller with speakers plugged in should say aloud rule names of your choice for an almost instant alert or notification. Currently I have this running on a 12.04 Ubuntu system. Below is done with a live terminal window or with SSH using PuTTY.

Steps

Step 1 install php5 

sudo apt-get install php5

Step 2 install espeak 

sudo apt-get install espeak

Step 3 Permit the PHP web server to use espeak (this adds webserver to audio group and restarts webserver)

sudo usermod -G audio www-data
sudo /etc/init.d/apache2 restart

Step 4 Create a PHP script and save it in /var/www (for an example ) name it speak.php

The code needed , copy and paste.

<?php
  system("espeak '".$_POST["rule"]."'");
?>

Step 5 Make or modify a rule and add a url post as an action.

Note: I have _: between ( Water Alert ) that tells Espeak to pause for a second or so between words.

If your php and espeak are installed on the same computer as the mFi controller you can also use 127.0.0.1 for the IP address.

Related Articles