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

Namespaces

 config
 
 const
 
 helpers
 
 logbook
 
 reproduce_state
 
 trace
 

Classes

class  AutomationEntity
 
class  AutomationEntityConfig
 
class  BaseAutomationEntity
 
class  IfAction
 
class  UnavailableAutomationEntity
 

Functions

None _async_process_config (HomeAssistant hass, dict[str, Any] config, EntityComponent[BaseAutomationEntity] component)
 
IfAction|None _async_process_if (HomeAssistant hass, str name, dict[str, Any] config)
 
None _async_process_single_config (HomeAssistant hass, dict[str, Any] config, EntityComponent[BaseAutomationEntity] component, str automation_id)
 
bool _automation_matches_config (BaseAutomationEntity|None automation, AutomationEntityConfig|None config)
 
str _automation_name (AutomationEntityConfig automation_config)
 
list[str] _automations_with_x (HomeAssistant hass, str referenced_id, str property_name)
 
list[BaseAutomationEntity_create_automation_entities (HomeAssistant hass, list[AutomationEntityConfig] automation_configs)
 
list[AutomationEntityConfig_prepare_automation_config (HomeAssistant hass, ConfigType config, str|None wanted_automation_id)
 
list[str] _trigger_extract_devices (dict trigger_conf)
 
list[str] _trigger_extract_entities (dict trigger_conf)
 
list[str] _x_in_automation (HomeAssistant hass, str entity_id, str property_name)
 
list[str] areas_in_automation (HomeAssistant hass, str entity_id)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
list[str] automations_with_area (HomeAssistant hass, str area_id)
 
list[str] automations_with_blueprint (HomeAssistant hass, str blueprint_path)
 
list[str] automations_with_device (HomeAssistant hass, str device_id)
 
list[str] automations_with_entity (HomeAssistant hass, str entity_id)
 
list[str] automations_with_floor (HomeAssistant hass, str floor_id)
 
list[str] automations_with_label (HomeAssistant hass, str label_id)
 
str|None blueprint_in_automation (HomeAssistant hass, str entity_id)
 
list[str] devices_in_automation (HomeAssistant hass, str entity_id)
 
list[str] entities_in_automation (HomeAssistant hass, str entity_id)
 
list[str] floors_in_automation (HomeAssistant hass, str entity_id)
 
bool is_on (HomeAssistant hass, str entity_id)
 
list[str] labels_in_automation (HomeAssistant hass, str entity_id)
 
None websocket_config (HomeAssistant hass, websocket_api.ActiveConnection connection, dict[str, Any] msg)
 

Variables

 __all__ = all_with_deprecated_constants(globals())
 
 __dir__
 
 __getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
 
 _DEPRECATED_AutomationActionType
 
 _DEPRECATED_AutomationTriggerData
 
 _DEPRECATED_AutomationTriggerInfo
 
string ATTR_LAST_TRIGGERED = "last_triggered"
 
string ATTR_SOURCE = "source"
 
string ATTR_VARIABLES = "variables"
 
string CONF_SKIP_CONDITION = "skip_condition"
 
string CONF_STOP_ACTIONS = "stop_actions"
 
bool DEFAULT_STOP_ACTIONS = True
 
string ENTITY_ID_FORMAT = DOMAIN + ".{}"
 
string EVENT_AUTOMATION_RELOADED = "automation_reloaded"
 
string EVENT_AUTOMATION_TRIGGERED = "automation_triggered"
 
string SERVICE_TRIGGER = "trigger"
 

Detailed Description

Allow to set up simple automation rules via the config file.

Function Documentation

◆ _async_process_config()

None homeassistant.components.automation._async_process_config ( HomeAssistant  hass,
dict[str, Any]  config,
EntityComponent[BaseAutomationEntity component 
)
private
Process config and add automations.

Definition at line 1010 of file __init__.py.

◆ _async_process_if()

IfAction | None homeassistant.components.automation._async_process_if ( HomeAssistant  hass,
str  name,
dict[str, Any]   config 
)
private
Process if checks.

Definition at line 1131 of file __init__.py.

◆ _async_process_single_config()

None homeassistant.components.automation._async_process_single_config ( HomeAssistant  hass,
dict[str, Any]  config,
EntityComponent[BaseAutomationEntity component,
str  automation_id 
)
private
Process config and add a single automation.

Definition at line 1108 of file __init__.py.

◆ _automation_matches_config()

bool homeassistant.components.automation._automation_matches_config ( BaseAutomationEntity | None  automation,
AutomationEntityConfig | None   config 
)
private
Return False if an automation's config has been changed.

Definition at line 1096 of file __init__.py.

◆ _automation_name()

str homeassistant.components.automation._automation_name ( AutomationEntityConfig  automation_config)
private
Return the configured name of an automation.

Definition at line 924 of file __init__.py.

◆ _automations_with_x()

list[str] homeassistant.components.automation._automations_with_x ( HomeAssistant  hass,
str  referenced_id,
str   property_name 
)
private
Return all automations that reference the x.

Definition at line 163 of file __init__.py.

◆ _create_automation_entities()

list[BaseAutomationEntity] homeassistant.components.automation._create_automation_entities ( HomeAssistant  hass,
list[AutomationEntityConfig]   automation_configs 
)
private
Create automation entities from prepared configuration.

Definition at line 931 of file __init__.py.

◆ _prepare_automation_config()

list[AutomationEntityConfig] homeassistant.components.automation._prepare_automation_config ( HomeAssistant  hass,
ConfigType  config,
str | None  wanted_automation_id 
)
private
Parse configuration and prepare automation entity configuration.

Definition at line 891 of file __init__.py.

◆ _trigger_extract_devices()

list[str] homeassistant.components.automation._trigger_extract_devices ( dict  trigger_conf)
private
Extract devices from a trigger config.

Definition at line 1152 of file __init__.py.

◆ _trigger_extract_entities()

list[str] homeassistant.components.automation._trigger_extract_entities ( dict  trigger_conf)
private
Extract entities from a trigger config.

Definition at line 1172 of file __init__.py.

◆ _x_in_automation()

list[str] homeassistant.components.automation._x_in_automation ( HomeAssistant  hass,
str  entity_id,
str   property_name 
)
private
Return all x in an automation.

Definition at line 177 of file __init__.py.

◆ areas_in_automation()

list[str] homeassistant.components.automation.areas_in_automation ( HomeAssistant  hass,
str  entity_id 
)
Return all areas in an automation.

Definition at line 221 of file __init__.py.

◆ async_setup()

bool homeassistant.components.automation.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up all automations.

Definition at line 275 of file __init__.py.

◆ automations_with_area()

list[str] homeassistant.components.automation.automations_with_area ( HomeAssistant  hass,
str  area_id 
)
Return all automations that reference the area.

Definition at line 215 of file __init__.py.

◆ automations_with_blueprint()

list[str] homeassistant.components.automation.automations_with_blueprint ( HomeAssistant  hass,
str  blueprint_path 
)
Return all automations that reference the blueprint.

Definition at line 251 of file __init__.py.

◆ automations_with_device()

list[str] homeassistant.components.automation.automations_with_device ( HomeAssistant  hass,
str  device_id 
)
Return all automations that reference the device.

Definition at line 203 of file __init__.py.

◆ automations_with_entity()

list[str] homeassistant.components.automation.automations_with_entity ( HomeAssistant  hass,
str  entity_id 
)
Return all automations that reference the entity.

Definition at line 191 of file __init__.py.

◆ automations_with_floor()

list[str] homeassistant.components.automation.automations_with_floor ( HomeAssistant  hass,
str  floor_id 
)
Return all automations that reference the floor.

Definition at line 227 of file __init__.py.

◆ automations_with_label()

list[str] homeassistant.components.automation.automations_with_label ( HomeAssistant  hass,
str  label_id 
)
Return all automations that reference the label.

Definition at line 239 of file __init__.py.

◆ blueprint_in_automation()

str | None homeassistant.components.automation.blueprint_in_automation ( HomeAssistant  hass,
str  entity_id 
)
Return the blueprint the automation is based on or None.

Definition at line 264 of file __init__.py.

◆ devices_in_automation()

list[str] homeassistant.components.automation.devices_in_automation ( HomeAssistant  hass,
str  entity_id 
)
Return all devices in an automation.

Definition at line 209 of file __init__.py.

◆ entities_in_automation()

list[str] homeassistant.components.automation.entities_in_automation ( HomeAssistant  hass,
str  entity_id 
)
Return all entities in an automation.

Definition at line 197 of file __init__.py.

◆ floors_in_automation()

list[str] homeassistant.components.automation.floors_in_automation ( HomeAssistant  hass,
str  entity_id 
)
Return all floors in an automation.

Definition at line 233 of file __init__.py.

◆ is_on()

bool homeassistant.components.automation.is_on ( HomeAssistant  hass,
str  entity_id 
)
Return true if specified automation entity_id is on.

Async friendly.

Definition at line 155 of file __init__.py.

◆ labels_in_automation()

list[str] homeassistant.components.automation.labels_in_automation ( HomeAssistant  hass,
str  entity_id 
)
Return all labels in an automation.

Definition at line 245 of file __init__.py.

◆ websocket_config()

None homeassistant.components.automation.websocket_config ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
dict[str, Any]  msg 
)
Get automation config.

Definition at line 1202 of file __init__.py.

Variable Documentation

◆ __all__

homeassistant.components.automation.__all__ = all_with_deprecated_constants(globals())
private

Definition at line 1229 of file __init__.py.

◆ __dir__

homeassistant.components.automation.__dir__
private
Initial value:
1 = partial(
2  dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
3 )

Definition at line 1226 of file __init__.py.

◆ __getattr__

homeassistant.components.automation.__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
private

Definition at line 1225 of file __init__.py.

◆ _DEPRECATED_AutomationActionType

homeassistant.components.automation._DEPRECATED_AutomationActionType
private
Initial value:
1 = DeprecatedConstant(
2  TriggerActionType, "TriggerActionType", "2025.1"
3 )

Definition at line 143 of file __init__.py.

◆ _DEPRECATED_AutomationTriggerData

homeassistant.components.automation._DEPRECATED_AutomationTriggerData
private
Initial value:
1 = DeprecatedConstant(
2  TriggerData, "TriggerData", "2025.1"
3 )

Definition at line 146 of file __init__.py.

◆ _DEPRECATED_AutomationTriggerInfo

homeassistant.components.automation._DEPRECATED_AutomationTriggerInfo
private
Initial value:
1 = DeprecatedConstant(
2  TriggerInfo, "TriggerInfo", "2025.1"
3 )

Definition at line 149 of file __init__.py.

◆ ATTR_LAST_TRIGGERED

string homeassistant.components.automation.ATTR_LAST_TRIGGERED = "last_triggered"

Definition at line 125 of file __init__.py.

◆ ATTR_SOURCE

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

Definition at line 126 of file __init__.py.

◆ ATTR_VARIABLES

string homeassistant.components.automation.ATTR_VARIABLES = "variables"

Definition at line 127 of file __init__.py.

◆ CONF_SKIP_CONDITION

string homeassistant.components.automation.CONF_SKIP_CONDITION = "skip_condition"

Definition at line 118 of file __init__.py.

◆ CONF_STOP_ACTIONS

string homeassistant.components.automation.CONF_STOP_ACTIONS = "stop_actions"

Definition at line 119 of file __init__.py.

◆ DEFAULT_STOP_ACTIONS

bool homeassistant.components.automation.DEFAULT_STOP_ACTIONS = True

Definition at line 120 of file __init__.py.

◆ ENTITY_ID_FORMAT

string homeassistant.components.automation.ENTITY_ID_FORMAT = DOMAIN + ".{}"

Definition at line 115 of file __init__.py.

◆ EVENT_AUTOMATION_RELOADED

string homeassistant.components.automation.EVENT_AUTOMATION_RELOADED = "automation_reloaded"

Definition at line 122 of file __init__.py.

◆ EVENT_AUTOMATION_TRIGGERED

string homeassistant.components.automation.EVENT_AUTOMATION_TRIGGERED = "automation_triggered"

Definition at line 123 of file __init__.py.

◆ SERVICE_TRIGGER

string homeassistant.components.automation.SERVICE_TRIGGER = "trigger"

Definition at line 128 of file __init__.py.