From 3258e5e22e313ed132cf993ab08913f7a48c1a02 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 21 Jan 2023 20:17:20 -0500 Subject: [PATCH] Returned to going unavailable for graphing's sake --- packages/lighting_and_scenes.yaml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/lighting_and_scenes.yaml b/packages/lighting_and_scenes.yaml index 4c53175..b99ccc8 100644 --- a/packages/lighting_and_scenes.yaml +++ b/packages/lighting_and_scenes.yaml @@ -254,40 +254,45 @@ sensor: friendly_name: "Basement Studio Lights - Brightness Actual" value_template: > {% set current = state_attr('light.basement_studio_lights','brightness') %} + {{ ((current / 255) * 100) | float | round(2) }} + availability_template: > {% if is_state('light.basement_studio_lights','on') %} - {{ ((current / 255) * 100) | float | round(2) }} + true {% else %} - {{ 0 | float | round(2) }} + false {% endif %} unit_of_measurement: '%' icon_template: mdi:brightness-percent basement_studio_lights_brightness_intended: friendly_name: "Basement Studio Lights - Brightness Intended" - value_template: > + value_template: "{{ state_attr('switch.adaptive_lighting_basement_studio','brightness_pct') | float | round(2) }}" + availability_template: > {% if is_state('switch.adaptive_lighting_basement_studio','on') %} - {{ state_attr('switch.adaptive_lighting_basement_studio','brightness_pct') | float | round(2) }} + true {% else %} - {{ 0 | float | round(2) }} + false {% endif %} unit_of_measurement: '%' icon_template: mdi:brightness-percent basement_studio_lights_colortemp_actual: friendly_name: "Basement Studio Lights - Colortemp Actual" - value_template: > + value_template: "{{ state_attr('light.basement_studio_lights','color_temp_kelvin') | int }}" + availability_template: > {% if is_state('light.basement_studio_lights','on') %} - {{ state_attr('light.basement_studio_lights','color_temp_kelvin') | int }} + true {% else %} - {{ '0' | float | round(2) }} + false {% endif %} unit_of_measurement: 'K' icon_template: mdi:thermometer-lines basement_studio_lights_colortemp_intended: friendly_name: "Basement Studio Lights - Colortemp Intended" - value_template: > + value_template: "{{ state_attr('switch.adaptive_lighting_basement_studio','color_temp_kelvin') | int }}" + availability_template: > {% if is_state('switch.adaptive_lighting_basement_studio','on') %} - {{ state_attr('switch.adaptive_lighting_basement_studio','color_temp_kelvin') | int }} + true {% else %} - {{ 0 | float | round(2) }} + false {% endif %} unit_of_measurement: 'K' icon_template: mdi:thermometer-lines