Home-AssistantConfig icon indicating copy to clipboard operation
Home-AssistantConfig copied to clipboard

Add Color Temp to Light Script

Open CCOSTAN opened this issue 4 years ago • 1 comments

Add in Color temp for those that support it.

https://github.com/NLthijs48/home-assistant/blob/98cd801a15418be364f0dfffda752199eb0c2353/features/lighting/automations/thijs.yaml#L7-L25

  action:
    - service: light.turn_on
      data:
        entity_id: light.bedroom_thijs_ceiling
        # Future: declare this condition once in a variable (HA 0.115+)
        # Full bright during the day, dimmed at night
        brightness: >-
          {% if now().hour >= 18 or (now().hour <= 12 and is_state('sun.sun', 'below_horizon')) %}
            1
          {% else %}
            255
          {% endif %}
        # Warm white during night, bright white during the day
        color_temp: >-
          {% if now().hour >= 18 or (now().hour <= 12 and is_state('sun.sun', 'below_horizon')) %}
            500
          {% else %}
            250
          {% endif %}

CCOSTAN avatar Dec 06 '20 03:12 CCOSTAN

Another Option: https://github.com/frenck/home-assistant-config/blob/master/config/scripts/sunlight.yaml

GitHub
:house: My Home Assistant configuration, a bit different that others :) Be sure to :star2: this repository for updates! - frenck/home-assistant-config

CCOSTAN avatar Dec 07 '20 16:12 CCOSTAN