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

Awesome blueprint! I have an Aqara FP2 presence sensor in my dining room. I use the FP2 as a trigger for your blueprint. However, due to the configuration of the room (open concept), I want the motion trigger to only trigger if the FP2 reports presence for xx seconds (say 15 seconds); NOT a 15 second delay in turning the lights on. The presence sensor must continuously report presence for at least 15 seconds before the trigger is triggered.

I don’t see a way in your blueprint to modify the trigger “on” period to allow for such a trigger period. What’s the best way to do this?

Ok great, thanks!! I will implement this when I’m back home tonight. (And I’m new to template sensors so appreciate the faq link.)

Re: item #1…I’ve tried using one motion sensor in every possible position by/around the zone to trigger the light on the ceiling. But no matter where I put it, there are always accidental triggers when someone walks nearby the area but not into the actual intended area (due to the layout of the hallway/corner). If I use 2 motion sensors across from each other, I can define a specific zone where only both sensors are tripped and not just one or the other. (Kind of like the overlap in a venn diagram.) Is it possible to use the blueprint where both motion sensors need to be tripped together, as the trigger?

Actually… looking at your solution for item #2, I wonder if the solution for #1 is also a template sensor, but with these settings:

state: >
            {% if is_state('binary_sensor.motion_sensor_1_here', 'on') and is_state('binary_sensor.motion_sensor_2_here', 'off')  %}
              off
            {% elif is_state('binary_sensor.motion_sensor_1_here', 'on') and is_state('binary_sensor.motion_sensor_2_here', 'on') %}
              on
            {% elif is_state('binary_sensor.motion_sensor_1_here', 'off') and is_state('binary_sensor.motion_sensor_2_here', 'on') %}
              off
            {% elif is_state('binary_sensor.motion_sensor_1_here', 'off') and is_state('binary_sensor.motion_sensor_2_here', 'off') %}
              off

I’ll try that out too, and see if it works!

I’m testing this great blueprint👍, but I need to know if the scenario allows to restore the lighting in the room, after turning it off in absence and on again in presence.

I’m using an FP2 sensor, and I would like a feature where the light turns off in absence after a certain amount of time (or switches to some sort of scene for absence in the room).
In doing so, Home Assistant will take some sort of “fingerprint” of the lighting status (on/off, brightness level, color temperature and color of each light) before turning it off.
And when it resumes presence in the room, it will restore the lighting scene to exactly the state before it was turned off in absence.
Is this possible ? Alternatively does anyone have an idea for this ?

Thanks for your quick response and explanation. I will test this coming weekend.
Maybe it s an idea to add an option to the Nightlight to be triggerd on a motion sensor, so a dedicated trigger sensor for night lights……

@DuckDuck25

You have to create a binary template sensor. see REF - TS-2 in my template examples. It is in the FAQ.

Q: How do I create a template sensor so I can use it in the blueprint? or, How can I make the automation work better?

A: For template sensor examples Click Here

@Doodle6598

No problem, thanks for letting us know.

Blacky :smiley:

1 Like

If you don’t use the Light Control Options then yes it just turns on what you have before… so if your light allows for this then yes it will do that but don’t enable any Light Control Options.

If you use the Light Control Options then no it will not restore it to the automation setting. It will only apply the settings you have set. If you change them when it is ON then they will stay that way until the light is OFF, then it will apply what is in the automation next time it turns ON.

Blacky :smiley:

1 Like

@mars2020

Nice one.

Thanks for your suggestion I will add it to the list.

Blacky :smiley:

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.
image

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:

HOW TO UPDATE A BLUEPRINT

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”.

1

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

11

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

8

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.

2

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;

https://gist.github.com/Blackshome/6edfec0ff6a25c5da0d07b88dc908238

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.

3

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

5

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.

7

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

    10

    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.

Enjoy

Blacky :smiley:

Back to FAQ: Click Here

7 Likes

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:

2 Likes

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.”

2 Likes

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

@kobejo34

This is on my list. No spoil alerts though.

Blacky :smiley:

1 Like