Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.config_validation Namespace Reference

Classes

class  _Hass
 
class  multi_select
 
class  MustValidateInExecutor
 
class  UrlProtocolSchema
 

Functions

HomeAssistant|None _async_get_hass_or_none ()
 
Any _backward_compat_service_schema (Any|None value)
 
list[Any] _base_trigger_list_flatten (list[Any] triggers)
 
Any _base_trigger_validator (Any value)
 
Any _custom_serializer (Any schema, *bool allow_section)
 
Callable[[dict], dict] _deprecated_or_removed (str key, str|None replacement_key, Any|None default, bool raise_if_present, bool option_removed)
 
list[str] _entity_ids (str|list value, bool allow_uuid)
 
def _KT
 
VolSchemaType _make_entity_service_schema (dict schema, int extra)
 
Callable[[dict], dict] _no_yaml_config_schema (str domain, str issue_base, str translation_key, dict[str, str] translation_placeholders)
 
Any _positive_time_period_template_complex (Any value)
 
Callable[_P, _R] _R (Callable[_P, _R] validator)
 
_T _T (_T value)
 
list[_T]|list[Any] _T (_T|None value)
 
list[_T] _T (list[_T] value)
 
list[_T] _T (list[_T]|_T value)
 
Any _trigger_pre_validator (Any|None value)
 
Any _validate_in_executor (HomeAssistant hass, Callable[[Any], Any] validator, Any value)
 
Any async_validate (HomeAssistant hass, Callable[[Any], Any] validator, Any value)
 
bool boolean (Any value)
 
str color_hex (Any value)
 
Callable[[dict], dict] config_entry_only_config_schema (str domain)
 
str configuration_url (Any value)
 
Any custom_serializer (Any schema)
 
date_sys date (Any value)
 
datetime_sys datetime (Any value)
 
Callable[[dict], dict] deprecated (str key, str|None replacement_key=None, Any|None default=None, bool|None raise_if_present=False)
 
str determine_script_action (dict[str, Any] action)
 
str domain_key (Any config_key)
 
template_helper.Template dynamic_template (Any|None value)
 
Callable[[dict], dict] empty_config_schema (str domain)
 
list[Any] ensure_list (None value)
 
list ensure_list_csv (Any value)
 
Callable[[str|list], list[str]] entities_domain (str|list[str] domain)
 
Callable[[Any], str] entity_domain (str|list[str] domain)
 
str entity_id (Any value)
 
str entity_id_or_uuid (Any value)
 
list[str] entity_ids (str|list value)
 
list[str] entity_ids_or_uuids (str|list value)
 
vol.All enum (type[Enum] enumClass)
 
Any expand_condition_shorthand (Any|None value)
 
str fake_uuid4_hex (Any value)
 
Callable[[dict], dict] has_at_least_one_key (*Any keys)
 
Callable[[dict], dict] has_at_most_one_key (*Any keys)
 
str icon (Any value)
 
bool is_entity_service_schema (VolSchemaType validator)
 
re.Pattern[Any] is_regex (Any value)
 
str isdevice (Any value)
 
str isdir (Any value)
 
str isfile (Any value)
 
Callable[[Any], dict[Hashable, Any]] key_value_schemas (str key, dict[Hashable, VolSchemaType|Callable[[Any], dict[str, Any]]] value_schemas, VolSchemaType|None default_schema=None, str|None default_description=None)
 
VolSchemaType make_entity_service_schema (dict|None schema, *int extra=vol.PREVENT_EXTRA)
 
Callable[[Any], str] matches_regex (str regex)
 
str path (Any value)
 
Callable[[dict], dict] platform_only_config_schema (str domain)
 
timedelta positive_timedelta (timedelta value)
 
Callable[[dict], dict] removed (str key, Any|None default=None, bool|None raise_if_present=True)
 
Callable schema_with_slug_keys (dict|Callable value_schema, *Callable[[Any], str] slug_validator=slug)
 
dict script_action (Any value)
 
str service (Any value)
 
str slug (Any value)
 
str slugify (Any value)
 
object socket_timeout (Any|None value)
 
dict[str, Any] STATE_CONDITION_SCHEMA (Any value)
 
str string (Any value)
 
str string_with_no_html (Any value)
 
UnitOfTemperature temperature_unit (Any value)
 
template_helper.Template template (Any|None value)
 
Any template_complex (Any value)
 
time_sys time (Any value)
 
timedelta time_period_seconds (float|str value)
 
timedelta time_period_str (str value)
 
str time_zone (str value)
 
str url (Any value, frozenset[UrlProtocolSchema] _schema_list=EXTERNAL_URL_PROTOCOL_SCHEMA_LIST)
 
str url_no_path (Any value)
 
str uuid4_hex (Any value)
 
str whitespace (Any value)
 
str x10_address (str value)
 

