Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.person Namespace Reference

Namespaces

 const
 
 significant_change
 

Classes

class  Person
 
class  PersonStorageCollection
 
class  PersonStorageCollectionWebsocket
 
class  PersonStore
 

Functions

State _get_latest (State|None prev, State curr)
 
None async_add_user_device_tracker (HomeAssistant hass, str user_id, str device_tracker_entity_id)
 
None async_create_person (HomeAssistant hass, str name, *str|None user_id=None, list[str]|None device_trackers=None)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
list[str] entities_in_person (HomeAssistant hass, str entity_id)
 
list[dict] filter_yaml_data (HomeAssistant hass, list[dict] persons)
 
list[str] persons_with_entity (HomeAssistant hass, str entity_id)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_DEVICE_TRACKERS = "device_trackers"
 
string ATTR_SOURCE = "source"
 
string ATTR_USER_ID = "user_id"
 
string CONF_DEVICE_TRACKERS = "device_trackers"
 
string CONF_PICTURE = "picture"
 
string CONF_USER_ID = "user_id"
 
 CONFIG_SCHEMA
 
tuple IGNORE_STATES = (STATE_UNKNOWN, STATE_UNAVAILABLE)
 
 PERSON_SCHEMA
 
 STORAGE_KEY = DOMAIN
 
int STORAGE_VERSION = 2
 

Detailed Description

Support for tracking people.

Function Documentation

◆ _get_latest()

State homeassistant.components.person._get_latest ( State | None  prev,
State  curr 
)
private
Get latest state.

Definition at line 586 of file __init__.py.

◆ async_add_user_device_tracker()

None homeassistant.components.person.async_add_user_device_tracker ( HomeAssistant  hass,
str  user_id,
str   device_tracker_entity_id 
)
Add a device tracker to a person linked to a user.

Definition at line 114 of file __init__.py.

◆ async_create_person()

None homeassistant.components.person.async_create_person ( HomeAssistant  hass,
str  name,
*str | None   user_id = None,
list[str] | None   device_trackers = None 
)
Create a new person.

Definition at line 96 of file __init__.py.

◆ async_setup()

bool homeassistant.components.person.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the person component.

Definition at line 361 of file __init__.py.

◆ entities_in_person()

list[str] homeassistant.components.person.entities_in_person ( HomeAssistant  hass,
str  entity_id 
)
Return all entities belonging to a person.

Definition at line 155 of file __init__.py.

◆ filter_yaml_data()

list[dict] homeassistant.components.person.filter_yaml_data ( HomeAssistant  hass,
list[dict]  persons 
)
Validate YAML data that we can't validate via schema.

Definition at line 325 of file __init__.py.

◆ persons_with_entity()

list[str] homeassistant.components.person.persons_with_entity ( HomeAssistant  hass,
str  entity_id 
)
Return all persons that reference the entity.

Definition at line 137 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.person._LOGGER = logging.getLogger(__name__)
private

Definition at line 58 of file __init__.py.

◆ ATTR_DEVICE_TRACKERS

string homeassistant.components.person.ATTR_DEVICE_TRACKERS = "device_trackers"

Definition at line 62 of file __init__.py.

◆ ATTR_SOURCE

string homeassistant.components.person.ATTR_SOURCE = "source"

Definition at line 60 of file __init__.py.

◆ ATTR_USER_ID

string homeassistant.components.person.ATTR_USER_ID = "user_id"

Definition at line 61 of file __init__.py.

◆ CONF_DEVICE_TRACKERS

string homeassistant.components.person.CONF_DEVICE_TRACKERS = "device_trackers"

Definition at line 64 of file __init__.py.

◆ CONF_PICTURE

string homeassistant.components.person.CONF_PICTURE = "picture"

Definition at line 66 of file __init__.py.

◆ CONF_USER_ID

string homeassistant.components.person.CONF_USER_ID = "user_id"

Definition at line 65 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.person.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Optional(DOMAIN, default=[]): vol.All(
4  cv.ensure_list, cv.remove_falsy, [PERSON_SCHEMA]
5  )
6  },
7  extra=vol.ALLOW_EXTRA,
8 )

Definition at line 85 of file __init__.py.

◆ IGNORE_STATES

tuple homeassistant.components.person.IGNORE_STATES = (STATE_UNKNOWN, STATE_UNAVAILABLE)

Definition at line 71 of file __init__.py.

◆ PERSON_SCHEMA

homeassistant.components.person.PERSON_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_ID): cv.string,
4  vol.Required(CONF_NAME): cv.string,
5  vol.Optional(CONF_USER_ID): cv.string,
6  vol.Optional(CONF_DEVICE_TRACKERS, default=[]): vol.All(
7  cv.ensure_list, cv.entities_domain(DEVICE_TRACKER_DOMAIN)
8  ),
9  vol.Optional(CONF_PICTURE): cv.string,
10  }
11 )

Definition at line 73 of file __init__.py.

◆ STORAGE_KEY

homeassistant.components.person.STORAGE_KEY = DOMAIN

Definition at line 68 of file __init__.py.

◆ STORAGE_VERSION

int homeassistant.components.person.STORAGE_VERSION = 2

Definition at line 69 of file __init__.py.