šŸ’” Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

@sstarcher

Nice one.

I never say never and love hearing any suggestions as this promotes development. A few people have asked for this so I will also add your name next to the feature request. For now we will need to create a template binary sensor helper that will invert it.

To create a Template binary sensor, follow these steps:

  1. Navigate to Settings > Device & Services > Helpers tab at the top.
  2. Click the Create helper button.
  3. Select Template and then choose Template a binary sensor.

Next, provide a Name and Device class of your choice. If applicable, you can link this template to an existing device so it appears under that deviceā€™s details.

In the State template field, add the code below, replacing binary_sensor.your_sensor_here with your entity ID.

{{ is_state('binary_sensor.your_sensor_here', 'off') }}

Have you looked at ā€˜Dynamic Lightingā€™ in the blueprint?

Blacky :smiley:

@harryfine

Thanks Harry, hope you like the new update. Yea I forgot to say that in the update notes. We had to do this as it was getting a lot of information just in one clapable section but tryed to follow the same format we have for normal lights.

Thank you once again, Harry, for your ongoing support through your donations. Community support for my work has been minimal and barely covers two days of my time. Nonetheless, I am extremely grateful for any support the community provides. If my blueprints and support help you, please consider donating; it would greatly assist me in continuing to provide updates and community support.

Blacky :smiley:

Could anyone please help me understand what I am doing wrong here? I cannot get the blueprint to trigger a light based on a motion sensor. I am able to use another blueprint with the same entities and the motion sensor triggers the light without an issue.
Here is a screenshot of my automation. Any assistance is much appreciated

Yeah, you need to expand the light Device youā€™ve entered and choose the Entity. The lights to turn on/off have to be entities. The BP only allows you to enter Areas & Devices as a quick way to get to the Entities.

2 Likes

Hi @Blacky - Iā€™m guessing the ability to use the physical load switch as a bypass wasnā€™t in your 7.0 release as I couldnā€™t see it in the notes - unless Iā€™m losing the plot!

Iā€™m happy to test a pre-release of this in my environment if that helps?

We will move it to this blueprint post to stay on track as it relates to it.

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 :smiley:

@lewisb79

Hi Lewis, sorry I have been really busy as I have 9 new blueprint releases with new features, code clean ups and testing (QA) :face_with_spiral_eyes:. I also have 2 new blueprints to release one of them relates to what you are asking.

It is a separate blueprint to this one and is only for creating the manual switch to then be used in this blueprint. I am not 100% happy with it and it may be totally different to the end result but I am happy to share it with you if you would like to test it out. If your still happy to test it I will set it up and PM you with the link.

Blacky :smiley:

Thanks for moving the discussion here! Below is the YAML code from the automation:

alias: Home Lights - Main
description: Control ground floor lighting.
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - schedule.lights_on_schedule
    light_switch:
      entity_id:
        - light.floor_lamp_1
        - light.floor_lamp_2
        - light.floor_lamp_3
    time_delay: 5
    include_light_control:
      - use_brightness
    include_sun: sun_enabled
    sun_elevation: 3
    sun_elevation_rising: -1
    include_device_tracker: zone_people_enabled
    zone: zone.home
    people:
      - person.name_1
      - person.name_2
    light_transition_on: 3
    include_night_lights: night_lights_disabled

From someone who is very new to this.
Is there a way with this blueprint to trigger the lights to full brightness when there is motion detected, but then when there is no motion to dim the lights down to say 20%?
The first part is easy but not sure how to d the lights instead of turning them off?
I tried to use a sene but couldnā€™t get it to work.
Thank you

Fairly new here as well, but from what I know, you can create two scenes - one for 100% lights and another for 20% lights. Then add the 100% scene in the ā€œLights - Switches - Scenes - Scriptsā€ section and the 20% scene in the ā€œScenes - Scripts To Turn OFFā€. Be sure to add a scene toggle helper.

The FAQ also has some really good information and instructions around using scenes & scripts.

1 Like

@Nuwanda

Thanks for your YAML. I looked at the code again and it wont trigger when you get homeā€¦ sorry my bad.

I had to think back why it was set up like this and I can recall having some concerns with a few scenarios. Example, if you are home and you turn the lights OFF manually because you are sleeping and someone comes home all the lights turn ON. :thinking: I can remember there was some reason why I just allowed motion sensor to control it. I will have to look into it again. Do you have motion sensors?

Blacky :smiley:

@AmmaGHHA

I am ahuming this is for night time. Have a look at this post click here and follow the automation example. It is a step by step guide. I think this is what you are after.

Blacky :smiley:

1 Like

Hmmmā€¦thatā€™s a fair point. Since in my specific scenario, the livingroom lights are the only ones I turn on automatically I never really considered this. I do have a door sensor that I just got which should be a perfect trigger for my case.

Edit: Just thinking about it though - if the zone trigger only checks for zone state going from 0 to 1 (or higher), it shouldnā€™t trigger the second time in your example.

1 Like

Hey Blacky,

