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

Thanks for the reply, but unfortunately I guess I misunderstood. Or maybe I mean something else…

I have home lighting based on Philips HUE (Zigbee Light Link).

The lighting is also integrated in Home Assistant. It’s mostly controlled by the custom original Hue controllers (Dimmer Switch, Dial Tap and Smart Button). It is also controlled by various scenarios and automations. And also from Google Home Assistant.

The color temperature of the lighting is also controlled in real time in H.A. using the “Adaptive Lighting” plugin.

My question - if I use your “Blue Print” in conjunction with the Aqara FP2 occupancy sensor, will this scenario be able to restore the lighting to the exact previous state when I enter the room, before it was automatically turned off for the absent state by the same scenario also by your scenario?

That is, can your scenario “fingerprint” (remember) the current settings of all lights that are on when the lights are turned off in absence?

So far I have not been able to do that, and the lighting is always just on-reset to some preset lighting scene, as specified in your blueprint configuration.

Thanks a lot

No it can’t do that. Sorry

Blacky :smiley:

So I’m throwing this out there not because I know how to do it, but because I think it might be a feasible solution for your needs if someone can write the code.

It could get messy, but what if you had a script that was called that created a scene of the “current settings” just before enabling the motion detection scene?

If you can create the new scene in a way that overwrites the “last” current settings scene and set that as the scene to return to, you’ll accomplish what I think you’re trying to do.

Edit to add: It seems you could write a script to log data to a file. If this same concept could be applied to your use case, I would expect that you could log the status of an entity to the scripts.yaml file in place of the status that was there last.

1 Like

Actually just on the new 2023.12 blueprint update feature… it says I’m not worthy to update to the newest version of the blueprint (5.1 at this point in time) using the new method so do I just manually update to 5.1 then in the future the HA people will say your blueprint is worthy for easy updating? I wonder if they will ever realse a notification service that a blueprint HAS an update so we know.

Merely re-import the Github URL for the BP and it will then let you update.

FAQ - How To Update Blueprint on Home Assistant Version: 2023.12.0 +

Home assistant has added an new feature this month on how we can update our blueprints :partying_face:

If you have imported a blueprint using the import blueprint button you can now easily update them. Below are the steps if you would like to update your blueprint this way.

:warning: From time to time when I update my blueprint there may be a breaking change or something that is required to do. I would strongly recommend that you do a full backup of your Home Assistant before you update any blueprint this way. You can also go onto the post of the blueprint as normally I will notify you of any changes but also note, sometimes I don’t notify you. That is why it is always a good idea to do a full backup of your Home Assistant before updating. This way you can always easily roll back if something goes wrong :wink:


1 - First most important, do a full backup of your Home Assistant, and store it in a location where you can get to it if you brick your Home Assistant (on a separate computer not running Home Assistant).

2 - Go into settings / automation & scenes / click on the blueprint tab at the top and then the 3 dots next to the blueprint you would like to update.

3 - A pop up will appear and you will see you have an option to “re-import blueprint”.


When you click on the “re-import blueprint” you will get a confirmation to “re-import”.


:warning: STOP Have you done a full backup If you are happy with everything (again, a backup of HA) then and only then should you click the “re-import” button.

Once you click the “re-import blueprint” button a confirmation message will appear down the bottom.


Your done!! You blueprint is updated :tada:

To check everything was done correctly, go into your automation and or the blueprint, you should see the new version displayed at the top confirming you are on the latest.

If it is greyed out and you can’t select the “re-import blueprint” button then keep following the steps.


4 - At the top of my blueprints there will be a import blueprint button and also a link to my GitHub. If click on the import blueprint and follow the steps and click preview your will see override blueprint. This will confirm that your file path is correct and it will update the blueprint.

:warning: STOP - Have you done a full backup because you get no warning… it is going to happen if you click the “Override Blueprint” button.

If you are happy with everything (again, a backup of HA) then and only then should you click the “Override Blueprint” button.

You have now updated a blueprint :tada:.

If you click on GitHub link and go to the blueprint you would like to update and copy the URL as shown below.

For this blueprint “Sensor Light” the URL is;


Each blueprint will have it’s own URL, so it is important that you copy the correct one you would like to update.

5 - Under the blueprint tab click on “Import Blueprint”. A pop up will appear.


In the blueprint address paste the URL of the blueprint you would like to update and click preview.


The blueprint will be displayed and if you have installed the blueprint into the correct file location you will see a “Cancel” and an “Override Blueprint” button. If not you will see an “Import Blueprint” button. If you see the “import blueprint” button jump to step 6. If you see “Override Blueprint” button then keep reading.

Scroll down to read all the documentation including the warning from HA.


:warning: STOP - Have you done a full backup because you get no warning… it is going to happen if you click the “Override Blueprint” button.

If you are happy with everything (again, a backup of HA) then and only then should you click the “Override Blueprint” button.

You have now updated a blueprint :tada:.

To check everything was done correctly, go into your automation and or the blueprint, you should see the new version displayed at the top confirming you are on the latest.

