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

Will do when I make it home. Two things to mention though. The bulb and the helper group Iā€™m trying to use are Hues connected via the hue integration. I tried with a Zigbee plug connected via ZHA and it works. :man_shrugging:t2: Thanks!

This blueprint seems to offer everything what I am looking for but havenā€™t found a solution for one of the cases.

I have:

  • Hue fixture with ability to dim / change color
  • Zigbee doorswitch

I would like:

  • Light goes full on when door is opened during the day
  • Light goes on in a dimmed state when door is opened after sunset/night
  • Light goes off after x minutes
  • Light goes off immediately when door is closed

All cases work flawless except the last one. If the timeout is set at 0; the light switches ON and OFF when the door is opened/closed. I would like to use the timeout only when opening the door and ignoring it when closing the door.

Is this scenario possible with this blueprint?


alias: TEST Sensor Light Blue Print
description: Living Room Lights and Presence Sensor
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.living_room_occupancy_presence
    light_switch:
      entity_id: light.living_room_lights_group
    time_delay: 3
    include_dynamic_lighting: enable_sun_elevation_colour_brightness
    dynamic_lighting_min_colour_temp: 2000
    include_time: time_enabled
    after_time: "15:00:00"
    before_time: "07:00:00"
    dynamic_lighting_max_colour_temp: 6500
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.living_room_lights_group
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "22:00:00"
    night_lights_before_time: "06:00:00"
    light_transition_on: 1.5
    light_transition_off: 2
    include_light_control: []

Yes put you will have to do a script. New update is coming out soon as well.

Blacky :smiley:

Hi Dennis, please adjust your min brightness as it is set to 0 = light OFF. So if you set it on say 10% the light will come ON.

Blacky :smiley:

1 Like

New update 5.7

:partying_face: IT IS A BIG ONE :partying_face:

Embarking on this journey, countless hours of dedication have been poured into our latest release, and I am thrilled to share it with you all. :rocket: The top post has already garnered an incredible 201 likes ā€“ thank you for your overwhelming support! If you havenā€™t already, please take a moment to hit the like button and show some love to the blueprint. :blue_heart:

:point_right: For those who resonate with my work and want to contribute further, thereā€™s an opportunity to make a positive impact. A donation link is available to support ongoing projects. A heartfelt THANK YOU to those who have already generously contributed! :pray::sparkling_heart:

:heartbeat: If youā€™re yet to make a donation and would like to be a part of this journey, consider clicking the Donation Link. Your small contribution goes a long way, and I genuinely appreciate your support! :rainbow:

:warning: Attention: Dynamic Lighting Enthusiasts! :warning:

Exciting news for users of dynamic lighting options 1 or 2! Weā€™ve introduced some game-changing inputs that will enhance the functionality and take your experience to the next level. :rocket:

If youā€™re keen on maintaining your current setup, itā€™s a breeze! Simply follow these steps: Set the ā€œStep Valueā€ to 100 and adjust the ā€œDead Zoneā€ to 0. This guarantees that your original preferences will stay intact, ensuring a seamless continuation of your preferred settings. :arrows_counterclockwise::bulb:

Your lighting experience, your way ā€“ take control and customize it to perfection! :bulb::sparkles:

New Feature :new:

Dynamic lighting

I have updated LUX brightness from all your feedback and my own experiences. No longer will the brightness jump up and down to then when it gets close just change ever so slightlyā€¦ that can be annoying. You now can take back control of your lighting transition to a more suitable setting and let dynamic lighting do the rest. If your lights only support brightness then that is no longer a problem, you can now slow it down using the step value. The ā€œDead Zoneā€ is a Ā± value that realy helps. Think of it like this; Say the dynamic lighting would like to set your lights at 88%, if your dead zone is 7% then if your actual light brightness is in the range (ā€œDead Zoneā€) of 81% to 95% then your lights will not change the brightness value. 7% seams high but I have found when testing it is only realy less than 7% of what it should be and is not noticeable. The defaults have been set but you will need to adjust them to your liking.