Variables

 _base_trigger_validator_schema
 
 _COLOR_HEX
 
 _FAKE_UUID_4_HEX
 
 _HAS_ENTITY_SERVICE_FIELD
 
 _hass
 
 _parallel_sequence_action
 
 _SCRIPT_CHOOSE_SCHEMA
 
 _SCRIPT_DELAY_SCHEMA
 
 _SCRIPT_IF_SCHEMA
 
 _SCRIPT_PARALLEL_SCHEMA
 
 _SCRIPT_REPEAT_SCHEMA
 
 _SCRIPT_SCENE_SCHEMA
 
 _SCRIPT_SEQUENCE_SCHEMA
 
 _SCRIPT_SET_CONVERSATION_RESPONSE_SCHEMA
 
 _SCRIPT_SET_SCHEMA
 
 _SCRIPT_STOP_SCHEMA
 
 _SCRIPT_WAIT_FOR_TRIGGER_SCHEMA
 
 _SCRIPT_WAIT_TEMPLATE_SCHEMA
 
 _TIME_PERIOD_DICT_KEYS
 
 ACTIONS_MAP
 
 ACTIONS_SET
 
 ACTIVE_CURRENCIES
 
 AND_CONDITION_SCHEMA
 
 AND_CONDITION_SHORTHAND_SCHEMA
 
 BASE_ENTITY_SCHEMA
 
 byte
 
 comp_entity_ids
 
 comp_entity_ids_or_uuids
 
 CONDITION_SHORTHAND_SCHEMA
 
 CONDITIONS_SCHEMA
 
 CONF_MATCH
 
 CONFIGURATION_URL_PROTOCOL_SCHEMA_LIST
 
 COUNTRIES
 
 country
 
 currency
 
 default
 
 DEVICE_ACTION_BASE_SCHEMA
 
 DEVICE_ACTION_SCHEMA
 
 DEVICE_CONDITION_BASE_SCHEMA
 
 DEVICE_CONDITION_SCHEMA
 
 dynamic_template_condition_action
 
 EVENT_SCHEMA
 
 EXTERNAL_URL_PROTOCOL_SCHEMA_LIST
 
 extra
 
 gps
 
 HISTORIC_CURRENCIES
 
 historic_currency
 
 language
 
 LANGUAGES
 
 latitude
 
 longitude
 
 max
 
 min
 
 msg
 
 NOT_CONDITION_SCHEMA
 
 NOT_CONDITION_SHORTHAND_SCHEMA
 
 NUMERIC_STATE_CONDITION_SCHEMA
 
 NUMERIC_STATE_THRESHOLD_SCHEMA
 
 OR_CONDITION_SCHEMA
 
 OR_CONDITION_SHORTHAND_SCHEMA
 
 PLATFORM_SCHEMA
 
 PLATFORM_SCHEMA_BASE
 
 port
 
 positive_float
 
 positive_int
 
 positive_time_period
 
 positive_time_period_dict
 
 positive_time_period_template
 
 Schema
 
 SCRIPT_ACTION_ACTIVATE_SCENE
 
 SCRIPT_ACTION_CALL_SERVICE
 
 SCRIPT_ACTION_CHECK_CONDITION
 
 SCRIPT_ACTION_CHOOSE
 
 SCRIPT_ACTION_DELAY
 
 SCRIPT_ACTION_DEVICE_AUTOMATION
 
 SCRIPT_ACTION_FIRE_EVENT
 
 SCRIPT_ACTION_IF
 
 SCRIPT_ACTION_PARALLEL
 
 SCRIPT_ACTION_REPEAT
 
 SCRIPT_ACTION_SEQUENCE
 
 SCRIPT_ACTION_SET_CONVERSATION_RESPONSE
 
 SCRIPT_ACTION_STOP
 
 SCRIPT_ACTION_VARIABLES
 
 SCRIPT_ACTION_WAIT_FOR_TRIGGER
 
 SCRIPT_ACTION_WAIT_TEMPLATE
 
 SCRIPT_CONVERSATION_RESPONSE_SCHEMA
 
 SCRIPT_SCHEMA
 
 SCRIPT_VARIABLES_SCHEMA
 
 SERVICE_SCHEMA
 
 small_float
 
 STATE_CONDITION_ATTRIBUTE_SCHEMA
 
 STATE_CONDITION_BASE_SCHEMA
 
 STATE_CONDITION_STATE_SCHEMA
 
 SUN_CONDITION_SCHEMA
 
 sun_event
 
 TARGET_SERVICE_FIELDS
 
 TEMPLATE_CONDITION_SCHEMA
 
 TIME_CONDITION_SCHEMA
 
 time_period
 
 time_period_dict
 
 TIME_PERIOD_ERROR
 
 TRIGGER_BASE_SCHEMA
 
 TRIGGER_CONDITION_SCHEMA
 
 TRIGGER_SCHEMA
 
 VolDictType
 
 weekdays
 
 ZONE_CONDITION_SCHEMA
 

Detailed Description

Helpers for config validation using voluptuous.

Function Documentation

◆ _async_get_hass_or_none()

HomeAssistant | None homeassistant.helpers.config_validation._async_get_hass_or_none ( )
private
Return the HomeAssistant instance or None.

First tries core.async_get_hass_or_none, then _hass which is
set when doing async friendly schema validation.

Definition at line 137 of file config_validation.py.

◆ _backward_compat_service_schema()

Any homeassistant.helpers.config_validation._backward_compat_service_schema ( Any | None  value)
private
Backward compatibility for service schemas.

Definition at line 1436 of file config_validation.py.

◆ _base_trigger_list_flatten()

list[Any] homeassistant.helpers.config_validation._base_trigger_list_flatten ( list[Any]  triggers)
private
Flatten trigger arrays containing 'triggers:' sublists into a single list of triggers.

Definition at line 1813 of file config_validation.py.

◆ _base_trigger_validator()

Any homeassistant.helpers.config_validation._base_trigger_validator ( Any  value)
private

Definition at line 1828 of file config_validation.py.

◆ _custom_serializer()

Any homeassistant.helpers.config_validation._custom_serializer ( Any  schema,
*bool  allow_section 
)
private
Serialize additional types for voluptuous_serialize.

Definition at line 1121 of file config_validation.py.

◆ _deprecated_or_removed()

Callable[[dict], dict] homeassistant.helpers.config_validation._deprecated_or_removed ( str  key,
str | None  replacement_key,
Any | None  default,
bool  raise_if_present,
bool  option_removed 
)
private
Log key as deprecated and provide a replacement (if exists) or fail.

