Input Text


The input_text component allows the user to define values that can be controlled via the frontend and can be used within conditions of automation. Changes to the value stored in the text box generate state events. These state events can be utilized as automation triggers as well. It can also be configured in password mode (obscured text).

# 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

input_text

(map)(Required)Alias for the input. Multiple entries are allowed.

name

(String)(Optional)Friendly name of the text input.

min

(int)(Optional)Minimum length for the text value.

Default value: 0

max

(int)(Optional)Maximum length for the text value.

Default value: 100

initial

(String)(Optional)Initial value when Home Assistant starts.

Default value: empty

pattern

(String)(Optional)Regex pattern for client side validation.

Default value: empty

mode

(String)(Optional)Can specify text or password. Elements of type “password” provide a way for the user to securely enter a value.

Default value: text

Restore State

This component will automatically restore the state it had prior to Home Assistant stopping as long as you have the recorder component enabled and your entity does not have a set value for initial. To disable this feature, set a valid value for initial. Additional information can be found in the Restore state section of the recorder component documentation.