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

I have a switch that keeps on every night, but I only need that in the summer. (and tbh if there’s a way to automate it it would be amazing.- if not it’s not that big of a problem)

1 Like

New update 2.2

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

:new: New Feature

  • Dynamic Lighting - Added new option, 9 - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness Inverted. I think I got them all now :partying_face:

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:

I have been unable to get the automation to work using time as a trigger since the latest update. I created a new automation and here is the created yaml

image

But it always gives the following error. Am I doing something wrong?

2024-08-18 11:55:00.153 ERROR (MainThread) [homeassistant.components.automation.den_ceiling_fan_automation] Error rendering variables: UndefinedError: ‘dict object’ has no attribute ‘entity_id’

@Mark17

You are using a device. entities are only supported you will need to expand them down. I will link you to a FAQ in my sensor light blueprint that shows you how to expand them down, it is all the same. Click Here

Blacky :smiley:

Thanks that worked. I missed the comment about not using devices (which is confusing as to why the selection button for devices shown at all.) I also made things complicated as I was removing all of my Wemo switches and replacing them with Kasa switches and then I upgraded your blueprint to the new version.

I have created an automation using the ‘Sun Elevation’ trigger. The lights turn on in the evening, but they never turn off in the morning. Is there anything wrong with the Yaml?

alias: Lampen woonkamer aan/uit
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_sun:
      - sun_falling
      - sun_rising
    light_switch:
      entity_id:
        - light.lamp_bankstel
        - light.lamp_tv
    sun_elevation: 2
    sun_elevation_rising: 1
1 Like

Hi Blacky, hope all is well.

turn on/off night light feature.

Start @ 21:30
end @ sunrise

is this possible?

kind regards Daniel

@Mark17

Nice one, glad you got it working.

Blacky :smiley:

@Kroevel

All you YAML looks good. I cant test it now but I will get back to you after my holiday. Thanks for being patients and for letting me know.

Blacky :smiley:

@greenembrace

It should be but @Kroevel sugested that maybe sunrise may not be working. If you can let us know how you go as I am on holidays.

Blacky :smiley:

No worries. Enjoy your vacation!

Edit: FYI - I have changed the ‘lights off’ event to turn the lights off at a fixed time until there is a solution.

1 Like

Thanks mate,
i’ll keep fiddling.

enjoy your time.

@greenembrace

Thanks Daniel, I fix it when I get back form holidays.

Blacky :smiley:

Hi,

Thank you very much for all your Blueprints. It makes complex automations so easy and cleanly presented.

I just imported the Smart Light blueprint in order to turn ON and OFF outdoor lights.

I have set up to turn lights ON on sun elevation falling and turn them OFF at 22h30.

Normally, it all works fine.

However, last night I was doing some late night tweaking in Home Assistant and restarted Home Assistant at around 00h00. To my surprise, the outdoor lights turned ON.
I see there is a trigger on Home Assistant starting in the automation debug trace. I guess the automation validates sun elevation falling condition is valid and just turns the light ON, no matter what time it is at the moment of Home Assistant restart.

Is this normal behavior?
I just want to make sure I’m not missing anything.

@psyko_chewbacca

Thanks for the info, I going to have a look at this in the next day or 2. I will also investigate this. You may see an update out soon.

Blacky :smiley:

New update 2.3

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

:bug: Bug Fixes

  • Fixed bug when using sun elevation falling, light would not turn OFF.
  • Fixed bug in bypass when turning bypass OFF and using sun condition light would not turn OFF.
  • Fixed many bugs in home assistant restart.

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:

Thank you for all the work it is really impressive.
I am currently using it to turn on the TV light strip after sunset. Trigger is TV state on.
Is there any way to trigger it if the TV was already turned on before sunset or the set hour?

@Kaiohshin

Welcome to the community.

I am not sure how you are doing this. If the TV is the trigger it will turn the light ON whenever the TV is turned ON regardless of the sunset.

If you’re asking whether this blueprint will turn ON the TV light strip if the TV was already ON before sunset, then this isn’t the right solution.

Instead, you’ll need to use my :bulb: Sensor Light Blueprint. With that setup, you can use the TV as the trigger and set the sun elevation condition. I specifically chose sun elevation over sunset or sunrise with time for certain reasons, which I explain in the FAQ section of the Sensor Light blueprint.

Using my :bulb: Sensor Light Blueprint this is what will happen: If the sun elevation condition is met and you turn ON the TV, the TV light strip will turn ON. However, if the TV is turned ON before the sun elevation condition is met, the light strip won’t turn ON immediately. But as the sun sets and the elevation crosses your set point, the TV light strip will turn ON.

Hope this helps you.

Blacky :smiley:

1 Like

Hi. I need som help. I’m having a hard time getting this automation to work. The trigger is a bool that is turned on when someone arrives back home, and turns off when no one is home. This does not seem to trigger anything. The lights are turned off. I use the dynamic lightning, and the lux is between the limits. Still no lights go on. Clearly I am doing something wrong, I am just unable to see it :see_no_evil:

The yaml is:

alias: _Smart Lights - Stue
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_sun: []
    include_ambient: []
    ambient_light_value: 0
    ambient_light_value_off: 0
    light_switch:
      entity_id:
        - light.kobberlampe
        - light.kartell
        - light.gul
        - light.leselys
    include_light_control: []
    light_brightness: 1
    include_dynamic_lighting: enable_lux_controled_brightness
    dynamic_lighting_max_lux: 150
    dynamic_lighting_min_lux: 10
    dynamic_lighting_max_brightness: 70
    dynamic_lighting_min_brightness: 2
    dynamic_lighting_min_colour_temp: 2000
    dynamic_lighting_lux_sensor: sensor.sensor_spisestue_belysningsstyrke ##This is a HUE sensor
    include_bypass: []
    bypass_lights_on: []
    bypass_lights_off: []
    dynamic_lighting_heartbeat: 0.25
    dynamic_lighting_step_value: 10
    include_entity_state:
      - entity_on
      - entity_off
    include_light_colour_control: disable_colour_control
    dynamic_lighting_dead_zone: 5
    dynamic_lighting_max_colour_temp: 4500
    include_time: []
    dynamic_lighting_sun_elevation_end_rising: 35.52
    dynamic_lighting_sun_elevation_start_falling: 35.52
    bypass_lights_stop: []
    entity_input: input_boolean.hus_aktivt ##the bool triggering ON/OFF
    light_transition_on: 2
    dynamic_lighting_sun_elevation_end_falling: 0
    dynamic_lighting_sun_elevation_start_rising: 1
    dynamic_lighting_boolean: input_boolean.dynamic_lighting_helper
    after_time: "00:00:00"
    bypass_time_delay: 0

@vegard

I have tested your YAML here replacing the trigger, LUX sensor, Light and helper and all works. Just make sure your light will turn ON a 2% brightness. Also just check that your sensor.sensor_spisestue_belysningsstyrke is the LUX sensor of the hue.

Blacky :smiley: