šŸ’” Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

@blacky

Thank you for this and your other amazing blueprints. Greatly appreciated. Iā€™m trying to get this to work for a specific use case and Iā€™m struggling. Use case: ā€œday timeā€ (defined by time/sun/whatever), I want the lights off normally, then trigger to on based on motion. Cool; easy enough. At night, I want the lights at, say, 5% and colour=red and trigger up to 75% on motion.

Ideally, at the transition time from night->day and vice versa, Iā€™d want to set the right scene (or configure parameters for lights manually). I can see on/off scenes for day time - do I just need to create 2 automations, one for day and one for night, and then a separate automation to trigger the scene changes?

Any way to do this all in one?

Hey Blacky,

thank you four this great blueprint.

I use a Hue motion detector and a Hue lamp.

I would like to use it as follows:

between 17:30 and 0.00 the lamp should go on at full brightness. Between 0:00 and 05:00, the lamp should come on at 5% brightness.

The switching between 17:30 and 0:00 works without any problems. But when I use the night light function, the lamp does not come on. What am I doing wrong? Below is the YAML code:

alias: "BM Flur Licht "
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.hue_motion_sensor_1_motion
    light_switch:
      entity_id: light.hue_lampe_flur
    time_delay: 2
    include_light_control:
      - use_brightness
    include_time: time_enabled
    after_time: "17:30:00"
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.hue_lampe_flur
    night_time_delay: 4
    include_night_light_control:
      - use_brightness
    night_light_brightness: 5
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "00:05:00"
    night_lights_before_time: "05:00:00"
    before_time: "23:59:00"

@pgale

Good question. Because it is your sensor providing the information to the blueprint then it is best handled at the sensor. It is hard for me to advise you on the best solution because I will need to make assumptions.

Letā€™s break it down PIR/mmWave/Occupancy

PIR = reacts fast or faster than mmWave and this is why it is in the sensor.
mmWave = is good at detecting motion but is slow to react.
Occupancy = combines both PIR & mmWave so you can use it in your automationā€™s like grouping them.

If your mmWave is so sensitive a lot of manufactures will allow for adjustment and even map an area. If you are getting a false trigger you will need to look at what happens. If it is detected and then clear in a short window (time frame) like 45 sec then you know what you are working with. When it is not a false trigger it stays on for longer periods. If this is the case then you may want to consider making a template sensor that has a longer delay before it will be detected. So your PIR may have a detected state and a 30 second time where it will then become clear. If you set up a template sensor that looks at your mmWave and will only become detected once the mmWave is in the detected state for 60 seconds remembering the blueprint has it own time delay before the lights turn OFF. Her is an example.

PIR turn ON the automation turning ON the lights, 5 seconds later the mmWave detects motion and starts your template sensor waiting for it to be ON for 60 sec before it will become detected. After 30 sec you PIR becomes clear, we are at the 35 sec mark, the automation then goes to its time delay of say 5 min before the light will turn OFF. At 65 sec the mmWave knows you are in the room but the PIR canā€™t detect you. The template sensor becomes detected and triggers the automation again keeping your lights ON. You group your PIR and your template sensor and use that as the trigger. Now you made your mmWave more usable and stop the false triggers.

As I said it hadr to give advice not knowing what is happening, but maybe this will assist you to finding the solution.

Your next question may be how do I make a template sensor. Have a look at REF - TS-2 in my template examples. You would use your mmWave entity ID. Click Here

Let us know how you go

Blacky :smiley:

1 Like

@cemil

Follow this example as it is what your are looking for. You would just need to include you red colour. Click Here

Let us know how you go.

Blacky :smiley:

@futurelook

You need to include your night lights time in your global time condition. See this expiation with a thumbs up and a thumbs down. Click here So your ā€˜23:59:00ā€™ has to be ā€˜05:00:00ā€™ to include night lights (it is a global condition). :+1:

Blacky :smiley:

Thanks, great reply and a lot to explore and think about.

Since I posted, Iā€™ve played a lot with the device. The mmWave sensor is incredibly quick to trigger, I think actually almost as fast if not as fast as the PIR - certainly quick enough for lighting use. Iā€™ll continue to test and see if I even need to break them apart and do what I was asking about. Good to know thereā€™s an option to do this though. :slight_smile:

Thanks for your continued support with your blueprints!

No problem hope you get it working.

Blacky :smiley:

@Blacky Hi - do bypass switch entities all have to be ON for the bypass to work, or is it any of them?

@Blacky First of All, awesome Automation.

I cant find your answer, but i remember you said someting about rgb control in the past.

Are you planning to add rgb control?
I have over 210 Lights in the House and i really hatte scenses. So everything over your automation would be awesome!

