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

Awesome! Just upgraded to v2.3.

I noticed an option to enable/disable the automation on certain days of the week. Is it possible to add specific timeframes for that? For example: Only enable between 7am and 10pm? Or more specific; only enable between 8am and 6pm on Monday?

And another question: I would like to have the lights turned on only when somebody is home. I have a group that monitors this. If I add the group to the by-pass option (Bypass Switch - Turn lights OFF), will the lights not turn off when the group is off?

I’ve been able to import this blueprint, but am lost by the amount of options.

However, I’m lost by the amount of options…

My objective is to

  • turn on certain lights in our location, starting when the sun goes down and increase them gradually - but only if user X is home
  • adjust light brightness and temperature so that when I turn them on via a switch or manually,nit has a brightness and temperature corresponding to the time of day.

Any direction for a blueprint -newbee would be appreciated, thanks!

@beurdy

This blueprint is not designed for this, it is more of a trigger you would like to happen. You may want to look at my Sensor Light Blueprint.

No, bypass works when an entity is ON the bypass is active and will do as per your selection. What you could do is use the group so when it is ON it turns the lights on and when it is OFF the light turn OFF. This would be done in a state trigger.

Blacky :smiley:

There is no condition for this so you will need to look at my sensor light blueprint.

You can do that in this one using the state condition.

Blacky :smiley:

@Blacky
Good work on this one!
Can I use this blueprint or another to achieve the following:

  1. Turn on lights outside garage at 50% brightness when lux sensor drops below xxx.

  2. When motion sensor outside garage detects movement turn up lights to 100% for x minutes, then down to 50% again.

  3. Then turn off lights when lux goes above xxx

Hope you understand my question?

@flaektrem

I recommend taking a look at my :bulb: Sensor Light Blueprint.

First, you’ll need to set up a trigger. If you’re aiming to run this at night, create a schedule helper that starts well before dark and ends at the time you’d like it OFF. If it’s meant to run 24/7, create a toggle helper instead. Simply copy and paste the toggle helper ID into the trigger input, then turn it ON.

Once your trigger is set up, use the ambient settings to adjust your lights to 50%.

For night lights, use your motion sensor as the state condition and set the lights to 100%.

This should give you the result you’re looking for. If you have more questions or are using the Sensor Light Blueprint, feel free to post them in that thread, and I’ll be happy to assist further.

Blacky :smiley:

1 Like

Thank you for your quick reply.

Regarding:

I want to clarify the part about “only if user X is home”. This is not referring to presence / motion detection, but rather to a person entity based on the “Person” integration.

@dbeer

In this blueprint there in no real condition other than weekday. This blueprint is for ON / OFF. I use it for light come ON when sun goes down and then switch OFF at X time. It will do this without any conditions. Another example say your office hours are from 9am to 5pm you can turn the lights ON and OFF. This is what this blueprint is used for. If you would like some conditions then best to use the sensor light blueprint.

Blacky :smiley:

Blacky, is it possible to have finer control on the lux levels ? Now it is usable with 10 point steps and that is not detailed enough for me.

Thanks

@BigBen

Hi Joost, just simply type the value in and then click save.

Blacky :smiley:

@Blacky arghhh, in the UI it flashes red when you insert numbers manually so I thought it was not allowed. thanks a lot.

I Love your blueprints, thanks for sharing.

1 Like

Hey Blacky! I’ve tried the Smart Light blueprint but it’s not turning on my light. I’ve tried to keep the blueprint config really simple and can confirm the entity ID is correct for both the light and illuminance. Can also confirm the illuminance right now is 14 which is way under the ambient light value. Can you see what I did wrong? The traces are quite complex so I’m not sure what info I should provide. I’m using ZHA with a Conbee II stick and a Philips Hue lamp + movement sensor which has an illuminance sensor in it. Thanks!

id: '1727692116475'
alias: Light - Living Room
description: ''
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    light_switch:
      entity_id: light.living_room
    include_ambient:
      - ambient_low
    ambient_light_value: 90
    ambient_light_value_off: 280
    ambient_light_sensor: sensor.living_room_illuminance

Hi, I have tried to use your blueprint. I just need to set time on/off. I have selected the Trigger time on and off, then In Lights I chose the device I want to be triggered on and off, then in Weekdays the days I want the lights to be switched on and off. I do not have motion sensors or other devices. However, after many attempts the system cannot run the automation and trigger the lights. I am new with HA and still mastering it so, any help is very much appreciated

Here is the YAML:

alias: Strip light
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_light_control:
      - use_transition
      - use_brightness
    include_light_colour_control: use_rgb_colour
    weekday_options:
      - sun
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
    include_entity_state: []
    include_time:
      - time_off
    after_time: 00:25:00
    before_time: 21:30:00
    include_weekdays: weekday_enabled
    night_lights_conditions: []
    night_lights_after_time: 23:51:00
    night_lights_before_time: 23:52:00
    include_night_light_control: []
    include_night_lights: night_lights_enabled
    light_brightness: 30
    light_switch:
      device_id: 06f2dd5abc9285578c370cf62bae65aa
    include_sun: []

@TheAutomator

I’ve tested your YAML, and it worked perfectly. You’ve set a Low Lux Value of 90, so for the automation to trigger, the LUX value must go from above 90 to below 90. When that happens, the light will turn ON.

If you’re adjusting the settings in the blueprint and your current LUX value is, say, 80, the automation won’t trigger because it needs to cross from above 90 to below 90.

Also, note that you’ve only set it to turn the light ON, so the automation won’t turn it OFF. I’m not sure if that’s what you intended.

Make sure your sensor.living_room_illuminance reports the lux value. It looks like it is correct but I am just checking.

Blacky :smiley:

Ah now I get it! It needs to cross from above 90 to below 90 sounds like the key point to me. I would like it to always respond/trigger on the motion sensor, not only when it crosses. I found this blueprint that does that: Home Assistant Blueprint: Smart Lux Dimmer (github.com)

I have all my lights under your blueprints now so it would be awesome to get this one on it too! I don’t know how to fix it though… Is it because of the trigger that has the above/below values defined while the blueprint I shared has them as a condition?

Correct on your other points - I wanted to keep the blueprint as simple as possible to get it to work first which makes troubleshooting easier. Hence the turn off functionality hasn’t been implemented yet :slight_smile:

@dsim

Welcome to the community.

Thanks for you YAML.

There are a few things that are not correct.

  1. Trigger Time, you have only enable to use the OFF time… you need to enable the ON time. Once yo enable the ON time then your time is ON at 12:25 am and OFF at 9:30 pm. I could be wrong but you may be after ON at 9:30 pm and OFF at 12:25 am if so adjust the times to your liking.

  2. Lights you can use devices only entities can be used. The link I am about to provide will link you to my sensor light blueprint FAQ but is the same as this blueprint and shows you how to expand down your device to entities. Click Here

  3. Weekdays Option because you have selected it to run every day then you don’t need to enable this option. Use this option when you want to limit the days it should run. Disable this option.

  4. Night Lights Settings you have enabled night lights but you have no lights selected or a condition to activate night lights. I think you would like this disabled.

I have fixed up you YAML below but you will still need to do expand down you device to entities as shown in item 2 above and make sure your ON and OFF times are correct as shown in item 1 above.

alias: Strip light
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_light_control:
      - use_transition
      - use_brightness
    include_light_colour_control: use_rgb_colour
    include_time:
      - time_off
      - time_on
    after_time: "00:25:00"
    before_time: "21:30:00"
    light_brightness: 30
    light_switch:
      device_id: 06f2dd5abc9285578c370cf62bae65aa

Blacky :smiley:

This is the blueprint you need then. :bulb: Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time . It work with a motion sensor and has the LUX as a condition.

Blacky :smiley:

Thank you so much! It is working now.
I am now testing the transitions.
Thank you for the very nice script and your generosity for sharing.

Thanks, will do! What would be the trigger sensor? Since I don’t want it to work based on motion but just based on lux + condition on when I’m home. Time is also not a great trigger because it can rain during the day or I can watch a movie at 1 AM. I use this Sensor Light blueprint for my bathroom/toilet/bedroom/hall and it works really well there! But not sure how this would work.

I am digging more into your script and wanted to know if you can help with the light transition. I see that if I chose RGB I can only set one color and I am not sure what the transition refers to. I thought that I could chose more than one color and the LED would have transitioned the different colors.

The following is the for the Light Control that shows the Red only. Is it possible to add more colors instead of being static in one only?
Thank you so much!

light_transition_on: 2
    light_transition_off: 3
    light_colour_temperature: 3600
    light_rgb_colour:
      - 255
      - 38
      - 0