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

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:


1 Like


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

New update 5.8

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

Maintenance :toolbox:

  • Safe guard HA restart function has been rebuilt. It is a lot cleaner.
  • Descriptions - Just doing some housekeeping.

Bugs Fixed :bug:

  • By-pass Option 1 – Turn On action - When all three by-passes were ON, option 3 would not turn OFF due to an automation timing issue.

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:


Blacky :grinning:


Hi Blacky, first of all, thank you for creating such a useful tool for us.

I’ve got a question regarding the min/max values for sun elevation. I’m just wondering why is there a fixed limit for the lowest possible start point for the sun elevation rising phase and the lowest end point for the sun elevation descending phase? In my example I wanted to decrease the light even later than -10 degrees.

The lowest possible start point for the Sun Elevation rising phase and the lowest end point for the Sun Elevation descending phase is set at -10 degrees. Below these specified points, the settings utilize their minimum configured values.


Thanks for your kind words and welcome to the community.

It is there to help with adjustments and make it easy. If you would like to go beyond these set values just simply type the number in and click save.

Blacky :smiley:

Thanks for this awesome update!

Yes, I did, but unfortunately it did not work. I tried with -40 degrees, but when -10 degrees were passed, it decreased the light to the configured minimum brightness level.

Okay, I think I’ve found the answer for that behaviour in the code of the blueprint. The limit of -10 degrees is in-line coded (e.g. line 3976, 4046, …).


Sorry my bad, I didn’t read your question correctly… :yawning_face: Thought it was the sun condition.

Yes it is limited to -10. I just thought it is dark by then and a few other things… What level do you want to go to… and can you maybe give me a use case so I can understand more.

Blacky :smiley:

Hey Blacky,

thanks for your advice, I wasn’t aware about the different behavior of scenes and entities.

So I added all lights separately to my ‘global zone’ & ‘dining zone’ automations. Unfortunately this led to the following two issues:

  • When I enter the room, the ‘global zone’ automation turns all lights on to ‘dark’. As soon as I move into the ‘dining zone’ nothing happens since the table lamp in this zone is already on (but should change to ‘bright’). I would expect the blueprint not only to verify if the light is already on but also if the defined brightness/color temperature is met and if not, to run the automation. Would this be a possible feature to implement in the future?
  • As soon as the one minute has passed in the ‘dining zone’, the light turns off (instead of changing back to ‘dark’). Is it possible to somehow store the previous state of the light before the automation starts and switch back to it after the time has passed?

For now I’ve set the lamps separately in the ‘global zone’ and a scene in the ‘dining zone’ automation what works as intended. However the transition feature isn’t working with scenes, what is one of the top features in my opinion.


No problem :slight_smile: I also had a thought about it and maybe I tried to misuse the feature “Sun elevation lighting”. (e.g. -40 degree would not work in summer) .

What I would need instead is a fixed time-based ramp down and ramp up in brightness and colour, according to my daily rhythm (which is not according to the sun). For example, a gentle reduction from 10pm to 2am to increase tiredness.

Just a quick post of appreciation. After runnig Domoticz for almost of 12 years. The last update messed up my Z-wave devices. As i always found Domoticz superior to the rest… But WOW i have what a progress HASS has made!!! Incredible.

And this Blueprint…its the proof of concept how dedicated this community is…

Many Thanks. In just a week i am a big HASS fan!!

1 Like

Couple of questions @Blacky

  1. Should we allow some number of seconds in between one Sensor Light automation finishing (End Time) and another one starting (Start Time)?
    The reason I ask is that I have automation 1 that turns on light A and that automation ends at 6pm. Then I have automation 2 that starts at 6pm, and it turns on light A, B, & C.
    The result I get is that light A turns off and doesn’t come on again automatically during the run of automation 2.
    Light A is accessed via an integration - Nanoleaf. But it always turns on fine manually thru the GUI, or if I run the automation 2 manually.

  2. One of my Light Sensor automations always turns the lights off after the defined motion timeout period after I have rebooted my HA server. I think it may be the first automation I made with this Blueprint. None of the other instances of this Blueprint do this.
    Any idea why it would do this?


Hey @Blacky

