💡 Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

I was on 4.7 and updated to 4.8 recently.

Will do some more testing.

Thanks!
That works indeed for me :slight_smile:
Appreciate your efforts!

1 Like

Then it should all be good. Let us know if you find anything (bug).

Thanks for your help

Blacky :smiley:

New update 4.9

This is a birthday release (28 October 2022) as it is just about a year ago when I posted this blueprint. To think I developed it because my daughter is a nurse and I kept forgetting to turn the light ON when she was on shift work. Now I use it all through out my home and I hope it has helped some people automate their lights. I like to thank you all for your positive feedback and your ideas… look forward to the next year. Hope you like this release, Blacky :smiley:

New Feature :new:

  • Dynamic Lighting Option

    This will constantly adjust your lighting brightness % to a floating lux value. Example; When it gets darker your brightness will increase and as it gets lighter your brightness will decrease :tada: :bomb: :exploding_head: :partying_face:

  • Ambient Options - Low and High Values

    This now allows your to set a low and high lux value. This will help when it is a cloudy day and your light turns ON, or when your sensor is close to your setting. It gives you the ability to set a “dead zone” to prevent your lights turning ON and OFF repeatedly. The low value will turn your lights ON and the high value will turn your lights OFF :wink:

    :warning: If you are using ambient options then please make sure you reset your low and High settings. The low setting is what you initially had before this update. If you would like it to work the same before this update then set your high value the same as your low value.

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:

2 Likes

@Blacky in would be nice have a inverse option for adaptive lighting (but for time). ie at sunset say 18:00 i nromally use 10% in my landing / stairs, but late a night when going to bed ( some memebr go really late about 2am) it would be nice to have option to set the brightness level for various times. so i could set brightness for 2am to 2% just enough to light stairs / landing. if you understand what i mean.

maybe call it “night light” and allow a brightness and time to be set, so it uses that brightness after the night light time is set.

I don’t use adaptive lighting so I am not sure of this.

You can use the sun condition for your 10% and that will be normal lights. Then enable night lights and set it to 2am to say 4am (whatever you like) and set it to 2%.

We have night lights already.

If you are looking to turn ON and OFF lights at a particular time then you could use my :gear: Turn Light, Switch or Scene On & Off with Trigger Conditions blueprint. Or you can use a schedule as the trigger to keep the light ON.

If you are looking to use have motion sensor then you can set the times in the global condition and night lights

EDIT: I think I am getting confused / not understanding the question.

oh, great, it has been a while since i edited my automation, i’ll take a look thanks.

For some reason this automation loves to turn off my under cabinet LED lights right after it successfully turns them on. I have cieling lights also triggering that don’t have this issue (they turn on and stay on just like they are supposed to). Any idea what makes these cabinet lights have an issue?

Here is my yaml config:

id: '1695347383668'
alias: Kitchen - Lights Auto
description: ''
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.kitchen_presence_occupancy
    include_light_control:
      - use_brightness
      - use_transition
    light_brightness: 80
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.great_room_lux
    ambient_light_value: 70
    include_night_lights: night_lights_enabled
    light_switch:
      entity_id:
        - light.kitchen_ceiling_lights
        - light.kitchen_breakfast_nook_ceiling_lights
        - light.kitchen_cabinet_led_group
    night_lights:
      entity_id:
        - light.kitchen_ceiling_lights
        - light.kitchen_breakfast_nook_ceiling_lights
        - light.kitchen_cabinet_led_group
    night_time_delay: 2
    include_night_light_control:
      - use_brightness
      - use_transition
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: '23:00:00'
    night_lights_before_time: '07:30:00'

I would say it is your ambient light settings.

You have min set to 70 and if you are on the latest V4.9 you have a max of 80. So when your light turn on your lux goes above 80 and turn it off.

You have 2 options.

  1. Tick YES in site conditions. It will then not consider max lux.
  2. Tick NO in site conditions. Adjust your max lux higher to give you a “Dead Zone”. This was the reason I added max lux in the latest release, to stop this. Set the max to say 400 lux and when your light goes ON see what the lux value is then you can adjust max to a setting you like.

Strange thing is the 8 min. I think you have time delay set to 5. If the above is not the problem, adjust the time delay to 6 min, click save and then back to 5 min, click save. In fact now I have read your trace again… is something else turning OFF your light group? This looks strange.

Let us know how you go.

Blacky :smiley:

I’m on v4.7 still, so the ambient shouldn’t be an issue. The time delay makes sense to me since I was in the room for 3ish minutes and then the 5minutes was no activity. I can’t find anything that would be shutting off this light group. Is there another spot in the logs I can investigate? Most of the time it works perfectly. Seems like every couple days it gets like “out of sync” and this light group flips on/off quickly.

@Nomar383 That is the strange thing as you can see above and below we turn ON and OFF all light domains together. If you can have a look in your logbook to see what turned that light group OFF. Lucky you have the time stamp in the image above so it will be easy to find it by using the filter in the logbook. If you find it can you let us know.

Hello guys, I am struggling to make this work with my fp2. Does it work with presence sensors, and keep light on if presence is still detected ? my lights just turn off after the time delay.

thx

@Anaconda

Yes this is how it should work. If you have multiple triggers then you will need to group them.

On how to set up group sensors please Click Here.

A good starting point is to read “The Settings & Best Practice Guidelines” Click Here.

If you are still having problems then 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.

Let us know how you go.

Blacky :smiley:

Many thanks for your reply. I do have multiple triggers as it is an Aqara FP2 with many zones, but each zone triggers a light or scene. I will also read carefully the guidelines.

Just tried a very simple setting, with only one zone, and one scene, and the lights don’t even turn on (Lux settings set to 300 while my sensor is at 190). Here is my yaml code:

alias: FP2 BLUEPRINT Sensor Light TEST
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.chambre_presence_dressing
    light_switch:
      entity_id: scene.dressing_lumiere_naturelle
    time_delay: 1
    include_light_control: []
    include_bypass: []
    motion_bypass_lights_on: []
    motion_bypass_lights_stop: []
    include_night_lights: night_lights_disabled
    night_time_delay: 0.5
    include_night_light_control: []
    night_light_brightness: 4
    night_lights_conditions: []
    night_lights_after_time: "00:00:00"`
    night_lights_before_time: "00:00:00"
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.presence_sensor_fp2_4cbe_light_sensor_light_level
    ambient_light_options: ambient_light_option_disabled
    ambient_light_value: 300

`

Here is the logbook for that sequence:

Thank you, workaround solved the issue!

@Anaconda, just check that in your scene your light turn ON. Run the scene manually and check this. Also remember when using scenes you have to create another scene with everything OFF and enter it into “Scenes To Turn OFF”. Maybe just try it with a light entity first.

1 Like

@Nomar383

See note

Your trigger turn on the automation but another trigger turn off you led light group. Look for this.

Blacky :smiley:

Thank you, it works now. The issue I face now with the FP2, is that when using zones, my “presence” in a zone in no more detected as soon as I stop moving while the binary sensor for the whole room still detects my presence. I don’t know if I did something wrong in my initial setup or this is how the fp2 actually works ? Is the presence detection only working for what they call the fixed binary_sensor, while for zones binary_sensors it does not act as a presence sensor but more like a motion sensor ?

In such a case, it becomes problematic, and the zones detection useless for such a device.