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

Hi @Blacky. Thanks for this blueprint! FYI: Somewhere between 6.x and 7.1 the Nightlight light/scene/script entities lost the ability to be a scene entity. It only tries to turn on lights and run scripts. Cheers!

Actually, I found that if I remove the scene entity and then add it again, it starts working. It must be a wrinkle in the jump between 6.x and 7.1. This happened on every instance of this blueprint. No worries. Itā€™s probably not worth investigating.

@wrobelda

Thanks for your input. I is nice to get some feedback as a developer. I take your suggestion on board and if you would like to PM me with the other sections which require similar attention I look at them to. You can just put the section heading and the description you think needs to be changed rather than in code. Sometimes fresh eyes and using it for the first time can be a good thing.

Blacky :smiley:

1 Like

@rs_007

Hi Ryan

Let me know if you can manually turn your light ON at 1%ā€¦ please be true full here as hours / days of work will be in the investigation of it (down a rabbit hole). It may be the Dynamic Lighting - Step Value so in your testing can you set this to 0 and see if that works.

Blacky :smiley:

@ronverstappen

Interesting, the only thing that change was light colour temp and nothing to do with scenes.

Thanks for letting us know.

Blacky :smiley:

Update: I set the min brightness to 8% and the lights worked as expected.

However setting the lights manually to 1% also works just not in the blueprint automation.

Very weird but happy your suggestion worked and Iā€™m ok with the solution :slight_smile:

1 Like

Iā€™m still slightly confused by how Bypass Auto-Off works.

My use case is a bathroom with two light fixtures: a main one and over the sink one. Both are controlled with separate switches, the main light switch is outside the bathroom. Also, thereā€™s a motion sensor on the ceiling.

My Sensor Light template configuration is:

  1. Trigger: bathroom ceiling motion sensor
  2. Lights: Bathroom Sink Light, Time Delay 1 minute
  3. Bypass Switch:
  • option ā€œ3: Keep the lights current stateā€
  • using Bathroom Main Light switch
  • 0 minutes time delay,
  • Bypass Auto OFF using ā€œKeep The Lights Current Stateā€ option and 1 minute delay

What I want is:

  1. if I donā€™t turn the main switch on before entering the bathroom, the over the sink light gets turned on on motion detected and switched off 1 minute after motion no longer detected. This works fine.
  2. If I turn the main switch before entering the bathroom, the over the sink light does not get turned on. This is thanks to bypass and it works fine.
  3. If I then leave the bathroom, the main (and sink, if turned on manually) remain on for 1 minute of inactivity, then get switched off.

The third use case doesnā€™t work. Whatā€™s happening is if I turn the main switch before entering the bathroom, it gets switched off 1 minute later precisely, even with motion being detectedā€¦ I assumed that the Bypass Auto Off also consider whether there was motion detected, but apparently thatā€™s not the case?

If this works as intended, I would suggest adding an option to also make it consider the motion. Alternatively, I can disable the ā€œbypass auto OFFā€ altogether and add a separate automation that would turn the main light off upon inactivity. This should work fine, but it would still be nice to have all the bathroom light switching logic combined in one automation.

@wrobelda

The bypass can not be your light / switch entity. It must be a independent switch.

Blacky :smiley:

But it is! The are two lights, the light I use the automation for is the sink light, meanwhile the bypass is configured using the main light switch.

This works fine, the only thing that doesnā€™t like I thought it would is the Auto Off functionality, which I thought was going to switch the bypass off a minute after no motion is detected.

Anyway, Iā€™ll use a separate automation for the main light and be over with it.

1 Like

Thank you for helping me keep out all the bugs- I was able to set up a presence controlled hallway light with a bypass to turn off the lights using door sensor - thanks @Blacky

1 Like

What Iā€™m looking for now is the opposite: an option to control the group of lights in an area based on the presence sensor the following way: reduce the brightness of the lights that are on when no one is in the area, and reset it to the previous value when someone comes back into the room

@keresztes.kristof

Have a look at this post as it could be close to what you are after Click Here

Blacky :smiley:

I have one more inquiry: is it possible to have the automation turn on the light on motion only at specific hours BUT have it turn the light off automatically all day long? I.e., I want the light on at night automatically upon activity but have it turn off automatically all day long.

may I ask how the dynamic light color temp is working with RGBW lights? I made a card which shows all the components, but cannot really figure it out. Is there a way you calculate Kelvin to RGBW? thanks

Is it possible to add the no motion detected time delay thatā€™s used in the supplied HA Motion Light Blueprint as below? This resets the Time Delay (Wait) if motion is detected within the no motion countdown time period. I find without this, the lights just turn off with or without activity after the delay has expired (hope that makes sense) Maybe it already does something like this, & it isnā€™t working for me :thinking: I tried, I failed miserably, Iā€™m 67 and never programmed or coded in my life - so big :+1: to those that can :slightly_smiling_face:

Sensor Light Blueprint code

time_delay:
          name: Time Delay
          description: The time delay determines how long the lights, switches, scenes,
            and scripts will remain active after all triggers are clear, initiating
            the time delay to turn them OFF.
          default: 5
          selector:
            number:
              min: 0.0
              max: 30.0
              step: 0.5
              unit_of_measurement: minutes
              mode: slider

Motion Light Blueprint code

Removed by request

@wrobelda

Yes. There are four conditions: sun elevation, ambient, time, and device tracker.

  • Time: Set this if you want the automation to run during specific hours.

  • Sun Elevation: Use this to control the automation based on the sunā€™s position.

  • Combination of Time and Sun: To start at sunset and turn off at a specific time, like 11 PM, set the start time before sunset (e.g., 4 PM) and the end time at 11 PM. Then, configure the sun elevation so it triggers at sunset and deactivates after 11 PM (e.g., elevation +10). Both conditions must be met for the automation to run, so it will activate at sunset if motion is detected and deactivate at 11 PM.

Blacky :smiley:

1 Like

@rbhun

Dynamic lighting controls Brightness and or Colour Temperature.

If you use Brightness then brightness in light control will be disabled.

If you use Colour Temperature then colour temperature and RGBā€¦ in light control will be disabled.

Blacky :smiley:

@BornInThe50s

Thank you for reaching out! The information youā€™re looking for is already includedā€¦ please see below.

If youā€™re encountering issues and would like me to take a look, please share the YAML code for your automation. This will display the settings youā€™ve selected, making it easier for me to assist. Hereā€™s how:

  1. Open your automation.
  2. Click the three dots in the top right corner.
  3. Select ā€œEdit in YAML.ā€
  4. Copy the entire code.
  5. Return to the forum and, in your reply, click the ā€œ</>ā€ button in the toolbar.
  6. Paste your code inside the code block.

Could I kindly ask you to delete the code you posted earlier that pertains to another blueprint? This will help keep the discussion focused. Thank you so much for your cooperation.

Blacky :smiley:

Oh, thanks, although thatā€™s not what I needed help with. My concern was whether the automation would turn off the light after manually turning it on outside of the configured time constraints. I had it tested already, though, and it indeed does switch off, so it works exactly as I need it to.

@wrobelda

Nice one, thanks for letting us know :+1:

Blacky :smiley: