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

@clowgg

I have had a look at this… they will turn OFF but it is not the way I would like it… this has been fixed and will be in the next release. The update will be out soon.

I have tested it here it works but because you are using a scene we need to enter in one entity that is in your scene into “Lights - Switches - Scenes” and “Night Lights”. If you can enter in a switch from the scene that has no light control that would be the preferred entity but if you can’t then just enter in one light entity. The automation needs to see it and it can’t see scenes that is why we need just one entity.

So you will have your scene + one entity that it included in the scene. Example below.

Hope this helps.

Blacky :smiley:

1 Like

Thanks for the reply @Blacky
I have added the Lounge Lamp to “Lights - Switches - Scenes” and “Night Lights” just now. The automation will trigger when the sun sets in about 1.5 hrs, and we’ll see how it goes tonight.

Okay, keep an eye out for the update so the OFF will work as intended.

This worked @Blacky. I added one entity that was included in the Scene and it worked - the Night lights turned on with the configured scene. I noticed in the room & in the automation trace that the initial configured “Lights - Switches - Scenes" scene turned off before the “Night Lights” scene turned on - so there was a momentary ‘lights off’ event.

The lights also turned off at the end of the automation time - but I havent figured out if that was the delay timer expiring or the end of the automation timer.

@clowgg

Nice one.

It is delay timer expiring, but that is not what I would like so this has been fixed to turn off at end of condition.

I think you will like the update… sorry I didn’t want to say anything until it was fully tested, working and ready to be released :pensive:… sometimes it doesn’t make it. If you are just controlling brightness and or colour temp then you can remove your scenes now, enter in the entities, adjust the lights using light control options and tick the new feature box.

Blacky :smiley:

New update 5.1

New Feature :new:

  1. Night Lights - Use The Light Control Options - Now you have the option to select “If lights are ON, adjust the lights when crossing over” option. It will apply the light control settings to any light that is already ON when crossing over from normal lights to night lights and from night lights to normal lights.

    Without selecting this option, if the light are already ON and a night light condition crosses over, then they will keep the current state assuming you are up a bit latter at night or have some friends over and you don’t want the lights to go into night mode. Once the lights turn OFF, night mode settings will be applied the next time they turn ON. That is not always the preferred option in every area… so you get to choose what scenario you would like by just ticking a box

    If any lights are different from normal lights to night lights and are OFF, they will turn ON to the light control settings or OFF if required regardless if you tick the option or not.

Bugs Fixes :bug:

  1. Light not turning OFF instantly at end of global conditions.
  2. Crossover lights.

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:

3 Likes

Thanks for the update! I want to try this out. Silly newb question, but how to I update the blueprint and all the automation that are built on that blueprint?

Thanks.
–pat

Hi @PatWasHere

Firstly welcome to the community :wave:

For now see below but keep an eye out for this months HA release…

Q: How do you update the blueprint and not delete / recreate existing automations?

A: Please follow these steps Click Here.

Blacky :grinning:

1 Like

Thx for this excellent blueprint!
I’m discovering HA at the moment. As soon as I start to move all of my home automation from Fibaro HC2 to HA, this blueprint is definitely worth a donation!!!

1 Like

cool thanks for the tips. Tho I just watched a video of what’s coming up in the December HA release and they said there is a new update blueprint options being implemented. I will wait for that release.

I have a question regarding Night lights and Motion sensors.

What I want to achieve for my garden lights is:

  • My lights turn always On between 6:00h and turn Off at Sunrise
  • My lights Turn always On between Sunset and turn Off at 23:00h
  • During night time (23:00h and 6:00h) my lights turn on for a few minutes based on my motion sensor.

My setup:

  • My “Trigger Sensor - Binary Sensors - Schedule” is a Scheduled Helper (daily 6:00h to 11:00h and 15:00h-23:00h).
  • “Lights - Switches - Scenes” is a light scene to turn my lights ON
  • “Scenes To Turn OF” is a scene with the lights that have o be turned OFF
  • “Use The Light Control Options” is turned ON
  • “Use The Sun Option” is turned ON
  • “Use The Night Lights Options” is turned ON
  • “Night Lights” Is the same scene as the Lights - Switches - Scenes
  • “Night Lights Conditions (Required For Night Lights)” is turned ON
  • “Night Lights - Entity State” is the status of my motion sensor.
  • “Night Lights - Start Time” 23:00h
  • “Night Lights - End Time” 6:00h

Maybe I am doining something wrong, but my lights don’t turn on based on my motion sensor.
What am I doing wrong?

Hi @Blacky, thanks so much for this blueprint! It’s amazing and I’m using it already in a couple of places.

I have 2 questions about more implementation:

  1. How can I set the trigger to be both motion sensor 1 and 2 (not or). In this case I’m trying to setup a specific area by the door that won’t get triggered when people pass nearby.

  2. Similar but a bit different in another room: Can I setup where motion sensor 1 turns on the light, and the light stays on with either motion sensor 1 or motion sensor 2? (So the light doesn’t turn on from motion sensor 2, just using that one to keep the light on).

Thanks :slight_smile:

@mars2020

Let look at this

  1. My lights turn always On between 6:00h and turn Off at Sunrise
  2. My lights Turn always On between Sunset and turn Off at 23:00h
  3. During night time (23:00h and 6:00h) my lights turn on for a few minutes based on my motion sensor.

Lights are ON with 1 but 2 you would also like it OFF at 23:00??? is it ON or OFF?
3 between 23 and 6 = motion.

So
Schedule from 6 to 23 = your motion sensor, then group them but there is a but. The tricky part is the group so you will have to create a template binary sensor for your schedule. So when your schedule is ON your template binary sensor is ON. Then you can group your template binary sensor and your motion sensor and add this group to the trigger. Your done. :wink:

I have some examples for template sensors, look at REF - TS-5 Click Here

Blacky :grinning:

@Doodle6598

Thanks for your kind words :smiling_face_with_three_hearts:

Not sure what item 1 is, I am not understanding :pensive:

Item 2 I understand… so you will need to crate a trigger binary sensor… I dont have an example in my template sensors and not sure if you know what to do so the code is below. More information on what to do with this code is in my examples of the binary sensor. Click Here. Once you create it then you add this binary sensor (only this one) into the trigger.

Things you need to change are:

  • “binary_sensor.motion_sensor_1_here = This is your motion sensor 1 entity name.
  • “binary_sensor.motion_sensor_2_here” = This is your motion sensor 2 entity name.

The things you can change to your liking are:

  • “2 Motion Sensors” = This is the name you would like to call your new sensor.
  • device class “motion” and icon “motion-sensor”. = Change to your liking but is should be okay.
template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.motion_sensor_1_here
        to: "on"
      - platform: state
        entity_id: binary_sensor.motion_sensor_1_here
        to: "off"
      - platform: state
        entity_id: binary_sensor.motion_sensor_2_here
        to: "off"

    binary_sensor:
        - name: "2 Motion Sensors"
          device_class: motion
          icon: mdi:motion-sensor
          state: >
            {% if is_state('binary_sensor.motion_sensor_1_here', 'on') and is_state('binary_sensor.motion_sensor_2_here', 'off')  %}
              on
            {% 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') %}
              on
            {% elif is_state('binary_sensor.motion_sensor_1_here', 'off') and is_state('binary_sensor.motion_sensor_2_here', 'off') %}
              off
            {% endif %}

Hope this helps you… let us know how you go

Blacky :grinning:

2 Likes

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