šŸ”† Smart Light - Entity - Sun Elevation - Ambient & Time Triggers

@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.

@dbeer

Smart Light works of 4 different triggers to turn ON and OFF. You can also mix and match them. Use case, to turn ON lamps at sunset and OFF at time.

Sensor Light works with a motion sensor, has delays to keep it ON and conditions that must be met for it to run.

This is basic but when I get time I will do a FAQ in more detail.

If you are unsure please provide your use case and I can guide you to what one would suit best.

Blacky :smiley:

Thank you. I will try out this one then.

Unfortunately, Iā€™m failing to import this blueprint (via the button at the top of this topic) with the following error code:

Invalid blueprint: extra keys not allowed @ data['blueprint']['input']['bypass_settings']['collapsed']. Got True extra keys not allowed @ data['blueprint']['input']['bypass_settings']['icon']. 

I searched this topic, but didnā€™t find anyone having the same issue.

What am I doing wrong?

@dbeer

You must be on Home Assistant Version 2024.6 or later. If you can update your Home Assistant you will then be able to import it.

Blacky :smiley:

Thank you for your swift reply. It worked. My apologies for this rookie mistake.

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: