mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-09 10:26:52 +00:00
Document template.select platform (#19062)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
d942acf19b
commit
2cf5f81d03
@ -11,7 +11,6 @@ ha_codeowners:
|
|||||||
- '@home-assistant/core'
|
- '@home-assistant/core'
|
||||||
- '@PhracturedBlue'
|
- '@PhracturedBlue'
|
||||||
- '@tetienne'
|
- '@tetienne'
|
||||||
- '@home-assistant/core'
|
|
||||||
ha_domain: template
|
ha_domain: template
|
||||||
ha_platforms:
|
ha_platforms:
|
||||||
- alarm_control_panel
|
- alarm_control_panel
|
||||||
@ -21,6 +20,7 @@ ha_platforms:
|
|||||||
- light
|
- light
|
||||||
- lock
|
- lock
|
||||||
- number
|
- number
|
||||||
|
- select
|
||||||
- sensor
|
- sensor
|
||||||
- switch
|
- switch
|
||||||
- vacuum
|
- vacuum
|
||||||
@ -29,7 +29,7 @@ ha_platforms:
|
|||||||
|
|
||||||
The `template` integration allows creating entities which derive their values from other data. This is done by specifying [templates](/docs/configuration/templating/) for properties of an entity, like the name or the state.
|
The `template` integration allows creating entities which derive their values from other data. This is done by specifying [templates](/docs/configuration/templating/) for properties of an entity, like the name or the state.
|
||||||
|
|
||||||
Sensors, binary (on/off) sensors, and numbers are covered on this page. For other types, please see the specific pages:
|
Sensors, binary (on/off) sensors, numbers and selects are covered on this page. For other types, please see the specific pages:
|
||||||
|
|
||||||
- [Alarm Control Panel](/integrations/alarm_control_panel.template/)
|
- [Alarm Control Panel](/integrations/alarm_control_panel.template/)
|
||||||
- [Cover](/integrations/cover.template/)
|
- [Cover](/integrations/cover.template/)
|
||||||
@ -40,7 +40,7 @@ Sensors, binary (on/off) sensors, and numbers are covered on this page. For othe
|
|||||||
- [Vacuum](/integrations/vacuum.template/)
|
- [Vacuum](/integrations/vacuum.template/)
|
||||||
- [Weather](/integrations/weather.template/)
|
- [Weather](/integrations/weather.template/)
|
||||||
|
|
||||||
Sensor, binary sensor, and number template entities are defined in your YAML configuration files, directly under the `template:` key and cannot be configured via the UI. You can define multiple configuration blocks as a list. Each block defines sensor/binary sensor/number entities and can contain an optional update trigger.
|
Sensor, binary sensor, number and select template entities are defined in your YAML configuration files, directly under the `template:` key and cannot be configured via the UI. You can define multiple configuration blocks as a list. Each block defines sensor/binary sensor/number entities and can contain an optional update trigger.
|
||||||
|
|
||||||
_For old sensor/binary sensor configuration format, [see below](#legacy-binary-sensor-configuration-format)._
|
_For old sensor/binary sensor configuration format, [see below](#legacy-binary-sensor-configuration-format)._
|
||||||
|
|
||||||
@ -201,7 +201,29 @@ number:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
"[all sensor, binary sensor, number entities]":
|
select:
|
||||||
|
description: List of selects
|
||||||
|
required: true
|
||||||
|
type: map
|
||||||
|
keys:
|
||||||
|
state:
|
||||||
|
description: Template for the select's current value.
|
||||||
|
required: true
|
||||||
|
type: template
|
||||||
|
select_option:
|
||||||
|
description: Defines an action to run to select an option from the `options` list.
|
||||||
|
required: true
|
||||||
|
type: action
|
||||||
|
options:
|
||||||
|
description: Template for the select's available options.
|
||||||
|
required: true
|
||||||
|
type: template
|
||||||
|
optimistic:
|
||||||
|
description: Flag that defines if select works in optimistic mode.
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
"[all sensor, binary sensor, number, select entities]":
|
||||||
description: Fields that can be used above for sensors, binary sensors, and numbers.
|
description: Fields that can be used above for sensors, binary sensors, and numbers.
|
||||||
required: false
|
required: false
|
||||||
type: map
|
type: map
|
||||||
@ -211,11 +233,11 @@ number:
|
|||||||
required: false
|
required: false
|
||||||
type: template
|
type: template
|
||||||
unique_id:
|
unique_id:
|
||||||
description: "An ID that uniquely identifies this sensor. Will be combined with the unique ID of the configuration block if available. This allows changing the `name`, `icon` and `entity_id` from the web interface."
|
description: An ID that uniquely identifies this sensor. Will be combined with the unique ID of the configuration block if available. This allows changing the `name`, `icon` and `entity_id` from the web interface.
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
availability:
|
availability:
|
||||||
description: "Defines a template to get the `available` state of the component. If the template returns `true`, the device is `available`. If the template returns any other value, the device will be `unavailable`. If not configured, the component will always be `available`."
|
description: Defines a template to get the `available` state of the component. If the template returns `true`, the device is `available`. If the template returns any other value, the device will be `unavailable`. If not configured, the component will always be `available`.
|
||||||
required: false
|
required: false
|
||||||
type: template
|
type: template
|
||||||
default: true
|
default: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user