Expected behavior:
    - Outputs or throws the appropriate deprecation warning if key is detected
    - Outputs or throws the appropriate error if key is detected
      and removed from support
    - Processes schema moving the value from key to replacement_key
    - Processes schema changing nothing if only replacement_key provided
    - No warning if only replacement_key provided
    - No warning if neither key nor replacement_key are provided
        - Adds replacement_key with default value in this case

Definition at line 943 of file config_validation.py.

◆ _entity_ids()

list[str] homeassistant.helpers.config_validation._entity_ids ( str | list  value,
bool  allow_uuid 
)
private
Help validate entity IDs or UUIDs.

Definition at line 378 of file config_validation.py.

◆ _KT()

def homeassistant.helpers.config_validation._KT
private

Definition at line 1096 of file config_validation.py.

◆ _make_entity_service_schema()

VolSchemaType homeassistant.helpers.config_validation._make_entity_service_schema ( dict  schema,
int  extra 
)
private
Create an entity service schema.

Definition at line 1362 of file config_validation.py.

◆ _no_yaml_config_schema()

Callable[[dict], dict] homeassistant.helpers.config_validation._no_yaml_config_schema ( str  domain,
str  issue_base,
str  translation_key,
dict[str, str]  translation_placeholders 
)
private
Return a config schema which logs if attempted to setup from YAML.

Definition at line 1214 of file config_validation.py.

◆ _positive_time_period_template_complex()

Any homeassistant.helpers.config_validation._positive_time_period_template_complex ( Any  value)
private
Do basic validation of a positive time period expressed as a templated dict.

Definition at line 788 of file config_validation.py.

◆ _R()

Callable[_P, _R] homeassistant.helpers.config_validation._R ( Callable[_P, _R]  validator)
private
Mark a validator as not async friendly.

This makes validation happen in an executor thread if validation is done by
async_validate, otherwise does nothing.

Definition at line 150 of file config_validation.py.

◆ _T() [1/4]

_T homeassistant.helpers.config_validation._T ( _T  value)
private
Validate that matches all values.

Definition at line 598 of file config_validation.py.

◆ _T() [2/4]

list[_T] | list[Any] homeassistant.helpers.config_validation._T ( _T | None  value)
private
Wrap value in list if it is not one.

Definition at line 353 of file config_validation.py.

◆ _T() [3/4]

list[_T] homeassistant.helpers.config_validation._T ( list  value[_T])
private
Remove falsy values from a list.

Definition at line 346 of file config_validation.py.

◆ _T() [4/4]

list[_T] homeassistant.helpers.config_validation._T ( list[_T] | _T  value)
private

Definition at line 350 of file config_validation.py.

◆ _trigger_pre_validator()

Any homeassistant.helpers.config_validation._trigger_pre_validator ( Any | None  value)
private
Rewrite trigger `trigger` to `platform`.

`platform` has been renamed to `trigger` in user documentation and in the automation
editor. The Python trigger implementation still uses `platform`, so we need to
rename `trigger` to `platform.

Definition at line 1774 of file config_validation.py.

◆ _validate_in_executor()

Any homeassistant.helpers.config_validation._validate_in_executor ( HomeAssistant  hass,
Callable[[Any], Any]  validator,
Any   value 
)
private

Definition at line 2093 of file config_validation.py.

◆ async_validate()

Any homeassistant.helpers.config_validation.async_validate ( HomeAssistant  hass,
Callable[[Any], Any]  validator,
Any   value 
)
Async friendly schema validation.

If a validator decorated with @not_async_friendly is called, validation will be
deferred to an executor. If not, validation will happen in the event loop.

Definition at line 2074 of file config_validation.py.

◆ boolean()

bool homeassistant.helpers.config_validation.boolean ( Any  value)
Validate and coerce a boolean value.

Definition at line 247 of file config_validation.py.

◆ color_hex()

str homeassistant.helpers.config_validation.color_hex ( Any  value)
Validate a hex color code.

Definition at line 492 of file config_validation.py.

◆ config_entry_only_config_schema()

Callable[[dict], dict] homeassistant.helpers.config_validation.config_entry_only_config_schema ( str  domain)
Return a config schema which logs if attempted to setup from YAML.

Use this when an integration's __init__.py defines setup or async_setup
but setup from yaml is not supported.

Definition at line 1255 of file config_validation.py.

◆ configuration_url()

str homeassistant.helpers.config_validation.configuration_url ( Any  value)
Validate an URL that allows the homeassistant schema.

Definition at line 867 of file config_validation.py.

◆ custom_serializer()

Any homeassistant.helpers.config_validation.custom_serializer ( Any  schema)
Serialize additional types for voluptuous_serialize.

Definition at line 1116 of file config_validation.py.

◆ date()

date_sys homeassistant.helpers.config_validation.date ( Any  value)
Validate and transform a date.

Definition at line 536 of file config_validation.py.

◆ datetime()

datetime_sys homeassistant.helpers.config_validation.datetime ( Any  value)
Validate datetime.

Definition at line 809 of file config_validation.py.

◆ deprecated()

Callable[[dict], dict] homeassistant.helpers.config_validation.deprecated ( str  key,
str | None   replacement_key = None,
Any | None   default = None,
bool | None   raise_if_present = False 
)
Log key as deprecated and provide a replacement (if exists).

Expected behavior:
    - Outputs the appropriate deprecation warning if key is detected
      or raises an exception
    - Processes schema moving the value from key to replacement_key
    - Processes schema changing nothing if only replacement_key provided
    - No warning if only replacement_key provided
    - No warning if neither key nor replacement_key are provided
        - Adds replacement_key with default value in this case

Definition at line 1013 of file config_validation.py.

◆ determine_script_action()

str homeassistant.helpers.config_validation.determine_script_action ( dict[str, Any]  action)
Determine action type.

Definition at line 2028 of file config_validation.py.

◆ domain_key()

str homeassistant.helpers.config_validation.domain_key ( Any  config_key)
Validate a top level config key with an optional label and return the domain.

A domain is separated from a label by one or more spaces, empty labels are not
allowed.

Examples:
'hue' returns 'hue'
'hue 1' returns 'hue'
'hue  1' returns 'hue'
'hue ' raises
'hue  ' raises

Definition at line 410 of file config_validation.py.

◆ dynamic_template()

template_helper.Template homeassistant.helpers.config_validation.dynamic_template ( Any | None  value)
Validate a dynamic (non static) jinja2 template.

Definition at line 741 of file config_validation.py.

◆ empty_config_schema()

Callable[[dict], dict] homeassistant.helpers.config_validation.empty_config_schema ( str  domain)
Return a config schema which logs if there are configuration parameters.

Definition at line 1195 of file config_validation.py.

◆ ensure_list()

list[Any] homeassistant.helpers.config_validation.ensure_list ( None  value)

Definition at line 342 of file config_validation.py.

◆ ensure_list_csv()

list homeassistant.helpers.config_validation.ensure_list_csv ( Any  value)
Ensure that input is a list or make one from comma-separated string.

Definition at line 917 of file config_validation.py.

◆ entities_domain()

Callable[[str | list], list[str]] homeassistant.helpers.config_validation.entities_domain ( str | list[str]  domain)
Validate that entities belong to domain.

Definition at line 449 of file config_validation.py.

◆ entity_domain()

Callable[[Any], str] homeassistant.helpers.config_validation.entity_domain ( str | list[str]  domain)
Validate that entity belong to domain.

Definition at line 435 of file config_validation.py.

◆ entity_id()

str homeassistant.helpers.config_validation.entity_id ( Any  value)
Validate Entity ID.

Definition at line 360 of file config_validation.py.

◆ entity_id_or_uuid()

str homeassistant.helpers.config_validation.entity_id_or_uuid ( Any  value)
Validate Entity specified by entity_id or uuid.

Definition at line 369 of file config_validation.py.

◆ entity_ids()

list[str] homeassistant.helpers.config_validation.entity_ids ( str | list  value)
Validate Entity IDs.

Definition at line 389 of file config_validation.py.

◆ entity_ids_or_uuids()

list[str] homeassistant.helpers.config_validation.entity_ids_or_uuids ( str | list  value)
Validate entities specified by entity IDs or UUIDs.

Definition at line 394 of file config_validation.py.

◆ enum()

vol.All homeassistant.helpers.config_validation.enum ( type[Enum]  enumClass)
Create validator for specified enum.

Definition at line 474 of file config_validation.py.

◆ expand_condition_shorthand()

Any homeassistant.helpers.config_validation.expand_condition_shorthand ( Any | None  value)
Expand boolean condition shorthand notations.

Definition at line 1159 of file config_validation.py.

◆ fake_uuid4_hex()

str homeassistant.helpers.config_validation.fake_uuid4_hex ( Any  value)
Validate a fake v4 UUID generated by random_uuid_hex.

Definition at line 907 of file config_validation.py.

◆ has_at_least_one_key()

Callable[[dict], dict] homeassistant.helpers.config_validation.has_at_least_one_key ( *Any  keys)
Validate that at least one key exists.

Definition at line 214 of file config_validation.py.

◆ has_at_most_one_key()

Callable[[dict], dict] homeassistant.helpers.config_validation.has_at_most_one_key ( *Any  keys)
Validate that zero keys exist or one key exists.

Definition at line 231 of file config_validation.py.

◆ icon()

str homeassistant.helpers.config_validation.icon ( Any  value)
Validate icon.

Definition at line 479 of file config_validation.py.

◆ is_entity_service_schema()

bool homeassistant.helpers.config_validation.is_entity_service_schema ( VolSchemaType  validator)
Check if the passed validator is an entity schema validator.

The validator must be either of:
- A validator returned by cv._make_entity_service_schema
- A validator returned by cv._make_entity_service_schema, wrapped in a vol.Schema
- A validator returned by cv._make_entity_service_schema, wrapped in a vol.All
Nesting is allowed.

Definition at line 1343 of file config_validation.py.

◆ is_regex()

re.Pattern[Any] homeassistant.helpers.config_validation.is_regex ( Any  value)
Validate that a string is a valid regular expression.

Definition at line 300 of file config_validation.py.

◆ isdevice()

str homeassistant.helpers.config_validation.isdevice ( Any  value)
Validate that value is a real device.

Definition at line 272 of file config_validation.py.

◆ isdir()

str homeassistant.helpers.config_validation.isdir ( Any  value)
Validate that the value is an existing dir.

Definition at line 328 of file config_validation.py.

◆ isfile()

str homeassistant.helpers.config_validation.isfile ( Any  value)
Validate that the value is an existing file.

Definition at line 314 of file config_validation.py.

◆ key_value_schemas()

Callable[[Any], dict[Hashable, Any]] homeassistant.helpers.config_validation.key_value_schemas ( str  key,
dict[Hashable, VolSchemaType | Callable[[Any], dict[str, Any]]]  value_schemas,
VolSchemaType | None   default_schema = None,
str | None   default_description = None 
)
Create a validator that validates based on a value for specific key.

This gives better error messages.

Definition at line 1059 of file config_validation.py.

◆ make_entity_service_schema()

VolSchemaType homeassistant.helpers.config_validation.make_entity_service_schema ( dict | None  schema,
*int   extra = vol.PREVENT_EXTRA 
)
Create an entity service schema.

Definition at line 1383 of file config_validation.py.

◆ matches_regex()

Callable[[Any], str] homeassistant.helpers.config_validation.matches_regex ( str  regex)
Validate that the value is a string that matches a regex.

Definition at line 281 of file config_validation.py.

◆ path()

str homeassistant.helpers.config_validation.path ( Any  value)
Validate it's a safe path.

Definition at line 199 of file config_validation.py.

◆ platform_only_config_schema()

Callable[[dict], dict] homeassistant.helpers.config_validation.platform_only_config_schema ( str  domain)
Return a config schema which logs if attempted to setup from YAML.

Use this when an integration's __init__.py defines setup or async_setup
but setup from the integration key is not supported.

Definition at line 1270 of file config_validation.py.

◆ positive_timedelta()

timedelta homeassistant.helpers.config_validation.positive_timedelta ( timedelta  value)
Validate timedelta is positive.

Definition at line 603 of file config_validation.py.

◆ removed()

Callable[[dict], dict] homeassistant.helpers.config_validation.removed ( str  key,
Any | None   default = None,
bool | None   raise_if_present = True 
)
Log key as deprecated and fail the config validation.

Expected behavior:
    - Outputs the appropriate error if key is detected and removed from
      support or raises an exception.

Definition at line 1039 of file config_validation.py.

◆ schema_with_slug_keys()

Callable homeassistant.helpers.config_validation.schema_with_slug_keys ( dict | Callable  value_schema,
*Callable[[Any], str]   slug_validator = slug 
)
Ensure dicts have slugs as keys.

Replacement of vol.Schema({cv.slug: value_schema}) to prevent misleading
"Extra keys" errors from voluptuous.

Definition at line 640 of file config_validation.py.

◆ script_action()

dict homeassistant.helpers.config_validation.script_action ( Any  value)
Validate a script action.

Definition at line 1405 of file config_validation.py.

◆ service()

str homeassistant.helpers.config_validation.service ( Any  value)
Validate service.

Definition at line 619 of file config_validation.py.

◆ slug()

str homeassistant.helpers.config_validation.slug ( Any  value)
Validate value is a valid slug.

Definition at line 629 of file config_validation.py.

◆ slugify()

str homeassistant.helpers.config_validation.slugify ( Any  value)
Coerce a value to a slug.

Definition at line 663 of file config_validation.py.

◆ socket_timeout()

object homeassistant.helpers.config_validation.socket_timeout ( Any | None  value)
Validate timeout float > 0.0.

None coerced to socket._GLOBAL_DEFAULT_TIMEOUT bare object.

Definition at line 838 of file config_validation.py.

◆ STATE_CONDITION_SCHEMA()

dict[str, Any] homeassistant.helpers.config_validation.STATE_CONDITION_SCHEMA ( Any  value)
Validate a state condition.

Definition at line 1534 of file config_validation.py.

◆ string()

str homeassistant.helpers.config_validation.string ( Any  value)
Coerce value to string, except for None.

Definition at line 673 of file config_validation.py.

◆ string_with_no_html()

str homeassistant.helpers.config_validation.string_with_no_html ( Any  value)
Validate that the value is a string without HTML.

Definition at line 695 of file config_validation.py.

◆ temperature_unit()

UnitOfTemperature homeassistant.helpers.config_validation.temperature_unit ( Any  value)
Validate and transform temperature unit.

Definition at line 704 of file config_validation.py.

◆ template()

template_helper.Template homeassistant.helpers.config_validation.template ( Any | None  value)
Validate a jinja2 template.

Definition at line 714 of file config_validation.py.

◆ template_complex()

Any homeassistant.helpers.config_validation.template_complex ( Any  value)
Validate a complex jinja2 template.

Definition at line 770 of file config_validation.py.

◆ time()

time_sys homeassistant.helpers.config_validation.time ( Any  value)
Validate and transform a time.

Definition at line 520 of file config_validation.py.

◆ time_period_seconds()

timedelta homeassistant.helpers.config_validation.time_period_seconds ( float | str  value)
Validate and transform seconds to a time offset.

Definition at line 587 of file config_validation.py.

◆ time_period_str()

timedelta homeassistant.helpers.config_validation.time_period_str ( str  value)
Validate and transform time offset.

Definition at line 552 of file config_validation.py.

◆ time_zone()

str homeassistant.helpers.config_validation.time_zone ( str  value)
Validate timezone.

Definition at line 825 of file config_validation.py.

◆ url()

str homeassistant.helpers.config_validation.url ( Any  value,
frozenset[UrlProtocolSchema]   _schema_list = EXTERNAL_URL_PROTOCOL_SCHEMA_LIST 
)
Validate an URL.

Definition at line 854 of file config_validation.py.

◆ url_no_path()

str homeassistant.helpers.config_validation.url_no_path ( Any  value)
Validate a url without a path.

Definition at line 872 of file config_validation.py.

◆ uuid4_hex()

str homeassistant.helpers.config_validation.uuid4_hex ( Any  value)
Validate a v4 UUID in hex format.

Definition at line 890 of file config_validation.py.

◆ whitespace()

str homeassistant.helpers.config_validation.whitespace ( Any  value)
Validate result contains only whitespace.

Definition at line 263 of file config_validation.py.

◆ x10_address()

str homeassistant.helpers.config_validation.x10_address ( str  value)
Validate an x10 address.

Definition at line 882 of file config_validation.py.

Variable Documentation

◆ _base_trigger_validator_schema

homeassistant.helpers.config_validation._base_trigger_validator_schema
private

Definition at line 1810 of file config_validation.py.

◆ _COLOR_HEX

homeassistant.helpers.config_validation._COLOR_HEX
private

Definition at line 489 of file config_validation.py.

◆ _FAKE_UUID_4_HEX

homeassistant.helpers.config_validation._FAKE_UUID_4_HEX
private

Definition at line 904 of file config_validation.py.

◆ _HAS_ENTITY_SERVICE_FIELD

homeassistant.helpers.config_validation._HAS_ENTITY_SERVICE_FIELD
private

Definition at line 1340 of file config_validation.py.

◆ _hass

homeassistant.helpers.config_validation._hass
private

Definition at line 133 of file config_validation.py.

◆ _parallel_sequence_action

homeassistant.helpers.config_validation._parallel_sequence_action
private

Definition at line 1965 of file config_validation.py.

◆ _SCRIPT_CHOOSE_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_CHOOSE_SCHEMA
private

Definition at line 1892 of file config_validation.py.

◆ _SCRIPT_DELAY_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_DELAY_SCHEMA
private

Definition at line 1839 of file config_validation.py.

◆ _SCRIPT_IF_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_IF_SCHEMA
private

Definition at line 1920 of file config_validation.py.

◆ _SCRIPT_PARALLEL_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_PARALLEL_SCHEMA
private

Definition at line 1973 of file config_validation.py.

◆ _SCRIPT_REPEAT_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_REPEAT_SCHEMA
private

Definition at line 1870 of file config_validation.py.

◆ _SCRIPT_SCENE_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_SCENE_SCHEMA
private

Definition at line 1866 of file config_validation.py.

◆ _SCRIPT_SEQUENCE_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_SEQUENCE_SCHEMA
private

Definition at line 1958 of file config_validation.py.

◆ _SCRIPT_SET_CONVERSATION_RESPONSE_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_SET_CONVERSATION_RESPONSE_SCHEMA
private

Definition at line 1936 of file config_validation.py.

◆ _SCRIPT_SET_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_SET_SCHEMA
private

Definition at line 1929 of file config_validation.py.

◆ _SCRIPT_STOP_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_STOP_SCHEMA
private

Definition at line 1945 of file config_validation.py.

◆ _SCRIPT_WAIT_FOR_TRIGGER_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_WAIT_FOR_TRIGGER_SCHEMA
private

Definition at line 1911 of file config_validation.py.

◆ _SCRIPT_WAIT_TEMPLATE_SCHEMA

homeassistant.helpers.config_validation._SCRIPT_WAIT_TEMPLATE_SCHEMA
private

Definition at line 1846 of file config_validation.py.

◆ _TIME_PERIOD_DICT_KEYS

homeassistant.helpers.config_validation._TIME_PERIOD_DICT_KEYS
private

Definition at line 502 of file config_validation.py.

◆ ACTIONS_MAP

homeassistant.helpers.config_validation.ACTIONS_MAP

Definition at line 2001 of file config_validation.py.

◆ ACTIONS_SET

homeassistant.helpers.config_validation.ACTIONS_SET

Definition at line 2025 of file config_validation.py.

◆ ACTIVE_CURRENCIES

homeassistant.helpers.config_validation.ACTIVE_CURRENCIES

Definition at line 2062 of file config_validation.py.

◆ AND_CONDITION_SCHEMA

homeassistant.helpers.config_validation.AND_CONDITION_SCHEMA

Definition at line 1608 of file config_validation.py.

◆ AND_CONDITION_SHORTHAND_SCHEMA

homeassistant.helpers.config_validation.AND_CONDITION_SHORTHAND_SCHEMA

Definition at line 1620 of file config_validation.py.

◆ BASE_ENTITY_SCHEMA

homeassistant.helpers.config_validation.BASE_ENTITY_SCHEMA

Definition at line 1380 of file config_validation.py.

◆ byte

homeassistant.helpers.config_validation.byte

Definition at line 184 of file config_validation.py.

◆ comp_entity_ids

homeassistant.helpers.config_validation.comp_entity_ids

Definition at line 399 of file config_validation.py.

◆ comp_entity_ids_or_uuids

homeassistant.helpers.config_validation.comp_entity_ids_or_uuids

Definition at line 404 of file config_validation.py.

◆ CONDITION_SHORTHAND_SCHEMA

homeassistant.helpers.config_validation.CONDITION_SHORTHAND_SCHEMA

Definition at line 1698 of file config_validation.py.

◆ CONDITIONS_SCHEMA

homeassistant.helpers.config_validation.CONDITIONS_SCHEMA

Definition at line 1734 of file config_validation.py.

◆ CONF_MATCH

homeassistant.helpers.config_validation.CONF_MATCH

Definition at line 1509 of file config_validation.py.

◆ CONFIGURATION_URL_PROTOCOL_SCHEMA_LIST

homeassistant.helpers.config_validation.CONFIGURATION_URL_PROTOCOL_SCHEMA_LIST

Definition at line 179 of file config_validation.py.

◆ COUNTRIES

homeassistant.helpers.config_validation.COUNTRIES

Definition at line 2069 of file config_validation.py.

◆ country

homeassistant.helpers.config_validation.country

Definition at line 2069 of file config_validation.py.

◆ currency

homeassistant.helpers.config_validation.currency

Definition at line 2061 of file config_validation.py.

◆ default

homeassistant.helpers.config_validation.default

Definition at line 1509 of file config_validation.py.

◆ DEVICE_ACTION_BASE_SCHEMA

homeassistant.helpers.config_validation.DEVICE_ACTION_BASE_SCHEMA

Definition at line 1855 of file config_validation.py.

◆ DEVICE_ACTION_SCHEMA

homeassistant.helpers.config_validation.DEVICE_ACTION_SCHEMA

Definition at line 1864 of file config_validation.py.

◆ DEVICE_CONDITION_BASE_SCHEMA

homeassistant.helpers.config_validation.DEVICE_CONDITION_BASE_SCHEMA

Definition at line 1677 of file config_validation.py.

◆ DEVICE_CONDITION_SCHEMA

homeassistant.helpers.config_validation.DEVICE_CONDITION_SCHEMA

Definition at line 1687 of file config_validation.py.

◆ dynamic_template_condition_action

homeassistant.helpers.config_validation.dynamic_template_condition_action

Definition at line 1689 of file config_validation.py.

◆ EVENT_SCHEMA

homeassistant.helpers.config_validation.EVENT_SCHEMA

Definition at line 1426 of file config_validation.py.

◆ EXTERNAL_URL_PROTOCOL_SCHEMA_LIST

homeassistant.helpers.config_validation.EXTERNAL_URL_PROTOCOL_SCHEMA_LIST

Definition at line 176 of file config_validation.py.

◆ extra

homeassistant.helpers.config_validation.extra

Definition at line 1293 of file config_validation.py.

◆ gps

homeassistant.helpers.config_validation.gps

Definition at line 194 of file config_validation.py.

◆ HISTORIC_CURRENCIES

homeassistant.helpers.config_validation.HISTORIC_CURRENCIES

Definition at line 2066 of file config_validation.py.

◆ historic_currency

homeassistant.helpers.config_validation.historic_currency

Definition at line 2065 of file config_validation.py.

◆ language

homeassistant.helpers.config_validation.language

Definition at line 2071 of file config_validation.py.

◆ LANGUAGES

homeassistant.helpers.config_validation.LANGUAGES

Definition at line 2071 of file config_validation.py.

◆ latitude

homeassistant.helpers.config_validation.latitude

Definition at line 188 of file config_validation.py.

◆ longitude

homeassistant.helpers.config_validation.longitude

Definition at line 191 of file config_validation.py.

◆ max

homeassistant.helpers.config_validation.max

Definition at line 184 of file config_validation.py.

◆ min

homeassistant.helpers.config_validation.min

Definition at line 184 of file config_validation.py.

◆ msg

homeassistant.helpers.config_validation.msg

Definition at line 189 of file config_validation.py.

◆ NOT_CONDITION_SCHEMA

homeassistant.helpers.config_validation.NOT_CONDITION_SCHEMA

Definition at line 1654 of file config_validation.py.

◆ NOT_CONDITION_SHORTHAND_SCHEMA

homeassistant.helpers.config_validation.NOT_CONDITION_SHORTHAND_SCHEMA

Definition at line 1666 of file config_validation.py.

◆ NUMERIC_STATE_CONDITION_SCHEMA

homeassistant.helpers.config_validation.NUMERIC_STATE_CONDITION_SCHEMA

Definition at line 1490 of file config_validation.py.

◆ NUMERIC_STATE_THRESHOLD_SCHEMA

homeassistant.helpers.config_validation.NUMERIC_STATE_THRESHOLD_SCHEMA

Definition at line 1480 of file config_validation.py.

◆ OR_CONDITION_SCHEMA

homeassistant.helpers.config_validation.OR_CONDITION_SCHEMA

Definition at line 1631 of file config_validation.py.

◆ OR_CONDITION_SHORTHAND_SCHEMA

homeassistant.helpers.config_validation.OR_CONDITION_SHORTHAND_SCHEMA

Definition at line 1643 of file config_validation.py.

◆ PLATFORM_SCHEMA

homeassistant.helpers.config_validation.PLATFORM_SCHEMA

Definition at line 1285 of file config_validation.py.

◆ PLATFORM_SCHEMA_BASE

homeassistant.helpers.config_validation.PLATFORM_SCHEMA_BASE

Definition at line 1293 of file config_validation.py.

◆ port

homeassistant.helpers.config_validation.port

Definition at line 196 of file config_validation.py.

◆ positive_float

homeassistant.helpers.config_validation.positive_float

Definition at line 187 of file config_validation.py.

◆ positive_int

homeassistant.helpers.config_validation.positive_int

Definition at line 186 of file config_validation.py.

◆ positive_time_period

homeassistant.helpers.config_validation.positive_time_period

Definition at line 611 of file config_validation.py.

◆ positive_time_period_dict

homeassistant.helpers.config_validation.positive_time_period_dict

Definition at line 610 of file config_validation.py.

◆ positive_time_period_template

homeassistant.helpers.config_validation.positive_time_period_template

Definition at line 804 of file config_validation.py.

◆ Schema

homeassistant.helpers.config_validation.Schema

Definition at line 1709 of file config_validation.py.

◆ SCRIPT_ACTION_ACTIVATE_SCENE

homeassistant.helpers.config_validation.SCRIPT_ACTION_ACTIVATE_SCENE

Definition at line 1983 of file config_validation.py.

◆ SCRIPT_ACTION_CALL_SERVICE

homeassistant.helpers.config_validation.SCRIPT_ACTION_CALL_SERVICE

Definition at line 1984 of file config_validation.py.

◆ SCRIPT_ACTION_CHECK_CONDITION

homeassistant.helpers.config_validation.SCRIPT_ACTION_CHECK_CONDITION

Definition at line 1985 of file config_validation.py.

◆ SCRIPT_ACTION_CHOOSE

homeassistant.helpers.config_validation.SCRIPT_ACTION_CHOOSE

Definition at line 1986 of file config_validation.py.

◆ SCRIPT_ACTION_DELAY

homeassistant.helpers.config_validation.SCRIPT_ACTION_DELAY

Definition at line 1987 of file config_validation.py.

◆ SCRIPT_ACTION_DEVICE_AUTOMATION

homeassistant.helpers.config_validation.SCRIPT_ACTION_DEVICE_AUTOMATION

Definition at line 1988 of file config_validation.py.

◆ SCRIPT_ACTION_FIRE_EVENT

homeassistant.helpers.config_validation.SCRIPT_ACTION_FIRE_EVENT

Definition at line 1989 of file config_validation.py.

◆ SCRIPT_ACTION_IF

homeassistant.helpers.config_validation.SCRIPT_ACTION_IF

Definition at line 1990 of file config_validation.py.

◆ SCRIPT_ACTION_PARALLEL

homeassistant.helpers.config_validation.SCRIPT_ACTION_PARALLEL

Definition at line 1991 of file config_validation.py.

◆ SCRIPT_ACTION_REPEAT

homeassistant.helpers.config_validation.SCRIPT_ACTION_REPEAT

Definition at line 1992 of file config_validation.py.

◆ SCRIPT_ACTION_SEQUENCE

homeassistant.helpers.config_validation.SCRIPT_ACTION_SEQUENCE

Definition at line 1993 of file config_validation.py.

◆ SCRIPT_ACTION_SET_CONVERSATION_RESPONSE

homeassistant.helpers.config_validation.SCRIPT_ACTION_SET_CONVERSATION_RESPONSE

Definition at line 1994 of file config_validation.py.

◆ SCRIPT_ACTION_STOP

homeassistant.helpers.config_validation.SCRIPT_ACTION_STOP

Definition at line 1995 of file config_validation.py.

◆ SCRIPT_ACTION_VARIABLES

homeassistant.helpers.config_validation.SCRIPT_ACTION_VARIABLES

Definition at line 1996 of file config_validation.py.

◆ SCRIPT_ACTION_WAIT_FOR_TRIGGER

homeassistant.helpers.config_validation.SCRIPT_ACTION_WAIT_FOR_TRIGGER

Definition at line 1997 of file config_validation.py.

◆ SCRIPT_ACTION_WAIT_TEMPLATE

homeassistant.helpers.config_validation.SCRIPT_ACTION_WAIT_TEMPLATE

Definition at line 1998 of file config_validation.py.

◆ SCRIPT_CONVERSATION_RESPONSE_SCHEMA

homeassistant.helpers.config_validation.SCRIPT_CONVERSATION_RESPONSE_SCHEMA

Definition at line 1395 of file config_validation.py.

◆ SCRIPT_SCHEMA

homeassistant.helpers.config_validation.SCRIPT_SCHEMA

Definition at line 1418 of file config_validation.py.

◆ SCRIPT_VARIABLES_SCHEMA

homeassistant.helpers.config_validation.SCRIPT_VARIABLES_SCHEMA

Definition at line 1398 of file config_validation.py.

◆ SERVICE_SCHEMA

homeassistant.helpers.config_validation.SERVICE_SCHEMA

Definition at line 1453 of file config_validation.py.

◆ small_float

homeassistant.helpers.config_validation.small_float

Definition at line 185 of file config_validation.py.

◆ STATE_CONDITION_ATTRIBUTE_SCHEMA

homeassistant.helpers.config_validation.STATE_CONDITION_ATTRIBUTE_SCHEMA

Definition at line 1526 of file config_validation.py.

◆ STATE_CONDITION_BASE_SCHEMA

homeassistant.helpers.config_validation.STATE_CONDITION_BASE_SCHEMA

Definition at line 1505 of file config_validation.py.

◆ STATE_CONDITION_STATE_SCHEMA

homeassistant.helpers.config_validation.STATE_CONDITION_STATE_SCHEMA

Definition at line 1519 of file config_validation.py.

◆ SUN_CONDITION_SCHEMA

homeassistant.helpers.config_validation.SUN_CONDITION_SCHEMA

Definition at line 1547 of file config_validation.py.

◆ sun_event

homeassistant.helpers.config_validation.sun_event

Definition at line 195 of file config_validation.py.

◆ TARGET_SERVICE_FIELDS

homeassistant.helpers.config_validation.TARGET_SERVICE_FIELDS

Definition at line 1316 of file config_validation.py.

◆ TEMPLATE_CONDITION_SCHEMA

homeassistant.helpers.config_validation.TEMPLATE_CONDITION_SCHEMA

Definition at line 1563 of file config_validation.py.

◆ TIME_CONDITION_SCHEMA

homeassistant.helpers.config_validation.TIME_CONDITION_SCHEMA

Definition at line 1571 of file config_validation.py.

◆ time_period

homeassistant.helpers.config_validation.time_period

Definition at line 595 of file config_validation.py.

◆ time_period_dict

homeassistant.helpers.config_validation.time_period_dict

Definition at line 504 of file config_validation.py.

◆ TIME_PERIOD_ERROR

homeassistant.helpers.config_validation.TIME_PERIOD_ERROR

Definition at line 120 of file config_validation.py.

◆ TRIGGER_BASE_SCHEMA

homeassistant.helpers.config_validation.TRIGGER_BASE_SCHEMA

Definition at line 1799 of file config_validation.py.

◆ TRIGGER_CONDITION_SCHEMA

homeassistant.helpers.config_validation.TRIGGER_CONDITION_SCHEMA

Definition at line 1588 of file config_validation.py.

◆ TRIGGER_SCHEMA

homeassistant.helpers.config_validation.TRIGGER_SCHEMA

Definition at line 1833 of file config_validation.py.

◆ VolDictType

homeassistant.helpers.config_validation.VolDictType

Definition at line 1295 of file config_validation.py.

◆ weekdays

homeassistant.helpers.config_validation.weekdays

Definition at line 835 of file config_validation.py.

◆ ZONE_CONDITION_SCHEMA

homeassistant.helpers.config_validation.ZONE_CONDITION_SCHEMA

Definition at line 1596 of file config_validation.py.