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

To create a script.

  1. Go to settings > automation & scenes > script tab
  2. Create script button > create new script > add building block > choose
  3. In option 1 add a condition > entity > state
  4. Choose your entities and set the state to ON.
  5. Then in your action Add action button > Type “light” and select turn On action. Set your light up as required.
  6. Then you can do it again for another choose and set your light up differently.
  7. Save.

Now add that script in Lights - Switches - Scenes - Scripts. Now when your light turns ON and you entity is in the state then it will turn on the lights to your preference.

If you want it to change to a different preference when your lights are ON then don’t add a Scenes & Scripts - Toggle Helper in but you will need to create a scene with all your lights used in your script with them OFF and add that scene into Scenes - Scripts To Turn OFF

There are many ways to do this and if you need help with scenes or scripts then you could create another topic on this forum as there are heaps of people that will help you.

Blacky :smiley:

@Danny5

You will need to update your Home assistant as this relates to a new code structure HA is using now.

Blacky :smiley:

1 Like

So if you would like this to happen when the automation turns OFF your light you will need to run a script. The script will set the lights to 50% and then go OFF. There is no direct setting in the blueprint for this and is why you will need to make a script.

Blacky :smiley:

@Frank78

Then to that state template you would add your condition for night lights. That way if no one is home and your night lights condition is OFF the bypass will be ON but if the night light condition is ON then your Bypass will be OFF.

Sorry I don’t know what condition your have for night lights so I can’t do the code example for you. Hopefully you will know what to do.

Blacky :smiley:

@defsdoor

Glad you both like it… thanks for the feedback.

Blacky :smiley:

:slight_smile:
thank you @Blacky
thanks for the pointer to the bypass.

Using the bypass for it is just not too obvious, especially since the explicit thing is available for the the nightlights. But for those overall less options are needed.

Let me check the bypass option - I have a boolean is_not_nighttime :slight_smile:

Sweet!!! Awesome blueprint! Thank you.

@Blacky

Not sure if you saw my original question but how would I implement this.

Could it be the blueprint is not working in HA 2025.1?

It seems to die just in the middle. Tested with 2 automations and version 7.5

Hi,

this seems to be z2m issue after upgrade to v2. I have the same problem which is described here: https://github.com/Koenkk/zigbee2mqtt/issues/25520

Entity sensor.your_dimmer_name_action has disappeared from HA after upgrade of z2m.

2 Likes

yeah Zm2 update to v.2 broke all kinds of stuff rolling back now. Maybe I’ll figure it out later just not worth it :crazy_face: :face_with_head_bandage:

In ZigbeeMqtt → settings → home assistant integration, enable the legacy action sensors, although thats fixed that specific issue, i’m still having trouble with this blueprint, still fiddling and changing settings since the last zigbee2mqtt update.

1 Like

@nicknol

Yes the bypass will disable the whole automation so you will have to make sure that if you would like your night lights to be active your will also need to make sure you turn OFF your bypass when this happens.

Blacky :smiley:

@shunopoli

Sorry I thought you worked it out.

What you can do is use the night lights. My understanding is the desk zone has priority over the other 2 zones with a warm white.

For all your lights just use light entities no scenes or scripts.

  1. Group all your 3 zones and use the group as the trigger. Link in blueprint next to trigger showing you how to group them.
  2. Enter in your light entities into Lights - Switches - Scenes - Scripts and set up your lights for cold white using the Light Control
  3. Enable night lights and use the Enable entity state option as the night light condition.
  4. In Night Lights - Entity State enter in your Desk Zone entity.
  5. Set up your Night Lights (same lights) and set your lights up for warm white in Night Light Control.
  6. In Night Light Control make sure you also select If lights are ON, adjust the lights when crossing over.
  7. Save and test it out :wink:

Blacky :smiley:

@beurdy

Looks like there may be an issue with z2m, V2. Thanks @lukas423 and welcome to the community. @serville may have a solution.

The problem in your trace line is with your ambient… probably your sensor. Maybe it is not communicating correctly. If you disable this option it should work then you will have to see what happening with your sensor.

I wouldn’t think so… but I never update on HA202?.1 I always wait for the second release or even the third depending on if I would use any of the new features. So I am yet to update and test it out.

Blacky :smiley:

Im pretty new to HA , coming from hubitat. Just playing around with this blueprint.

Not really related to this blueprint but i found my lights wasnt activating everytime im still workkng out lux levels so could be that.

Im using Hue motion sensors in pretty much every room. I notice they pull in occupancy and motion into HA.

Which am i best to use as a trigger?

Thanks

@J273

It all depends on what each mean.

Normally motion = PIR sensor. Like the ones that has been around for decades. They act fast so the automation can respond fast but may not detect you if you sit still.

Occupancy = Normally a mmWave sensor. They act slower at the start but are good at detecting movement even if you are still.

If we use them both then you have fast reaction and good detection.

If this is what your sensor is then what you can do is group your occupancy and motion and use the group as the trigger so you have the best of both. A link in the blueprint next to the trigger input shows you how to group them.

Blacky :smiley:

1 Like

Thanks for the reply and I will try this out. How would this handle say the fact I’m sitting in the desk zone and someone else walks into the other zone? I don’t want it want it to change to cold white if that’s case

@shunopoli

Because we are using your Desk Zone to activate night lights, whenever it is ON night lights will be applied. Then we use all of your zones as the trigger to turn the lights ON. It is critical you select If lights are ON, adjust the lights when crossing over for it to work.

Test it out and let us know how you go.

Blacky :smiley:

I don’t think that enabling legacy features back is a solution. It’s a mere workaround, because the core problem is still there. There will be only struggle maintaining it down the road.

@Blacky, do you think it would be possible to incorporate the device triggers in the blueprint please?