mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-27 11:16:54 +00:00
Add temperature to light template (#11678)
This commit is contained in:
parent
d1d39e083d
commit
50db58a3c9
@ -25,8 +25,9 @@ light:
|
|||||||
lights:
|
lights:
|
||||||
theater_lights:
|
theater_lights:
|
||||||
friendly_name: "Theater Lights"
|
friendly_name: "Theater Lights"
|
||||||
level_template: "{{ sensor.theater_brightness.attributes.lux|int }}"
|
level_template: "{{ state_attr('sensor.theater_brightness', 'lux')|int }}"
|
||||||
value_template: "{{ sensor.theater_brightness.attributes.lux|int > 0 }}"
|
value_template: "{{ state_attr('sensor.theater_brightness', 'lux')|int > 0 }}"
|
||||||
|
temperature_template: "{{states('input_number.temperature_input') | int}}"
|
||||||
turn_on:
|
turn_on:
|
||||||
service: script.theater_lights_on
|
service: script.theater_lights_on
|
||||||
turn_off:
|
turn_off:
|
||||||
@ -35,6 +36,11 @@ light:
|
|||||||
service: script.theater_lights_level
|
service: script.theater_lights_level
|
||||||
data_template:
|
data_template:
|
||||||
brightness: "{{ brightness }}"
|
brightness: "{{ brightness }}"
|
||||||
|
set_temperature:
|
||||||
|
service: input_number.set_value
|
||||||
|
data_template:
|
||||||
|
value: "{{ color_temp }}"
|
||||||
|
entity_id: input_number.temperature_input
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
@ -63,6 +69,11 @@ light:
|
|||||||
required: false
|
required: false
|
||||||
type: template
|
type: template
|
||||||
default: optimistic
|
default: optimistic
|
||||||
|
temperature_template:
|
||||||
|
description: Defines a template to get the color temperature of the light.
|
||||||
|
required: false
|
||||||
|
type: template
|
||||||
|
default: optimistic
|
||||||
icon_template:
|
icon_template:
|
||||||
description: Defines a template for an icon or picture, e.g. showing a different icon for different states.
|
description: Defines a template for an icon or picture, e.g. showing a different icon for different states.
|
||||||
required: false
|
required: false
|
||||||
@ -84,6 +95,10 @@ light:
|
|||||||
description: Defines an action to run when the light is given a brightness command.
|
description: Defines an action to run when the light is given a brightness command.
|
||||||
required: false
|
required: false
|
||||||
type: action
|
type: action
|
||||||
|
set_temperature:
|
||||||
|
description: Defines an action to run when the light is given a color temperature command.
|
||||||
|
required: false
|
||||||
|
type: action
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
## Considerations
|
## Considerations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user