Hello there,
im relatively new to HA and im having trouble with this.
My motion sensor is working with other automations but something refuses to work here. the MS wont trigger this automation and neither the ā€œrunā€ button in HA. Any help would be appreciated

@Bastilein

Welcome to the community :wave:

This is on the list to do.

Blacky :smiley:

@bclassic

Welcome to the community :wave:

Without seeing your YAML it is hard to work out what is going on but you are probably using devices. Here is the link to the FAQ on how to expand down click here. If that is not it then could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on ā€œ</>ā€ and paste code in there.

Blacky :smiley:

alias: Sensor Light MS flur
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.hue_motion_sensor_1_bewegung
    light_switch:
      entity_id: scene.flur_ms_hell
    time_delay: 1
    end_scenes:
      - scene.flur_ms_off
    include_sun: sun_disabled
    include_time: time_enabled
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id:
        - scene.flur_ms_gedimmt
    night_time_delay: 0.5
    night_lights_conditions:
      - time_enabled
    include_night_light_control: []
    night_light_brightness: 100
    night_lights_after_time: "19:00:00"
    night_lights_before_time: "09:00:00"
    after_time: "09:00:00"
    before_time: "19:00:00"

@bclassic

That helpsā€¦ you are using time as a global condition and night lights. Because you would like it to run 24/7 please disable the time in ā€˜Use The Time Optionsā€™ and only use night lights time.

Extra note, you are using scenes for night lights and normal lights. To make it function better you can create 2 toggle helpers and enter one into ā€˜Scenes & Scripts - Toggle Helperā€™ and the other into ā€˜Night Lights - Scenes & Scripts - Toggle Helperā€™. Then also tick ā€˜If lights are ON, adjust the lights when crossing overā€™ in night lights control options.

Let us know how you go.

Blacky :smiley:

I have a feature request. What I was hoping Iā€™d be able to do with this blueprint is to group two sensors, and to trigger different sceneā€™s dependant on which sensor detects motion first. ie; I want my pathway lights to turn on from left to right if I walk towards them from the left, and the opposite scene if I approach from the right.

@Tetragonula

You will have to do that in a script and add it in.

If-then actionā€¦ if this motion is on then left to right else right to left :wink:

Niceā€¦ runway lighting :+1:

Blacky :smiley:

Hello,
Iā€™m using your blueprint and thanks for all the amazing work done!
However, Iā€™m getting some troubles with bypasses as if I want to leave the lights on or off for a while (and disabling sensor), Iā€™d user the bypass but when I set it up, the blueprint fails on conditions and does not do anything:

    include_bypass:
      - bypass_enabled_turn_off
    motion_bypass_lights_off:
      - automation.toggle_bedroom_lights

I believe this is becaue Iā€™m trying to use an automation but this is the only one I can see. Iā€™m trying to use a zigbee physical switch (4 buttons), but I donā€™t seem to find anything about it (for example, I would like to have the double click on button 2 to bypass turn off)

Any idea on how to achieve this ?

@Blacky

Thank you so much!! It seems to work flawlessly now.

On another note, how does one set up the sun elevation with appropriate offset. IĀ“d like to not change the time conditions in spring and fall all the time

Edit 1:
It just stopped working again.
Edit 2:
Just updated HA to ā€œ2024.3.1ā€ and for now its working again. IĀ“ve got no idea what went wrong in the first place^^

@variamus .

Firstly welcome to the community :wave:

The bypass must have an ON / OFF state. When the bypass entity is ON it will disable the automation and allow manual control of your light.

Looking at automation you are using. When the automation is disabled it will be OFF so the bypass allows the automation to run. When the automation is enabled it will be ON thus disabling this automation allowing manual control of the lights. Just tested it here using an automation and it works perfectly. If you would like it the other way you will need to create a template sensor that will invert it. I have examples of it and you would use REF - TS-7 click here

If you would like to use your zigbee physical switch (4 buttons) then you will need to toggle a toggle helper ON / OFF when you double click on button 2. You then use that toggle helper as your bypass. First you create a toggle helper .

  • Navigate to Settings > Devices & Services > Helpers.
  • Click on the ā€œHelpersā€ tab, then click ā€œ+ CREATE HELPERā€ and select ā€œToggle.ā€
  • Enter a name for the helper, such as ā€œSensor Light Bypass,ā€ and click save.

Once done just set up your zigbee physical switch so that when you double click it, it will turn ON and OFF the toggle helper. Enter the toggle helper into the bypass.

Let us know how you go.

Blacky :smiley:

@bclassic

Nice one glad you are up and running.

Nect to the sun condition is a link for more information. This is the link click here.

Blacky :smiley: