Skip to main content

Entity

The entity registry is dual purpose:

  • contains tools for accessing entity registry details
  • contains tools for actively tracking and managing state locally within the app

It powers a variety of interal workflows for hass as well as downstream libraries like synapse.

State Utilities

The entity registry maintains MASTER_STATE & PREVIOUS_STATE variables internally, providing function access with a more traditional access pattern.

No proxy objects required.

methoddescription
getCurrentStatereturns current state for an entity
previousStatereturns previous state for an entity
historyentity history search utilities
listEntitieslist all entities in the registry, optionally filtering by domain
refreshfetch all entities from home assistant, rebuild local data

Registry Utilities

The registry utilities provide additional ways for working with entities that go beyond their basic state.

methoddescription
addLabeladd a label to an entity
removeLabelremove a labelm from an entity
currentarray of known entities in Home Assitant registry (hopefully 1-1 with entity states)
registryList / listrequest the current list of entity configurations (config/entity_registry/list)
removeEntityequiv to clicking delete button in Lovelace (config/entity_registry/remove)
sourceentity/source