Created At

Apr 27, 2020

Last Update

May 04, 2020

Platforms

HC 3 Lite, Z-box Hub, Yubii Home Pro, Yubii Home, Venture WISE, HC 3

Views

4954

Download

517

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., https://192.168.1.10:8443/)
  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".

19 Comments,  Want to add comment please login
0a9c27198039c99db6d696a6c36b8f2c

Helo, please help me this error [ERROR] [QUICKAPP271]: checkMacListUnifi() failed: "{\"meta\":{\"rc\":\"error\",\"msg\":\"api.err.NoSiteContext\"},\"data\":[]}"

Bd567b020c5664f30ccca91077d16a88

Hi, installed the app. Debug schows me everything is working "Succeeded" checks the mac addresses but says no one is detected. At least one is active. ??

602d0c581d41f736142387ba05c5263f

Marcel & Marek, I recommend sending a request manually to validate the app's configuration for both cases. To do that: 1) Open in web browser URL specified in the "controller" variable. 2) Login with the login/password from "login" and "password" variables. 3) In the same browser tab where you logged into UniFi, open the page <controller>api/s/<site>/stat/sta. In my configuration the "controller" variable is "https://192.168.1.10/", the "site" variable is "defaul", so the whole request looks like "https://192.168.1.10/api/s/default/stat/sta". 4) The UniFi controller responds with the list of devices, including their MACs, which the controller "sees". 5) Search the response for MACs from the "mac list" variable.

94494e85faa47ba41f3abc03fe1be191

Hi, i have same issue. In log MAC adesses are set to home but the result is always 0.

7605bf39af919dae14de13f0bd0a9e81

as of march 2021 this app is not working. maybe due to ubiquiti updates. this app needs updates too

© 2024. Nice-Polska Sp. z o.o.Privacy policyTerms & ConditionsFeedback