Unifi: not seeing away devices!

The Unifi controller shows recently connected devices (with 20 minutes or so) on their client list, but also reports a “last_seen” time for each device. I use this last seen time to filter out the devices who haven’t been seen within the “consider_home” timeframe.

Changed line 86 to:

self._clients = {client['mac']: client for client in clients if (dt_util.utcnow() - dt_util.utc_from_timestamp(float(client['last_seen']))) < self.consider_home}

( defined conside_home = config[DOMAIN].get(CONF_CONSIDER_HOME) in get_scanner )

https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/device_tracker/unifi.py

2 Likes