🔆 Smart Light - Entity - Sun Elevation - Ambient & Time Triggers

@carsten12

Your welcome Carsten, glad you got it working and thanks for letting us know.

Enjoy

Blacky :smiley:

could you add the option to make the lights work only when someone is home? like in the other blueprints
Thanks

@PilaScat

Thanks for your suggestion, I will add it to the list.

Blacky :smiley:

1 Like

First let me say how much your work has made my life easier! I was ready to pull my hair out until i found your automations :slight_smile:

One issue im having, my lights arent transitioning colors/brightness on a new time.

Example
Lights on 4pm - white 100%
Lights on 9pm - blue 50%

At 9pm they are staying white 100% and not switching. Pretty much if the lights are on, they wont transition at all.

Edit this is for a couple govee bulbs and a hue strip

Hopefully ive added what you need. This is day 5 of me learning HA lol.

alias: Test
description: “”
use_blueprint:
path: Blackshome/smart-light.yaml
input:
include_time:
- time_on
after_time: “15:00:00”
light_switch:
entity_id:
- light.living_room_lamp
- light.kitchen_under_cabinet
include_light_control:
- use_brightness
- use_transition
include_weekdays: weekday_enabled
include_light_colour_control: use_rgb_colour
light_rgb_colour:
- 255
- 0
- 0

@B.Spilner

I am assuming you are going to turn the lights OFF manually.

This will turn your lights ON at 4pm white at 100% and then at 9pm they will switch to blue at 50%. At 8am they will go back to white at 100% if you don’t turn them OFF. Notice how I have used night lights, we only need to use weekday if you only what it to run a a few days but if it is everyday then we don’t need to enable this option.

Copy the code below and paste it into your automation. TIP: When you paste code into this forum if you use the </> in the editor and then paste your code into there it will keep the format it should be, like below.

alias: Test
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_time:
      - time_on
    after_time: "16:00:00"
    light_switch:
      entity_id:
        - light.living_room_lamp
        - light.kitchen_under_cabinet
    include_light_control:
      - use_brightness
      - use_transition
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "21:00:00"
    night_lights_before_time: "08:00:00"
    night_lights:
      entity_id:
        - light.living_room_lamp
        - light.kitchen_under_cabinet
    include_night_light_control:
      - use_brightness
      - use_transition
      - if_lights_are_on_adjust_when_crossing_over
    night_light_brightness: 50
    include_light_colour_control: use_rgb_colour
    include_night_light_colour_control: use_rgb_colour
    night_light_rgb_colour:
      - 0
      - 0
      - 255

Let us know how you go.

Blacky :smiley:

New update 2.4

Smart Lighting: Your Lights, Your Way - Take Control and Customize it to Perfection! :bulb: :sparkles:

New Feature :new:

  • Night Light Control - You have a new option in night light control to Use cross over time delay from night lights to normal lights. This applies to the night lights conditions. The delay is especially useful when using the night lights state condition with a motion sensor, as it adds a buffer period after the motion sensor clears before switching to normal lighting.

Maintenance :toolbox:

  • From time to time, Home Assistant updates their YAML standards and coding practices. To align with their roadmap, we’ve updated the code accordingly. We will continue to apply these updates across all our blueprints as they are revised.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

OK heres the 2 automations, Looks like its not working the way it should on my end. I do have an off time, but still none of the lights are switching colors and brightness at the times they are supposed to.

alias: Main Lights 5-8PM
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    after_time: "16:25:00"
    before_time: "20:01:00"
    light_switch:
      entity_id:
        - light.bonus_room_lamp
        - light.living_room_lamp
        - light.kitchen_under_cabinet
        - light.basement_lamp
    include_light_control:
      - use_brightness
    include_night_light_control: []
    include_light_colour_control: use_colour_temperature
    include_time:
      - time_on
    include_weekdays: weekday_enabled
    light_brightness: 90
    include_sun: []

alias: Main Lights Low 8-10
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    after_time: "20:00:00"
    before_time: "22:00:00"
    light_switch:
      entity_id:
        - light.bonus_room_lamp
        - light.living_room_lamp
        - light.kitchen_under_cabinet
        - light.basement_lamp
    include_light_control:
      - use_brightness
    light_brightness: 17
    light_transition_on: 5
    light_transition_off: 30
    include_light_colour_control: use_rgb_colour
    light_rgb_colour:
      - 54
      - 128
      - 247
    include_time:
      - time_on
      - time_off
    include_weekdays: weekday_enabled

Ive also tried the Test code you provided, switched the time, and re tested. Lights did not change at all. The only time they seem to want to cooperate is when they are OFF completely and then triggered.

