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

Thanks for the quick reply. I am fairly certain that this sensor gives the lux:
image

And tried the dynamic_lighting_min_brightness: 2 anywhere from 0% to 10% without any changes. The only time I get this automation to trigger now, is by restarting HA, then it triggers on the boolean I guess. Well, well… guess I have to sit in the dark (pun intended) a little while longer :smiley:

@vegard

Can you try this. Disable dynamic lighting and in light control enable Use Brightness and set the brightness to 50%. What I am trying is to see if the boolean will turn the light ON at 50% without dynamic lighting and your LUX sensor. Below is your YAML with the adjustments.

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:
      - use_brightness
    light_brightness: 50
    include_dynamic_lighting: disable_dynamic_lighting
    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

Blacky :smiley:

I can confirm that this worked. Toggled the boolean and the lights turned on to 50%.
What does this say you think?

Okay that is good. It tells me that your boolean, lights and brightness works.

I have added the sun elevation as your LUX sensor. Hope you have this entity in HA if not can you use a temperature sensor rather than the lux sensor. Just copy the entity ID of your temp sensor and paste it in the Dynamic Lighting - Ambient Light Sensor.

I also removed your helper and I am trying to testing your LUX sensor.

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:
      - use_brightness
    light_brightness: 50
    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: 20
    dynamic_lighting_min_colour_temp: 2000
    dynamic_lighting_lux_sensor: sensor.sun_solar_elevation
    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
    after_time: "00:00:00"
    bypass_time_delay: 0

EDIT: I updated your YAML again and change the min brightness to 20% for now just to make sure the light will come on.

Sorry for the late reply to this. I created a sensor for the elevation, and this seems to work now with dynamic set to option 8 :slight_smile:

@vegard

All good… glad you got it working. If you need mare help just let us know.

Blacky :smiley:

Great work on this blueprint it catches almost all of my scenarios, thanks.
For my lights OFF I now use a random delay added to my switch-off time, is something like that possible?

delay: 00:{{(range(5,26)|random)}}

@GH2user

Currently they are not supported.

Blacky :smiley:

Hello @Blacky and thanks for your comprehensive work!
I’m trying to create my automation but it does not adjust the brightness as I expect.
Can you spot what I did wrong?


use_blueprint:
path: Blackshome/smart-light.yaml
input:
include_ambient:
- ambient_high
ambient_light_sensor: sensor.sensore_illuminamento_illuminance_lux
ambient_light_value: 10
ambient_light_value_off: 120
light_switch:
entity_id: light.0xa4c138f365476158
include_light_control:
- use_brightness
- use_transition
light_transition_off: 2
light_brightness: 15
include_dynamic_lighting: enable_lux_controled_brightness_inv
dynamic_lighting_lux_sensor: sensor.sensore_illuminamento_illuminance_lux
dynamic_lighting_min_lux: 10
dynamic_lighting_min_brightness: 5
bypass_lights_on:
bypass_lights_off:
include_weekdays: weekday_enabled
dynamic_lighting_max_lux: 900
weekday_options:
- mon
- tue
- wed
- thu
- fri

@samumar

Your welcome.

Yep. I can see you are using Trigger - Ambient. The high you selected is to turn it OFF… the low is to turn it ON and you have not selected any trigger to turn ON (run) the automation. So you will need to decide what you would like to use.

I look at your dynamic lighting and you have a setting for 900 lux so I adjusted your YAML to turn ON (run) the automation using Trigger - Ambient low and the setting of 900 lux. I then set the high to 1000 lux and this is were it will turn OFF (stop) the automation. It may not be what you would like but it is just to give you a working example so change it as needed. What will happen is when the lux drops below 900 lux your light will turn ON and dynamic lighting will work. When the lux goes above 1000 lux the light will turn OFF. You may decide to use another trigger other than Trigger - Ambient so just change it to your liking. Below is your YAML. A tip is to use the “</>” in the menu of this text editor and then paste your YAML in there… it keeps the correct format. Try the below YAML in your automation.

use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_ambient:
      - ambient_high
      - ambient_low
    ambient_light_sensor: sensor.sensore_illuminamento_illuminance_lux
    ambient_light_value: 900
    ambient_light_value_off: 1000
    light_switch:
      entity_id: light.0xa4c138f365476158
    include_light_control:
      - use_brightness
      - use_transition
    light_transition_off: 2
    light_brightness: 15
    include_dynamic_lighting: enable_lux_controled_brightness_inv
    dynamic_lighting_lux_sensor: sensor.sensore_illuminamento_illuminance_lux
    dynamic_lighting_min_lux: 10
    dynamic_lighting_min_brightness: 5
    bypass_lights_on: []
    bypass_lights_off: []
    include_weekdays: weekday_enabled
    dynamic_lighting_max_lux: 900
    weekday_options:
      - mon
      - tue
      - wed
      - thu
      - fri

Blacky :smiley:

Blacky many thanks for your tips, very much appreciated!
The thing is that I don’t want the light to turn on automatically but just to turn off in case it is on. I would like to switch it on only manually and then it should adjust based on lux sensor value.
I was also looking the bypass section but was not sure about how to configure this way.

@samumar

:thinking: Try just putting your light switch (lights) into Trigger - Entity State and use the ON / OFF state. Don’t use Trigger - Ambient.

Now when you manually turn it ON dynamic lighting will work and then you manually turn it OFF. I think that is what you are asking.

Blacky :smiley:

Kind of, would like to turn it on manually then dynamic adjusting and turning off based on lux value :slight_smile:

@samumar

Then don’t use the OFF state and use the ambient OFF :wink:

So you would have state ON with your light and ambient OFF with your LUX sensor.

Blacky :smiley:

Sorry for the late reply. Just got around to test with Sensor Light Blueprint and I can confirm it works!
I had to remove the filters from Triggers so that media_player.tv_living would show up. It’s not a sensor but can still be used.
Thanks again!

@Kaiohshin

Nice one glad you got it all working.

TIP: You dont need to remove the filters, you can just copy and paste the entity ID into the input and click save. If there is an update in the future you will have no problem with it…

Blacky :smiley:

1 Like

I’m interested in this also and would be very nice if it can be implemented

@doedezemaar @GH2user

Can you explain why you would need to randomly turn off entities?

Blacky :smiley:

@Blacky
I used it for holidays and when I’m not home as daily ending at the same time is to predictable for potential burglars. I only used it for the “switch off all lights” at a certain time.

1 Like

Hi @Blacky. First of all, thank you very much for sharing all these great things. Really appreciated!

After some reading and research, my question is regarding the difference between your “Smart Light …” and “Sensor Light …” blueprints: How to decide which one to use? What is the difference?

Please accept my apologies if I missed a place where this was already explained. I searched for an answer but couldn’t find one.