Below is what been added to dynamic lighting.

  • Step Value - With every heartbeat, the system evaluates the lux value, light brightness, and the targeted brightness. If the targeted brightness surpasses the predefined step value, the system applies the set step value to gracefully moderate the rate of changes, facilitating a smoother transition in light brightness.
  • Dead Zone - With every heartbeat, the system evaluates the current light brightness and the targeted brightness. If the targeted brightness falls within the defined dead zone, the system maintains the current light brightness. This prevents minor fluctuations in light intensity that could be bothersome to the eye.
  • Option 6 - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness. New option added for you light control.

Scripts

  • You are able to run a script at the end like we already do with scenes. All you have to do is put your script in ā€œScenes - Scripts To Turn OFFā€ and when the automation turns OFF it will run the end script.

Maintenance :toolbox:

  • General code clean up - Just doing some housekeeping.

Bugs Fixed :bug:

  • By-pass auto OFF ā€“ When all three by-passes were ON, option 3 would not turn OFF due to an automation timing issue.
  • Auto OFF Enabled ā€“ When two or three were ON and one was turned OFF manually the by-pass auto off would not work.
  • HA Restart - By-pass options.

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:

4 Likes

Great; I have updated immediately !
I assume I still would need to make a script to switch off the lights when using a doorswitch?

@PAHVelthuis

I will PM you.

Blacky :smiley:

Awesome, really happy with the bypass fixes. Now I can restart my HA again without my spouse getting annoyed!

Hm, too soon. I am using a template (occupancy) sensor helper that detects if my TV is on and configured this as a bypass in ā€œBy-pass Switch - Turn lights ONā€. But after a restart it takes a little while before the helper becomes available and ā€œoccupiedā€ again. The automation doesnā€™t handle this so the lights will turn off after the timeout (and wonā€™t turn on again on motion because of the bypass).

@fbloemhof

Okay, thanks for the feedback. We will fix it in the next release. How long does it take for it to become available?

Blacky :smiley:

1 Like

Thanks. Iā€™m not sure how long it takes, I think a couple of seconds. Not sure how I can specify this, the unavailable state is not logged.

No problem, I will look at my system, the only thing is my system is realy fast so maybe on a RPi it could be slower. I will work it out.

Blacky :smiley:

1 Like

Hi Blacky,
First of all, thanks for the update and great support for this blueprint.

As the functionality is increasing with each update, also the complexity increases and more and more questions will be raised. You have created many FAQā€™s and tips&tricks in this thread, but these are spread over multiple posts.
Is it possible to have alle the FAQā€™s etc centralized on the GitHub so it will be easier to find the answers to all our questions.

1 Like

+100. I LOVE Blackyā€™s Blueprints, and his devotion to answering every question. But I think heā€™d be doing himself (and us) a huge favor with a centralized FAQ/how-to instructions on Github. The Blueprints are very complex and having detailed help/FAQ/upgrade instructions in one spot would be a god send.

2 Likes

Thank you for the reply. Iā€™ve set it for option 2-turn lights off and put the auto-off to 0. When I press the switch, the lights turn off and then immediately turn back on. Hereā€™s my code. Maybe that will help someone spot my problem.


alias: Family Room Table Lights Toggle and Nightlight
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.presence_fp2_family_room
    light_switch:
      entity_id:
        - light.family_room_left_table_bulb
        - light.family_room_right_table_bulb
    time_delay: 8
    include_light_control:
      - use_colour_temperature
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id:
        - light.family_room_left_table_bulb
        - light.family_room_right_table_bulb
    night_time_delay: 1.5
    include_night_light_control:
      - use_brightness
      - use_colour_temperature
    night_light_brightness: 10
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "21:00:00"
    night_lights_before_time: "04:00:00"
    light_brightness: 50
    include_dynamic_lighting: enable_lux_controled_brightness
    dynamic_lighting_lux_sensor: sensor.family_room_light_sensor
    light_colour_temperature: 3000
    dynamic_lighting_max_colour_temp: 3000
    night_light_colour_temperature: 3000
    include_bypass:
      - bypass_enabled_turn_off
    include_bypass_auto_off:
      - bypass_auto_off_enabled_off
    motion_bypass_lights_on: []
    motion_bypass_lights_off:
      - light.family_room_lamp_switch
    motion_bypass_lights_stop: []
    bypass_auto_off_delay: 60
    bypass_time_delay: 0

Thanks, Blacky!

