homeassistant.components.device_tracker

Provide functionality to keep track of devices.

For more details about this component, please refer to the documentation at https://home-assistant.io/components/device_tracker/

class homeassistant.components.device_tracker.Device(hass: homeassistant.core.HomeAssistant, consider_home: datetime.timedelta, track: bool, dev_id: str, mac: str, name: str = None, picture: str = None, gravatar: str = None, icon: str = None, hide_if_away: bool = False, vendor: str = None) → None[source]

Represent a tracked device.

async_added_to_hass()[source]

Add an entity.

async_seen(host_name: str = None, location_name: str = None, gps: typing.Tuple[float, float] = None, gps_accuracy=0, battery: str = None, attributes: dict = None, source_type: str = 'gps')[source]

Mark the device as seen.

async_update()[source]

Update state of entity.

This method is a coroutine.

device_state_attributes

Return device state attributes.

entity_picture

Return the picture of the device.

get_vendor_for_mac()[source]

Try to find the vendor string for a given MAC address.

hidden

If device should be hidden.

name

Return the name of the entity.

set_vendor_for_mac()[source]

Set vendor string using api.macvendors.com.

stale(now: datetime.datetime = None)[source]

Return if device state is stale.

Async friendly.

state

Return the state of the device.

state_attributes

Return the device state attributes.

class homeassistant.components.device_tracker.DeviceScanner[source]

Device scanner object.

async_get_device_name(mac: str) → typing.Any[source]

Get device name from mac.

This method must be run in the event loop and returns a coroutine.

async_scan_devices() → typing.Any[source]

Scan for devices.

This method must be run in the event loop and returns a coroutine.

get_device_name(mac: str) → str[source]

Get device name from mac.

scan_devices() → typing.List[str][source]

Scan for devices.

class homeassistant.components.device_tracker.DeviceTracker(hass: homeassistant.core.HomeAssistant, consider_home: datetime.timedelta, track_new: bool, devices: typing.Sequence) → None[source]

Representation of a device tracker.

async_see(mac: str = None, dev_id: str = None, host_name: str = None, location_name: str = None, gps: typing.Tuple[float, float] = None, gps_accuracy=None, battery: str = None, attributes: dict = None, source_type: str = 'gps', picture: str = None, icon: str = None)[source]

Notify the device tracker that you see a device.

This method is a coroutine.

async_setup_group()[source]

Initialize group for all tracked devices.

This method must be run in the event loop.

async_setup_tracked_device()[source]

Set up all not exists tracked devices.

This method is a coroutine.

async_update_config(path, dev_id, device)[source]

Add device to YAML configuration file.

This method is a coroutine.

async_update_stale(now: datetime.datetime)[source]

Update stale devices.

This method must be run in the event loop.

see(mac: str = None, dev_id: str = None, host_name: str = None, location_name: str = None, gps: typing.Tuple[float, float] = None, gps_accuracy=None, battery: str = None, attributes: dict = None, source_type: str = 'gps', picture: str = None, icon: str = None)[source]

Notify the device tracker that you see a device.

homeassistant.components.device_tracker.async_load_config(path: str, hass: homeassistant.core.HomeAssistant, consider_home: datetime.timedelta)[source]

Load devices from YAML configuration file.

This method is a coroutine.

homeassistant.components.device_tracker.async_setup(hass: homeassistant.core.HomeAssistant, config: typing.Dict[str, typing.Any])[source]

Set up the device tracker.

homeassistant.components.device_tracker.async_setup_scanner_platform(hass: homeassistant.core.HomeAssistant, config: typing.Dict[str, typing.Any], scanner: typing.Any, async_see_device: typing.Callable, platform: str)[source]

Set up the connect scanner-based platform to device tracker.

This method must be run in the event loop.

homeassistant.components.device_tracker.get_gravatar_for_email(email: str)[source]

Return an 80px Gravatar for the given email address.

Async friendly.

homeassistant.components.device_tracker.is_on(hass: homeassistant.core.HomeAssistant, entity_id: str = None)[source]

Return the state if any or a specified device is home.

homeassistant.components.device_tracker.load_config(path: str, hass: homeassistant.core.HomeAssistant, consider_home: datetime.timedelta)[source]

Load devices from YAML configuration file.

homeassistant.components.device_tracker.see(hass: homeassistant.core.HomeAssistant, mac: str = None, dev_id: str = None, host_name: str = None, location_name: str = None, gps: typing.Tuple[float, float] = None, gps_accuracy=None, battery=None, attributes: dict = None)[source]

Call service to notify you see device.

homeassistant.components.device_tracker.update_config(path: str, dev_id: str, device: homeassistant.components.device_tracker.Device)[source]

Add device to YAML configuration file.

class homeassistant.components.device_tracker.Device(hass: homeassistant.core.HomeAssistant, consider_home: datetime.timedelta, track: bool, dev_id: str, mac: str, name: str = None, picture: str = None, gravatar: str = None, icon: str = None, hide_if_away: bool = False, vendor: str = None) → None[source]

Represent a tracked device.

async_added_to_hass()[source]

Add an entity.

async_seen(host_name: str = None, location_name: str = None, gps: typing.Tuple[float, float] = None, gps_accuracy=0, battery: str = None, attributes: dict = None, source_type: str = 'gps')[source]

Mark the device as seen.

async_update()[source]

Update state of entity.

This method is a coroutine.

device_state_attributes

Return device state attributes.

entity_picture

Return the picture of the device.

get_vendor_for_mac()[source]

Try to find the vendor string for a given MAC address.

hidden

If device should be hidden.

name

Return the name of the entity.

set_vendor_for_mac()[source]

Set vendor string using api.macvendors.com.

stale(now: datetime.datetime = None)[source]

Return if device state is stale.

Async friendly.

state

Return the state of the device.

state_attributes

Return the device state attributes.