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

@breakone9r

Sorry for the late reply, I been really busy.

Below is your code.

  1. Your sun trigger was set for -0.5 till -1.
  2. Dynamic Lighting min brightness set to 1% so you don’t need a toggle helper.
  3. Sun Elevation Descending - Start Point set to -0.5, same as your trigger. At this point it will tun ON at a low %.
  4. Sun Elevation Descending - End Point set to -10. This is the max and it should be really dark at that point so 100% brightness will be set. Adjust if needed but you can’t go lower than -10.
  5. Removed the time trigger to turn your light OFF at 8:30pm you want the lights on all night.
  6. Adjusted Night Lights - End Time from 2am to 10am as the sun trigger will turn it OFF at -1 sun elevation and this should be past this point.
  7. un selected Use cross over time delay from night lights to normal lights in night light control.
  8. Selected If lights are ON, adjust the lights when crossing over and Use transition in night light control so you lights will adjust from 100% to 1%.
  9. Night Lights - Transition - ON set to 5 seconds. This is the time from 100% to 1%. Smooth transition.

Your done :partying_face:… copy and paste the code below into your YAML settings.

alias: Smart Light Porch
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_sun:
      - sun_falling
      - sun_rising
    sun_elevation: -0.5
    sun_elevation_rising: -1
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "20:30:00"
    night_lights_before_time: "10:00:00"
    include_night_light_control:
      - use_brightness
      - if_lights_are_on_adjust_when_crossing_over
      - use_transition
    night_light_brightness: 1
    night_lights:
      entity_id:
        - light.porch_device_1
        - light.porch_device_2
        - light.porch_device_3
    include_dynamic_lighting: enable_sun_elevation_brightness_inv
    light_switch:
      entity_id:
        - light.porch_device_1
        - light.porch_device_2
        - light.porch_device_3
    dynamic_lighting_min_brightness: 1
    dynamic_lighting_sun_elevation_start_falling: -0.5
    dynamic_lighting_sun_elevation_end_falling: -10
    night_light_transition_on: 5

Let us know how you go.

Blacky :grinning:

@nikaiwolf

So you would like the light ON 24/7. Can you explain in detail what your trying to do as I not 100% sure.

You may be better of using my :bulb: Sensor Light blueprint and just using a toggle helper for the trigger. Copy paste the toggle helper entity ID into the trigger and then turn it ON to run 24/7.

Then select your dynamic lighting you would like during the day.

Blacky :grinning:

Awesome! I see what I was doing wrong. We’ll see how it goes tonight. Thanks!

1 Like

from sunset, ramp up to 60% brightness RGBW until 9pm
9pm until sunrise ramp down until 20% at sunrise
sunrise to midday 20%
midday-sunset off

@nikaiwolf

The only way you can do this is using the time option in dynamic lighting and you have to pick a start point for sunset and a end point for sunrise.

Blacky :grinning:

New update 2.9

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

:bug: Bug Fixes - Dynamic Lighting

  • Toggle Helper: - Fixed various bugs in the Dynamic Lighting Toggle Helper to ensure correct toggling of the ON and OFF state.
  • State Control: - Resolved issues in Dynamic Lighting state control handling.
  • 0% Min Brightness Value: - Addressed bugs where setting the Dynamic Lighting min brightness value set to 0% caused the light to turn OFF, and then when transitioning to night lights, the light would remain OFF instead of transitioning properly.

:toolbox: Maintenance

  • Updated bypass descriptions to be clearer on the function of each input based on general feedback.
  • Cleaned up some code that could potentially cause an error log.

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 the very useful Blueprint. I am in trial phase right now. Was using version 2.8 but there was a weird issue when using

Regular Light:
Turn ON Sun Falling Elevation Trigger value 4.5
Turn OFF Sun Rising Elevation Trigger value 5

Nightlight:
Nightlight Sun Falling Elevation Trigger value 2
Nightlight Sun Rising Elevation Trigger value 2

The Regular Light would turn ON at Sun Falling Elevation Trigger value of 4.5 but then turn OFF at Sun Falling Elevation Trigger value of 2

Have since updated to version 2.9. Will report tomorrow.

Meanwhile, I would love to donate and support your truly excellent work but Paypal would not accept credit card from my country (Indonesia). Any other method to donate? I understand it might be a hassle to set up another donation channel for just li’l old me though. Once again, thanks for a complete and well thought of blueprint.

Erwin

@erwinsidik

Welcome to the community.

You will find that when it got to Sun Falling Elevation Trigger value of 2 it switched to your night lights. Have you entered your lights in Night Lights?

You will find that some countries restrict how you spend(donate) your $$. If you change the country/region in the dropdown to USA you should find that it will work. If not just let us know and I will set up another way.

Thanks for pointing this out. Maybe this is why I get very little support.

Blacky :grinning:

Yes, the lights in the main automation and the night lights section are different entities. That’s what got me puzzled. Anyhow, will check again tonight after update and will let you know. I’ve noticed the change in YAML code pertains to sun. So hopefully it works perfectly now.

You suggestion about changing countries work. Once again thanks for your hard work. Will donate again once I get the my presence sensor working and using the Sensor light Blueprint. Your Blueprints are definitely worth at least as much as the hardware used since they makes the use of the hardware in the way I want to use them possible. Please keep up the good work.

Erwin

@erwinsidik

Make sure you have also selected If lights are ON, adjust the lights when crossing over, see below.

Thanks for your support (donation) and your kind words it really helps!

Blacky :grinning:

Aha, got it. Did not see that option before. I need to pay better attention :grin:. Anyhow, I’ve ticked that option and will report again. Thanks for the very prompt reply.

Sincerely yours,
Erwin

Hi @Blacky - loving your automation Blueprints thanks - is there a way to have the Turn Off time based on Sun Elevation - however not for sunrise but rather it also being based on a falling elevation (e.g. if you want lights to turn on a bit before sunset but also turn off sometime after sunset (e.g. a few hours later - but before “midnight”)). Currently you can turn off at a fixed time but not one that is relative to the sunset time. Thanks

Hi Craig,

Sorry to report it is still happening. To recap:

Smart Light Blueprint
Regular Light (Entity A)
Turn ON Sun Falling Elevation Trigger value 4.5
Turn OFF Sun Rising Elevation Trigger value 5

Nightlight: (Entity B)
Nightlight Sun Falling Elevation Trigger value 2
Nightlight Sun Rising Elevation Trigger value 2
If lights are ON, adjust the lights when crossing over option checked

The Regular Light would turn ON at Sun Falling Elevation Trigger value of 4.5 but then turn OFF at Sun Falling Elevation Trigger value of 2

Not in a real hurry for the solution but it baffles me. :slight_smile:

@Blacky i’m looking for a solution for my morning based routine.

My trigger: Bathroom door
My conditions: workday & between 2 times (06:00 and 08:00)
My actions: Turn some lights on and off

This works but there is no lux value so i’m looking for a solution and you’re blueprint came up.

So, is there any solution to check if the time is between 2 set times?

@rodneyc

Maybe in might be easier if you just set up a normal automation in HA to turn your light ON and OFF using the 2 condition triggers.

The conditions in this blueprint is really tricky and I am still trying to fine tune it.

Blacky :grinning:

@erwinsidik

Thais no good.

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Blacky :grinning:

@EvertJob

Try using the sensor light blueprint. Then you can use your conditions with ambient. Just copy paste your bathroom door sensor into the trigger.

:bulb: Sensor Light - Motion Sensor

Blacky :grinning:

Hello
I’m attempting to do a few things with this automation but it doesn’t consistently work right and I’m not sure if I’m just interpreting the instructions wrong, and searching the thread is pretty difficult unfortunately.
I want the lights to turn on at a certain sun elevation every day, unless it gets really dark before that time occurs.
Most of my lights are switches, but there are some I want to turn on to a specific brightness. I have created 2 scenes for these. One for lights that stay on all night and another for lights that should turn themselves off at 3am. The 3am ones I have set as a scene in night lights. The all night ones are a combination of entities and a scene.
I have a toggle helper that activates the night lights via an entity state condition (I think that’s what it is doing?).
I have an OFF scene to turn off the scene that is in the regular lights section.
I set a timed on for the night lights at 21:00 because it makes me, but i want these to turn on with all the other lights, which is why I use the toggle helper. All I care is that they turn off at 3AM.

The main issue I’m having is the night lights don’t seem to want to turn on or off. The other slight issue I have is it’s not really easy to test any of this as I have to wait for the literal trigger to happen before I can tell if any changes I’ve made work or not :blush:

This is my yaml for the automation. Does this seem right for what I’m trying to do?

alias: Night Lights
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_sun:
      - sun_rising
      - sun_falling
    light_switch:
      entity_id:
        - switch.kitchen_pantry_door_outlet
        - light.garage_door_carriage_lights
        - switch.front_driveway_flood_light
        - switch.rear_patio_flood_light
        - switch.scene_capable_switch_on_off
        - light.brick_patio_wall
        - light.brick_patio_flood
        - scene.stair_lights
    sun_elevation: -5
    sun_elevation_rising: -5.5
    include_ambient:
      - ambient_low
    boolean_scenes_scripts: input_boolean.standard_night_lights
    include_light_control: []
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
      - entity_state_enabled
    night_lights_before_time: "03:00:00"
    night_lights_entity_state:
      - input_boolean.standard_night_lights
    night_boolean_scenes_scripts: input_boolean.dimmed_night_lights
    night_lights:
      entity_id: scene.dimmed_night_lights
    include_bypass: []
    ambient_light_sensor: sensor.tempest_weather_illuminance
    ambient_light_value: 500
    night_lights_after_time: "21:00:00"
    end_scenes:
      - scene.step_lights_off

Thanks @Blacky - FYI I’d also be happy with the addition of a time to run (e.g. how many minutes after the start time till off - in the Time-Based Option section)

1 Like

@networkcrasher

Your trying to do a lot in the one automation. With your scenes, are the brightness levels all the same?

In night lights you have 2 conditions and both have to be true for night lights to work.

  1. Your toggle helper must be ON
  2. Only run between 9pm to 3am.

This part unless it gets really dark before. Normally when you set your sun elevation you can get it right. The problem you may have is during the day if it drops below 500lux it will turn your lights will turn ON. Test it out and if it works for you great but just consider this.

I would just use entities (not scenes) and break up your automation into a few.

Automation.

  1. Lights and switches that turn OFF at 3am.
  2. Light and switches run all night. Then work out if the dim and what night light condition will activate night lights.

Blacky :grinning: