home-assistant.github.io/source/_components/input_text.markdown
BioSehnsucht 7c2602a389 Add input_text component (#3301)
* Add input_text component

* Update version
2017-09-05 09:05:05 -07:00

1.5 KiB

layout title description date sidebar comments sharing footer logo ha_category ha_release
page Input Text Instructions how to integrate the Input Text component into Home Assistant. 2016-03-15 06:00 true false true true home-assistant.png Automation 0.53

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.

# 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]*'
  test4:
    name: Text 4
    initial: Can't Touch This
    disabled: true

Configuration variables:

  • [alias] (Required): Alias for the text input.
  • min (Optional): Minimum length for the text value. Default is 0.
  • max (Optional): Maximum length for the text value. Default is 100.
  • name (Optional): Friendly name of the text input.
  • initial (Optional): Initial value when Home Assistant starts. Default is empty string.
  • pattern (Optional): Regex pattern for client side validation. Default is empty string, which is treated same as .*.
  • disabled (Optional): If set to true, disables making changes from the UI (but not by automations / REST / etc), displaying the value grayed out to indicate it is read-only in the UI. Default is false.