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)[source]

Represent a tracked device.

async_added_to_hass()[source]

Add an entity.

async_seen(host_name: str = None, location_name: str = None, gps: Tuple[float, float] = None, gps_accuracy=0, battery: int = None, attributes: dict = None, source_type: str = 'gps', consider_home: datetime.timedelta = None)[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.

hidden

If device should be hidden.

name

Return the name of the entity.

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(device: str) → Any[source]

Get the name of a device.

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

async_get_extra_attributes(device: str) → Any[source]

Get the extra attributes of a device.

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

async_scan_devices() → Any[source]

Scan for devices.

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

get_device_name(device: str) → str[source]

Get the name of a device.

get_extra_attributes(device: str) → dict[source]

Get the extra attributes of a device.

scan_devices() → List[str][source]

Scan for devices.

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

Representation of a device tracker.

async_see(mac: str = None, dev_id: str = None, host_name: str = None, location_name: str = None, gps: Tuple[float, float] = None, gps_accuracy: int = None, battery: int = None, attributes: dict = None, source_type: str = 'gps', picture: str = None, icon: str = None, consider_home: datetime.timedelta = 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: Tuple[float, float] = None, gps_accuracy: int = None, battery: int = None, attributes: dict = None, source_type: str = 'gps', picture: str = None, icon: str = None, consider_home: datetime.timedelta = 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: Dict[str, Any])[source]

Set up the device tracker.

homeassistant.components.device_tracker.async_setup_scanner_platform(hass: homeassistant.core.HomeAssistant, config: Dict[str, Any], scanner: Any, async_see_device: 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: Tuple[float, float] = None, gps_accuracy=None, battery: int = 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)[source]

Represent a tracked device.

async_added_to_hass()[source]

Add an entity.

async_seen(host_name: str = None, location_name: str = None, gps: Tuple[float, float] = None, gps_accuracy=0, battery: int = None, attributes: dict = None, source_type: str = 'gps', consider_home: datetime.timedelta = None)[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.

hidden

If device should be hidden.

name

Return the name of the entity.

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.