If they are already on then they stay the same state. This goes for both govee and my hue.

Hi Blacky! Thanks so much for your awesome blueprints, I think they all deserve to be in the standard installation of HA!

One feature request for this blueprint, I use separate automations to switch on lights always plus some lights which I only switch on/off when someone is home. Could you include a trigger for zone/home 0 or above zero?

@B.Spilner

You only need one automation not 2. Below is your adjusted code. Please use it and test it and see how I have used night lights with time condition.

alias: Main Lights & Night Lights From 5-10PM
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_time:
      - time_on
    after_time: "17:00:00"
    light_switch:
      entity_id:
        - light.bonus_room_lamp
        - light.living_room_lamp
        - light.kitchen_under_cabinet
        - light.basement_lamp
    include_light_control:
      - use_brightness
      - use_transition
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "20:00:00"
    night_lights_before_time: "22:00:00"
    night_lights:
      entity_id:
        - light.bonus_room_lamp
        - light.living_room_lamp
        - light.kitchen_under_cabinet
        - light.basement_lamp
    include_night_light_control:
      - use_brightness
      - use_transition
      - if_lights_are_on_adjust_when_crossing_over
    night_light_brightness: 17
    include_light_colour_control: use_rgb_colour
    include_night_light_colour_control: use_rgb_colour
    night_light_rgb_colour:
      - 54
      - 128
      - 247
    before_time: "22:00:00"
    night_light_transition_on: 5
    night_light_transition_off: 30
    light_brightness: 90
    light_transition_on: 5
    light_transition_off: 5

Blacky :smiley:

@linuxfreak

This Automation is slightly different to the sensor Light Blueprint. But I will look into it… Being Xmas I going to have a break but I see what I can do. It is on the list to look at but not making any promises as there will be a bit of logic.

Blacky :smiley:

Really appreciate your help! Ive done some trouble shooting and your code is working with my Hue strip but not Govee which leads me to believe its on my side.

EDIT: It was my Govee integration all along causing the issue!

I love love love this blueprint. Thank you @Blacky for all the hard work on this. I’m a long time fan of your Sensor Light blueprint and only just recently found this one perfect to cover standard or timed automations vs. event-driven lighting. With this one blueprint I’ve been able to streamline a whole load of automatons I’ve cobbled together over the past year or so.

Just one thing I’m not sure on… how to set the automation to ignore lights which are already on? It’s got to be through the “bypass” settings, surely, but I’m damned if I can figure it out!

Has anybody here got a similar use case to this and can point me in the right direction please?

Use case:

Automate the turning on of lights to a set brightness at a certain time
UNLESS the wife has already turned them on and set a colour, brightness etc., in which case leave them alone
Still turn them off on the schedule

@B.Spilner

Nice one, thanks for letting us know, glad you found the issue and it is now working :+1:

Enjoy

Blacky :smiley:

@eeeeeeeeeeeeean

Thanks for letting us know. This will be something I will need to fix and should just happen / work. I will put it on my list to do.

Blacky :smiley:

@deltabert

Move from sensor light blueprint

There are a few things to consider. When you turn OFF your router do you loose your network? If so then how will HA communicate and turn it back ON? If not then it will work. Below is your code you needed to enable the ON / OFF options and set your correct time.

alias: Smart Light Fritz!Box 7490 - Reset (Tapo 10)
description: Smart Light voor uit- en aanschakelen Fritz!Box 7490
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    after_time: "02:15:00"
    before_time: "02:00:00"
    light_switch:
      entity_id: switch.tapo_smart_wcd_10
    include_time:
      - time_on
      - time_off

Blacky :smiley:

@eeeeeeeeeeeeean

Hi Ian

I have had a look at this and it already done. If the light is ON and the automation triggers the light to turn ON the light will stay as is and the light settings will not be effected.

Blacky :smiley:

Hi @Blacky, Thank you for your reply and the advice about the unavailability of my LAN when I switch off my router. To be honnest I had missed that. But I have two releaters in my network and hopefully these can keep the local LAN active.

But I have yet to test this.
Thank’s for your reaction. Bert

Hi,

This blueprint look great. Can you tell me if the countdown is restarted when the trigger goes ON before the end of the timer?

In other words, I don’t want the scene goes off when a motion is still detected.

Hi Blacky,
I saw that @psyko_chewbacca reported an issue that his lights turned on after a HA restart. In 2.3 you fixed some of these bugs, however, for me I still turns on all the connected lights of my automations after a restart/update.
Not 100% but I think it only applies to the Smart Light blueprint, not the Sensor Light.

Stifter