Skip to content

Commit

Permalink
Add temperature to light template (home-assistant#11678)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetienne authored and frenck committed Jan 27, 2020
1 parent d1d39e0 commit 50db58a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions source/_integrations/light.template.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ light:
lights:
theater_lights:
friendly_name: "Theater Lights"
level_template: "{{ sensor.theater_brightness.attributes.lux|int }}"
value_template: "{{ sensor.theater_brightness.attributes.lux|int > 0 }}"
level_template: "{{ state_attr('sensor.theater_brightness', 'lux')|int }}"
value_template: "{{ state_attr('sensor.theater_brightness', 'lux')|int > 0 }}"
temperature_template: "{{states('input_number.temperature_input') | int}}"
turn_on:
service: script.theater_lights_on
turn_off:
Expand All @@ -35,6 +36,11 @@ light:
service: script.theater_lights_level
data_template:
brightness: "{{ brightness }}"
set_temperature:
service: input_number.set_value
data_template:
value: "{{ color_temp }}"
entity_id: input_number.temperature_input
```
{% endraw %}
Expand Down Expand Up @@ -63,6 +69,11 @@ light:
required: false
type: template
default: optimistic
temperature_template:
description: Defines a template to get the color temperature of the light.
required: false
type: template
default: optimistic
icon_template:
description: Defines a template for an icon or picture, e.g. showing a different icon for different states.
required: false
Expand All @@ -84,6 +95,10 @@ light:
description: Defines an action to run when the light is given a brightness command.
required: false
type: action
set_temperature:
description: Defines an action to run when the light is given a color temperature command.
required: false
type: action
{% endconfiguration %}

## Considerations
Expand Down

0 comments on commit 50db58a

Please sign in to comment.