First of all, this automation is pure genius. Its such a huge time saver for building a sophisticated light setup. I moved from the Philips Hue Bridge and your automation helped me a ton with it.

I could need a little help, though. In my setup I do not only have motion sensors but also switches.

What I am trying to achieve:

  • Use your motion blueprint for everything motion
  • If the light is turned on by a switch, I want to turn the lights on and massively extend the “delay before turn off” (like 60min, instead of 5 if triggered by motion)
  • If the light is turned off by a switch, I want to turn the lights off and wait before the light is triggered by motion again (“cooldown for like 1 minute”)
  • If the lights are controlled by a switch (brightness, cycle scenes, …) I want the lights to stay that way (until they turn off by time delay of motion or switch) and not get overwritten to the default when motion is detected

What I did:
I made “overwrite” input_booleans for turning on, turning off and overwriting the automatically triggered light setup.
Those are fed into the three bypass options (ON, OFF and Keep Current State). This works perfectly fine. My only issue is with automatically turning off those input boolean helpers.
I built scripts which control the input_booleans, but as this is no finite state machine they sometimes end up in a scrambled/undesired way. (i.e. They do not get turned off after time delay. There are race conditions. It is especially bad if home assistant is restarted.)
… And loads of helpers and scripts later I ended up thinking, that I may overcomplicate things.

Where I am now:
In desperate need of some input, of how I can solve this issue in a easy, smart and robust way. I think it would help me a great deal, if this blueprint had different Auto OFF delays for each bypass. This way I would only need to turn the entities on when a light switch is used. Or is there anything else I could do to make things easier?

Thanks again for this great Blueprint!

best regards

1 Like

Hi Blacky,
I am now on:

  • Core2024.1.5
  • Supervisor2023.12.1
  • Operating System11.4
  • Frontend20240104.0

I still get the following error with yot blueprint:

Invalid blueprint: extra keys not allowed @ data[‘blueprint’][‘input’][‘ambient_light_sensor’][‘selector’][‘filter’]. Got None extra keys not allowed @ data[‘blueprint’][‘input’][‘dynamic_lighting_lux_sensor’][‘selector’][‘filter’]. Got None extra keys not allowed @ data[‘blueprint’][‘input’][‘end_scenes’][‘selector’][‘filter’]. Got None extra keys not allowed @ data[‘blueprint’][‘input’][‘motion_trigger’][‘selector’][‘filter’]. Got None extra keys not allowed @ data[‘blueprint’][‘input’][‘people’][‘selector’][‘filter’]. Got None extra keys not allowed @ data[‘blueprint’][‘input’][‘zone’][‘selector’][‘filter’]. Got None

Would you mind have a look into this?
Thanks for your awsome work.

I have a Zwave Fibaro Eye and want to switch a simple Zwave Wall socket which switches a Led Cove.

I have the following config: (pretty simple)

  • Trigger Sensor - Binary Sensors - Schedule * = Fibaro Eye Sensor state (Any)

  • Lights - Switches - Scenes - Scripts * = Entity LedCove

  • Time Delay = 0.5 (testing purpose)

  • Ambient Light - Low Lux Value = 8 lux

  • Ambient Light - High Lux Value = 10 lux

  • Ambient Light Sensor = Fibaro Eye Illuminance

But what ever value i put in the High lux Value its always turning on the switch/light
What am i overseeing here??

I have just migrated from Domoticz to Hass. So i have a lot to learn. But my Wife and Kids are moaning haha.

For now i have made an automation to turn your automation script on or off depending on lux…

Hope someone can point me in the right direction

Blacky…I’m having trouble getting lights to reliably turn on and stay on when triggered by a group of binary sensors. The binary sensor group is a combination of PIR sensor PLUS a radar sensor made by Screek (https://www.screek.io/). I added the radar sensor so that it would continue to sense my presence even if I was sitting relatively still in the area.

The entities for the radar sensor are as shown in the attached picture. There is moving target, presence and still target. I put them all into the binary group, expecting that if any of those shows anything but CLEAR, it will trigger your automation.

But it’s not working. I come in the front door, the lights come on, but I sit down for longer than the time out in your automation, and the lights turn off. Yet, some of the entities are still not clear. Why aren’t the lights staying on?

I must be thinking about this wrong. Anywhere I should start to look?