Created At

Apr 27, 2020

Last Update

May 04, 2020


HC 3 Lite, Yubii Home, HC 3





Type Quick App

It is a Quick App to track presence based on the status of multiple MAC addresses in the UniFi controller. The app emulates a multilevel sensor. Each MAC address is represented by a dedicated bit. The first MAC address corresponds to bit 0, the second MAC address corresponds to bit 1, and so on and so forth. E.g., if the app is configured to track presence of d4:a3:3d:c2:b9:e4, 18:f1:d8:e8:1d:50 and 00:b3:62:b8:8f:cb, then sensor value means following:

0 all configured addresses are not detected
1 only presence of d4:a3:3d:c2:b9:e4 is detected
2 only presence of 18:f1:d8:e8:1d:50 is detected
3 presence of d4:a3:3d:c2:b9:e4 and 18:f1:d8:e8:1d:50 is detected
4 only presence of 00:b3:62:b8:8f:cb is detected
5 presence of d4:a3:3d:c2:b9:e4 and 00:b3:62:b8:8f:cb is detected
6 presence of 18:f1:d8:e8:1d:50 and 00:b3:62:b8:8f:cb is detected
7 all configured addresses are detected

 The following variables are mandatory:

  1. controller - address of controller including protocol and port (e.g.,
  2. site - name of the site defined in controller and where MAC address will be searched (e.g., default)
  3. login - username to log into the controller. I recommend creating a dedicated user with read-only access to the controller (e.g., fibaro)
  4. password - self-explanatory
  5. frequency - how often to poll controller (in seconds, e.g., 120)
  6. mac list - comma-separated list of MAC addresses that will be tracked (e.g., d4:a3:3d:c2:b9:e4,18:f1:d8:e8:1d:50,00:b3:62:b8:8f:cb). Note: the list must include MAC addresses and commas only, no tab or space characters.

 The following variables are optional:

  1. away delay - the app changes status for MAC address from "presence detected" to "presence not detected" if the UniFi controller "sees" the mac more than "away delay" seconds ago. If the variable is not defined, then the value of "frequency" is used as "away delay".

12 Comments,  Want to add comment please login

Manage to get it to login With this setting on controller But the quick app crash with QuickApp crashed [05.07.2021] [23:41:00] [ERROR] [QUICKAPP748]: /usr/share/lua/5.3/json/decode/util.lua:35: unexpected character @ character: 2 1:2 [<] line: What could it be?


Doesn't work for me, pls update or make a suggestion for a solution. checkMacListUnifi() failed: "{\"meta\":{\"rc\":\"error\",\"msg\":\"api.err.NoSiteContext\"},\"data\":[]}"


@Bernard Wojcieszynski: I didn't get your question. Can you please clarify? @Razvan Velterean: What do you see in the log? @Mehmet OZOCAK: I recommend checking your configuration, as I explained in the comment on December 9. Your gadget might use a virtual MAC, and you have to put a virtual MAC instead of an actual MAC address into a "mac list".


Works all right! Good job. I use Unifi controller v. 6.0.43.


How to use detection with a Home Away / Not Away variable? in order to change the behavior of a scene?