I updated to 5.7 and I think my problem has been fixed! Thanks!

@mars2020 @DuckDuck25

I 100% agree it would be realy nice to have a type of manual of the blueprint. I never initially thought it would just keep on growing like it has. I keep telling my wife ā€œI think it is all done nowā€. One can understand why she doesnā€™t believe me any more, but Iā€™m fortunate that she remains understanding.

I do have a FAQ and a ā€œThe Settings & Best Practice Guidelinesā€ Within the two links there are more links that take you to what you may be looking for. In every link you go to, down the bottom you will find 1 or 2 links that take you back to where you came from being the FAQ or ā€œThe Settings & Best Practice Guidelinesā€. I am not sure if this is the best way, but I am open to and appreciate your feedback.

Blacky :smiley:

Hey Blacky,

first of all a big thanks for this awesome blueprint!
I was fighting the whole last year to set up my presence sensors properly in Google Home. After switching to HA last week I was able to implement a basic lighting automation in minutes thanks to your blueprint. However Iā€™m facing the following two issues with my Aqara FP2 sensor and Iā€™m not sure how to get rid of them. I would be happy to get some tips from you.

As an example Iā€™ve four virtual switches in HA for the sensor: ā€˜tv zoneā€™ just in front of the couch, ā€˜dining zoneā€™ at the tables location, ā€˜kitchen zoneā€™ and ā€˜global zoneā€™ for the whole room (-> containing all zones ā€˜tvā€™, ā€˜diningā€™ & ā€˜kitchenā€™).

  1. As soon as I enter the room (-> presence detected for ā€˜global zoneā€™) thereā€™s one automation that enables the scene ā€˜darkā€™. All lights in the room will stay on for 2 minutes after the last presence detection and will be turned off after these 2 minutes.
    I enter the ā€˜dining zoneā€™, enabling a second automation. Only the dining lamp changes to my ā€˜brightā€™ scene for 1 minute after the last presence detection. After this 1 minute, the lamp will switch back to the ā€˜darkā€™ mode. This works flawless as long as I stay in the room. But by leaving the room (-> ā€˜global zoneā€™ switches to absence) and re-entering the room within the one minute (ā€˜darkā€™ scene still active, dining lamp still on ā€˜brightā€™) the ā€˜global zoneā€™ automation starts again, resulting the dining lamp to change to ā€˜darkā€™. Is there a way to prevent this behavior? Maybe to only run the ā€˜globalā€™ automation when the lights are off? But in this case the automation will not work to turn off the lights after two minutes, right? Whatā€™s about the by-pass option?

  2. As soon as presence is detected in ā€˜tv zoneā€™ only, the ā€˜tvā€™ scene with help of a third automation is being activated. Iā€™ve created a binary sensor via a template that starts the automation in case ā€˜dining zoneā€™ & ā€˜kitchen zoneā€™ are off and ā€˜tv zoneā€™ is on. By walking from the ā€˜kitchen zoneā€™ in the ā€˜dining zoneā€™ thereā€™s the problem that for a few milliseconds the binary sensor switches to on since the ā€˜kitchen zoneā€™ is already off but the ā€˜dining zoneā€™ not on at that point. Is there a way to adjust the template of the binary sensor that it only turns on when all requirements are fulfilled for at least one second?

I would be happy for any kind of support.

Thanks :grinning:

Lukas

1 Like

@Somedia

Nice one, I think a lot of people will switch from having just Google Home once they know about HA.

I am trying to get my head around it all, so I apologise if I have got it wrong. I see you are using scenes to control your lights. If you opt to use only a scene or script, itā€™s advisable to include just one individual light or switch as a separate entity used in your scene or script. This ensures proper automation functionality, as it can accurately reference that specific entity. If only a scene or script is used, the automation lacks awareness of the ON/OFF status of individual lights or switches, potentially leading to malfunctions in its operation.

So can you put one light entity from your scene used in the automation into ā€œLights - Switches - Scenes - Scriptsā€ You will end up having your scene and 1 light/switch entity. If possible best to just use the light control options with entities and no scenes, but you may be using colours so if that is the case then you will have to use scenes.

Test this and see how you go, let us know if you need more help and or if it worked.

Blacky :grinning:

1 Like