6 - Not Working For You - Looks like you manually installed the blueprint. If that is the case then you will have to manually update it. Click Here to go through the steps on how to do that.

But Wait!! If you would like to take advantage of this new update feature then you will have to import the blueprint again. Then update all of your automations, but check out the “Tip” below as it is not that hard to do.

  • TIP - In the YAML file of your existing automations is a file path. Once you imported the blueprint into your HA you can just change the file path to the new location in your existing automations. If you are unsure of the file path just add a test automation with the newly imported blueprint and go into your automation, top right 3 dots, Edit in YAML, and you will see the file path. Then copy the path of the newly imported blueprint automation.


    Before you update the path: First copy the YAML of the existing automation you would like to update and save it in another file as your back up, yes I like back ups.

    Once you have the new file path, use this file path in the existing automations you would like to update by replacing it with the new file path and clicking save. Do one at a time and check if it worked. You will then be able to use the new update feature in the future :wink:

Hope this helps you.


Blacky :smiley:

Back to FAQ: Click Here


Hi there, it would be very useful if the Github Gist would be moved to a Repo. Then we will be able to subscribe and get notifications of new releases.

Thank you for the blueprint / your efforts! :hugs:

1 Like

Is there a way to do the oppsite with dynamic lighting. Maybe not even use lux but the value of sun elevation. So when you are using the bathroom at 2 am you dont get flash banged. So from dusk to dawn the brightness decreases to the low value and starts to increase as dawn approaches.

“You have the option to use the “Dynamic Lighting”. It will dynamically adjust the brightness % to a floating lux value. When it gets darker your brightness will increase and as it gets lighter your brightness will decrease.”


have you tried clicking on Subscribe

That’s just for comments, not code changes - also, you wouldn’t want to get a notification for every new revision of a snippet being posted.

This is why a Github Repo would be much better - even if it’s just a single file… you can then trigger a “release” when you’re done with all new updates and it’s stable enough to release :slight_smile:

1 Like

Yea I thought of this when setting it all up but HA recommended using a Gist. Hopefully HA will work on it so it will notify us all within HA when the file has changed or give us directions on what they would like us to do. They did touch on it the last YouTube release and even possibility of warning you if it will break and maybe give an option to fix it. :crossed_fingers: Hope they develop something here.

The “re-import blueprint” is a nice new feature as it is now realy easy to update.

Blacky :smiley:

1 Like


This is on my list. No spoil alerts though.

Blacky :smiley:

1 Like

Thanks for a great blueprint:)
I have one question, is it possible to add a function for triggering the lights on with a door sensor? Now I can only use it in livingrooms and not bedroom, toilet since i have to walk in the room for motion to trigger, then the childern allready have pushed the wall button and everything is back the manual control:P

It is already there. Have a look at my templates Click Here . :honeybee: Bee In The Hive Sensor :honeybee: is a good one and you many need to look at Inverted Sensor. Make sure you group your motion and door sensor together and add the group to the trigger.

For more information on how to set up group sensors please Click Here.

Blacky :smiley:

@Blacky Thanks for this automation. I made a almost similar functionality in node-red. I currently thinking about switching to this automation but to do so i mis one thing.

In my node-red flow i also dynamically influence the color temperature. It would be nice to be able to configure a entity where the color temperature is read from instead of a static value.

@Blacky thanks for this blueprint, love the level of customisation provided here.

I have a use case where lights are turned on manually but I want to turn them off automatically when the occupancy binary sensor turns to off. So I tried to:

  1. Create a virtual switch that turns on/off as the occupancy sensor goes on/off
  2. Use the above switch for the “Enable the By-pass - Turn lights OFF”

However this will turn the lights off if they are already on and a person enters the room. The ideal behaviour should be the lights stay on. How should I go about fixing this?

Hello, first off all, thank you for this bluebrint.
i have this automation in my bath, someone goes in the light turn on for 5 minutes.
but when i take a shower the light turn off, and i cant it turn on agian.
so i want to keep the light on, if the huninity comes over 60% the light will be longer on for 10 Minutes. How can i make this. Thank you


No problem :wink:

What happens to the colour temperature…?

Blacky :smiley:


Thanks for your kind words.

One way would be to have an binary sensor switch that is a toggle. Then enter that switch into a group with your motion sensor. When you toggle the switch the automation is triggered and the time delay starts. If motion is detected in that time the automation runs as per normal. If not the light will turn OFF.

I think the is what you are asking.

Blacky :smiley:


Looks like you need my :shower: Bathroom Humidity Exhaust Fan blueprint. It will also control the fan and keep the light on. It also has a automation link so you can use this blueprint and the other one.

The other way is to use a template sensor (REF - TS-3 in the link below for template sensors) so when your bathroom is above 60% it turns the bypass on. Probably use option 3 in the by-pass and maybe an auto off.

A better way that I would recommend is to get a door contact sensor and use :honeybee: Bee In The Hive Sensor :honeybee: template sensor. You will love it. The how to and all my examples of template sensors Click Here.

Blacky :smiley:

1 Like