-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
Closed
Closed
Copy link
Labels
Description
The problem
HomeAssistant uses the state of hs_color and/or color_temp to correctly render full color lights, and determine which mode they're in. The 'template light' does not support returning a null value for either template, with unhandled exceptions for hs_color as it attempts to parse the return string.
Environment
- Home Assistant Core release with the issue: 0.107.7
- Last working Home Assistant Core release (if known): None
- Operating environment (Home Assistant/Supervised/Docker/venv): HASS
- Integration causing this issue: template light
- Link to integration documentation on our website:
Problem-relevant configuration.yaml
- platform: template
lights:
ui_alistair_s_office_overhead:
friendly_name: Alistair's Office Overhead
value_template: "{{ states.light.alistair_s_office_overhead.state }}"
level_template: "{{ states.light.alistair_s_office_overhead.attributes.brightness|int if states.light.alistair_s_office_overhead.attributes.brightness else none }}"
temperature_template: "{{ states.light.alistair_s_office_overhead.attributes.color_temp|int if states.light.alistair_s_office_overhead.attributes.color_temp else none }}"
color_template: "{{ states.light.alistair_s_office_overhead.attributes.hs_color or none }}"
Additional information
Template should evaluate for 'None' (string constant returned by jinja's none) and pass 'None' upstream to HA.