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

Hi!

It seems that the Sun Elevation setting is not working. I have a schedule for the trigger to turn on a lamp but it shouldn’t turn on until Sun Elevation is -1.5 degrees. Sun elevation is way above that currently, but still the lamp is turning on.

Any suggestions on what to check?

alias: TEST
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - schedule.led_curtains
    light_switch:
      entity_id: light.lamp
    include_light_control:
      - use_brightness
    include_sun: sun_enabled
    sun_elevation: 1.5
    sun_elevation_rising: -4

@Doug

Hi Doug, your sun elevation is 1.5 not -1.5 you missed the minus value.

Blacky :smiley:

I definitely did. Good catch! However, the sun elevation was at around 15 degrees when I posted this. It seems it still shouldn’t have triggered, but I may be understanding the settings incorrectly?

Try rebooting your HA sometimes things get messed up. Take note of the sun elevation before and after a reboot. I tested it here again and it is working perfectly.

EDIT: Also make sure you refresh your browser.

Blacky :smiley:

Will do and report back. Thanks!

Hi
Thanks for the quick reply, I’ve removed the other code from my original post.
I have the timer set at 5 minutes using the blueprint. The issue I seem to have is that the lights turn off after 5 minutes - regardless of whether motion is detected or not within those 5 minutes. The other blueprint I had the code from has a reset that resets the timer/script if movement is detected within the 5 minute timer period.
The effect of this is, the lights turn off after 5 minutes regardless of movement detection during the 5 minute timer. My wife or I have to move or wave a hand at the motion sensor to re-trigger the automation for another 5 minutes.
With the reset in place, the light doesn’t go out after 5 minutes if motion is detected during the 5 minute timer period as it gets reset and starts over.

alias: Dining Room Sensor Light
description: "Dining Room Light automation using Sensor Light Blueprint "
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.dining_room_presence_sensor_presence
    light_switch:
      device_id: 22fb0111d82aefbcb5b575e164543c8e
    include_light_control:
      - use_brightness
      - use_transition
    light_brightness: 80
    light_transition_on: 5
    light_transition_off: 10
    include_light_colour_control: use_colour_temperature
    light_colour_temperature: 3000
    include_sun: sun_enabled
    time_delay: 5
    sun_elevation: -1.5
    sun_elevation_rising: -4
1 Like

@BornInThe50s

Thanks for sharing your YAML and removing the code. I see the issue: you are using a device in your Lights - Switches - Scenes - Scripts section. Devices are not supported here; you need to select the specific light entities instead. Also, since you’re using light control, make sure your entity is a light, not a switch.

Additionally, note that the automation should not have run when you selected a device. Ensure that no other automation is triggering it. If so, you may need to remove or disable that automation.

To resolve this, you can expand your device to select the light entities. Here’s a helpful guide on how to do that: Click Here

Let us know how you go.

Blacky :smiley:

Hi, just wanna give you a hand and say what a fine blueprint with so many options. I have 1 question, dunno if you can help me achieve it @Blacky.

I’m trying this blueprint with my Aqara fp2, i have multiple zones, 1 zone i want that the lights go on if the zone(motion) is occupied for like 10 seconds, so the condition is that the motion trigger needs to be at least 10seconds active before the automation can proceed to execute. You have any idea how i can achieve this with you blueprint?

Many thanks in advance!

@Peke

You will have to create a template sensor with a delay on for your motion sensor. Then use it in the trigger. The template example is for a camera but it works the same to what your are trying to do. Click Here

Blacky :smiley:

FWIW: I actually still have the same problem with night light scenes not activating from the automation even though using scripts that activate the exact same scene does work. This is only in the night light flow, although I don’t seem to use scenes in most other places anyway (just scripts). Certainly not a showstopper by any means. I’m just adding this to the thread in case it appears that the original report was considered dead. I’m fine with using the script.

@ronverstappen

Hi Ron, have your enabled the crossing over options?

Blacky :smiley:

Is there anyway to have the lights stay on (or at its current state) when the automation ends?

@sombody88

Can you explain what you are doing and why you would like that as my other blueprint may be better suited for you.

:high_brightness: Smart Light - Entity - Sun Elevation - Ambient & Time Triggers

Blacky :smiley:

I was about to edit but you respond quickly!

I am using your dynamic lighting to adjust the light levels in the room based on the lux value between a certain timeframe. However, once the automation ends, I want to keep the lights at its current state.

The bypass is not useful as it would pause the automation which is not something I would desire.

I could also see this option useful in saying chaining multiple of your blueprints for more complex lighting situation.

PS. Sorry if the option is already there and I may have missed it.

@sombody88

When the automation ends it turns the lights OFF unless you pause the automation but that’s something you don’t want to do. So you will have to turn the light ON manually when the automation ends. If you are using a time frame then you can use the smart light BP to turn it on at the same end time.

Blacky :smiley:

Gotcha. Thanks again for the help and great blueprint! I’m still learning the ropes of it but it is pretty comprehensive!

1 Like

Thanks for that, helped me a lot and seems to have been working fine for the last 2 days :slightly_smiling_face: :+1:

1 Like

@Blacky Sorry to persist, but could explain the differences between the two? thanks

Hi @Blacky , still loving your automations. Using four of them on a regular basis and cannot think of how life has been before :smiley:

Quick question if this is feasible before I order any more contact sensors: when using the toilet, sometimes the light goes off because I do not move soon enough for the motion sensor to keep the automation running (I know - bad habit to take your phone to the restroom with you :stuck_out_tongue: ). I do notvwantbto change delays or anything as the settings work very well in general when I use the bathroom.

Now, to keep the lights on while using the toilet, I thought about adding contact sensors to the lid of the toilet and somehow add the sensors state (via a helper) to the automation to keep the lights from going off.

However, I am not quite sure if I can just use the „Bypass Switch - Turn Lights ON“? I also use a helper for bedtime as „Bypass Switch - Turn Lights OFF“ which prevents the lights from turning on when this helper is active.

I akso looked to use your blueprint „Closet, Pantry, and Cupboard Lighting“ but there is no illumination option for a motion sensor which would mean every time I open the lid, the lights would turn on, meaning also when it is bright enough in the first place (except for when the bedtime helper is active of course).

So long story short: How can I keep the lights on while using the toilet without compromising the comfort of my current setting?

Thank you so much!

Is it possible to have the time delay stored in a input_number? I tried using time_delay: {{ states('input_number.bevegelse_timer_gang') }} with and without casting it to float.