Iā€™ve been using your blueprint for over half a year now and I love it. Great job! However, I have an use case for which I have not found a solution yet. I have a blueprint for the bed area in the bedroom (with an Aqara FP2) that dims the light using a scene when the presence entity for this area is on, and if the entity is off, the light will turn brighter again by also using a scene.
In order to ensure the light remains off at night, Iā€™ve created a night-mode entity that sets the light to 0% brightness (= off) when activated, using the Night light option. This works quite well. However, the presence sensor sometimes loses track of the person at night, causing it to activate the regular off state, which activates the bright scene for the daytime. Logically, Iā€™d like the light to remain at 0% even if the person is absent. How can I solve this? If itā€™s not currently possible, would it be an idea to allow defining an off state for the night light option in a future update?

Thanks!

Lukas

Man, I want to love this automation so much, itā€™s everything I need in a light control blueprint. But I cannot for the life of me get it to interface with my smart switches. I simply want a switch to control the lights. Reason I like this automation so much is I want my lights to change color temp based on the angle of the sun, and I also want to have an override so if I want to just have some color, it doesnā€™t default to following the angle of the sun. I think thatā€™s possible with this blueprint?

@Nuwanda

It all depend on what you have but there are a lot of things to consider.

What happens if your have 4 in the zone but you are only tracking 2 of them?
What happens if 2 people come home together and it goes from 2 to 4?
What happens if 1 is home and the lights have been turned off and another person comes home triggering the lights on?
What happens ā€¦?

There is a lot of logic already in this blueprint and the idea is no one even knows :wink:. It just works :crossed_fingers:

Letā€™s look at another approach.

What if we create a template sensor that will turn ON when the zone is 0. Then use it in bypass option 2. So when the zone is 0 the lights turn OFF. Then when you get home the zone will turn to 1+ then the bypass will turn OFF and the automation will evaluate the site conditions and turn the light ON because the schedule (trigger) is ON. This will be the cleanest way and you can adjust it to suit your site conditions.

Try this and put it into bypass option 2.

Create a Template binary sensor, follow these steps:

  1. Navigate to Settings > Device & Services > Helpers tab at the top.
  2. Click the Create helper button.
  3. Select Template and then choose Template a binary sensor.

Next, provide a Name and Device class (Occupancy) of your choice. If applicable, you can link this template to an existing device so it appears under that deviceā€™s details.

In the State template field, add the code below, just make sure you are using ā€˜zone.homeā€™ and if not then change it to your zone.

{{ states('zone.home') | int == 0 }}

Add this new template sensor into the bypass option 2 and it should work :wink:

Let us know how you go.

Blacky :smiley:

1 Like

@Somedia

Hi Lukas,

Nice to hear from a long time user of the blueprint and I am glade you like it :+1:. Thanks for reaching out and your kind words.

Looks like you are so close to making it work perfectly. If I am correct the problem you have is only later in the night where the light turns ON and you would like it to remain OFF. Have you considered using the time condition (recommended for ease) or creating a Times of the Day helper or a Schedule helper and set the time that you know you are normally sleeping. If you are just using time condition in the automation to only work between start and end then you just click save. If you use a helper then you would add that helper into bypass option 2 making sure your lights stay off but can still control them manually if needed. You could even have another automation to take this time slot.

If the way you have it now works well at the start or end then when you set your times make it a in between where you know the problem happens. Like a bit of a buffer zone as time can change when you go to bed.

Let us know if this works for you.

Blacky :smiley:

1 Like

@backlash2032

I think your switch it seen as the light (same entity) if not detach your switch form your light and add your switch into the trigger. You have to edit in YAML replacing any entity you put in there with your switch entity. Then just add your light in.

If that is not the case thenā€¦

I have another blueprint in development that would make this work. I am just testing it out so it should be out soon all going well. Probably less than 30 days but not promising anything. You can however use a toggle helper as the trigger but you will have to control it through the UI not the switch on the wall.

That would be changing it to night lights (donā€™t worry about the name it is called if it is not night time).

Blacky :smiley:

Some quick testing this morning and it works well! Super clean way of doing it, and quite straightforward, appreciate the detailed instructions!

1 Like

Hey, Thanks for all the work so far.

Got a bit of a question for you. I live in Norway, so when using sun elevation settings, simply using a time based trigger wont work. As well, the sun rising and setting has a large variation between summer and winter.

So instead, to trigger it, i use a threshold sensor, and set the elevation about 5% more than what i want when starting to set, so in practical terms, i set the binary sensor, so that the sun is 20% over the horizon, using the sun integration in home assistant, which gives current elevation.

When the sun dips below 20%, the binary sensor turns on, it stays on until it goes over 20%.

So far, this has worked great for turning ON the lights, see I want my lights to turn ON when the sun goes down, and off when they come up. I am using elevation inverted, and as i said the ON works greatā€¦ itā€™s the OFF

It doesnā€™t seem to happen.

What iā€™m expecting, is that whilst the binary sensor is on, the automation is running, constantly checking the elevation and updating the lights accordingly, but what I think happens is that only when the binary sensor turns from OFF to ON does the automation run, until the lights get to 100% then it stops the automation.

So I am going to experiment with an inverse of the binary sensor, one that turns ON when the suns elevation rises above say, -10% where the llights should start turning OFF when the sun goes from -5% to 5%

Thoughts?