Input text
The Input text integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] lets you create a text helperA helper is a virtual entity you create inside Home Assistant. It is not backed by a physical device. Helpers store values, track state, or do calculations that your automations and dashboards need. [Learn more]: an entity that stores a text value you can set yourself. Because the value is not tied to a physical device, you can use it as an adjustable text setting for your automations, scripts, and dashboards. For example, you can create a text helper to store a status message, a name, or a code. It can also be set to password mode, which obscures the text as you type.
On a dashboard, a text helper appears as a text box you can type into. Each time the value changes, Home Assistant records a new stateThe state holds the information of interest of an entity, for example, if a light is on or off. Each entity has exactly one state and the state only holds one value at a time. However, entities can store attributes related to that state such as brightness, color, or a unit of measurement. [Learn more], which you can use as a trigger or a condition in your automations. Your automations and scripts can also change the value, which makes a text helper a convenient way to share a setting between the UI and your automations.
Creating a text helper
The preferred way to create a text helper is through the user interface.
- Go to Settings > Devices & services > Helpers, and select Create helper.
- Select Text.
It can also be configured via configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]:
# Example configuration.yaml entries
input_text:
text1:
name: Text 1
initial: Some Text
text2:
name: Text 2
min: 8
max: 40
text3:
name: Text 3
pattern: "[a-fA-F0-9]*"
text4:
name: Text 4
mode: password
Configuration Variables
Alias for the input. Multiple entries are allowed.
Maximum length for the text value. 255 is the maximum number of characters allowed in an entity state.
Icon to display in front of the input element in the frontend.
Restore state
If you set a valid value for initial this integration will start with state set to that value. Otherwise, it will restore the state it had before Home Assistant stopping.
Scenes
To set the state of the input_text in a Scene:
# Example configuration.yaml entry
scene:
- name: Example1
entities:
input_text.example: Hello!
List of triggers
The Input text integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following triggers. Each link below opens a dedicated page with examples, fields, and a step-by-step UI walkthrough.
-
Text changed (
text.changed) Triggers when the value of one or more text entities changes.
For an overview of every trigger across all integrations, see the triggers reference.
List of conditions
The Input text integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following conditions. Each link below opens a dedicated page with examples, fields, and a step-by-step UI walkthrough.
-
Text is equal to (
text.is_equal_to) Tests if one or more text entities are equal to a specified value.
For an overview of every condition across all integrations, see the conditions reference.
List of actions
The Input text integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.
-
Reload input texts (
input_text.reload) Reloads the input text helpers from the YAML configuration. -
Set input text value (
input_text.set_value) Sets the value of an input text.
For an overview of every action across all integrations, see the actions reference.
Automation examples
Here’s an example using input_text in an action in an automation.
# Example configuration.yaml entry using 'input_text' in an action in an automation
input_select:
scene_bedroom:
name: Scene
options:
- Select
- Concentrate
- Energize
- Reading
- Relax
- 'OFF'
initial: "Select"
input_text:
bedroom:
name: Brightness
automation:
- alias: "Bedroom Light - Custom"
triggers:
- trigger: state
entity_id: input_select.scene_bedroom
actions:
- action: input_text.set_value
target:
entity_id: input_text.bedroom
data:
value: "{{ states('input_select.scene_bedroom') }}"
Troubleshooting
The Text helper option is missing from the user interface
Symptom
When you go to Settings > Devices & services > Helpers to add a helper, the Text option is not listed.
Description
Text helpers are provided through default_config:, which is part of your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] by default. If you removed default_config:, the option is no longer available.
Resolution
- Add
input_text:to yourconfiguration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]. - Restart Home Assistant.
- After the restart, create your text helpers from the user interface.