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

@TheLordVader

The issue is that the automation keeps triggering even if the light is already on. When the light is off, the automation triggers and turns it on. If it triggers again while the light is on, it resets the delay, and this cycle continues until no more triggers happen and the delay passes. The challenge is that you can’t simply add a condition to check if the light is already on to stop the automation because of how the automation is structured.

I have a method that might help: If you manually turn the light on, it will activate a template binary sensor that can be used to bypass and disable the automation. However, if the automation turns the light on, the template sensor won’t activate, allowing the automation to continue running. It’s not a perfect solution and has some limitations, but it might be what you’re looking for.

If this sounds useful and you’d like to know how to create the template binary sensor, just let me know, and I’ll provide the steps.

Blacky :smiley:

1 Like

Some of my lights are dimmers which support brightness. How can I achieve my use case?

Between 8pm and 5am I’d like some lights to come on at 20% brightness. These lights are usually all off. Do I understand correctly that home assistant can’t change the brightness while the light is off? How would I use this automation to accomplish this?

The only thing more amazing than this blueprint is the community support that drives it. Wow!

EDIT: I saw some other blueprints that had similar features. For my use case ^ I want it to be time driven in some cases and sun driven in others. Is this the right blueprint for me?

1 Like

Hey Blacky, thank you so much for your time and support!

You are absolutely right, it is at 0% and I do not have a toggle helper. I read that actually, but from the description I couldn’t figure out what it implies or means at the beginning, and after the automation worked well, I assumed it is optional-ish
. When I noticed the problematic behaviour later I didn’t assume it is really related to my problem, since it mentiones missing light entities etc (not a problem I have - for now at least). I now googled a bit, but I still don’t have a clear image of what is required from me.

What is a toggle helper? Is it a HA concept or is it a term specific to this blueprint (I found something related in HA docs, but i cannot connect the dots)? What does it look like implementation-wise (is it a script, a boolean, another automation, a template,
) and how should it behave so that I can achieve my goal?

I have some derived sensors for sunlight (based on elevation and Lux sensors in combination) that worked really well for my previous automations. I just registered it as additional trigger and condition, and it would work very well. If i click on the trigger helper input field in the blueprint, it gives me some switches I created, and the option to create a new one. If I create a new one, I end up with an input boolean. But this is not really what I had in mind - I don’t want to switch it on manually (at least that is what it looks like), but I want the automation to trigger using the parameters in the dynamic lighting tab (e.g., sun below certain elevation or current lux readings below threshold). And i cannot use my old trigger here for that, which would be a binary sensor (on=sunlight, lights off, off=no sunlight, lights on; at least thats how i used it previously).

I feel like I am missing something which is very obvious for everybody else (sorry for that!), but I dont really understand what I am required to do. It reads that it is imprtant, that it is recommended and I need it, but not really how I can accomplish it.

Thanks again for the very kind and quick support, it is very much appreciated! That, and the awesome blueprint!

Sorry for the lengthy post, I just hoped it would help identifying where the error in my logic is.

Best,
Chris

@charlydelta

Hi Chris,

I am all good with long post as it can give me a better understanding.

A toggle helper in Home Assistant is like a virtual switch that can be controlled manually or through automations. It helps track or trigger events in your smart home system. In our case, with dynamic lighting, we use a toggle helper to monitor whether an automation is still running, even when the light brightness is set to 0% (which effectively turns the light off). This way, the toggle helper provides a clear indication that the automation is active, even though the light is OFF.

In general, toggle helpers are useful for controlling or tracking any binary state in Home Assistant, like ‘on/off’ or ‘enabled/disabled.’ You can use its state to control automations or any service that needs a switch to indicate whether something is running, whether it’s true or false. While toggle helpers can be used for a variety of purposes, I hope this gives you a better understanding of what they can do and how developers commonly use them.

Yes, you can create a Toggle Helper this way. While they’re also referred to as Input Booleans, that term can sometimes be confusing for users who are new to HA or automations. Toggle Helper is a more intuitive name, and it’s what HA now calls it in the UI.

To create a toggle helper, follow these steps:

  1. Navigate to Settings > Devices & Services > Helpers (tab at the top).
  2. Click the Create helper button.
  3. Select Toggle.
  4. Enter a name for your toggle helper and choose an icon, if desired.

There are many types of helpers you can create in Home Assistant. By following steps 1 and 2, you’ll see a variety of helper options to choose from. All the helpers you create can be managed in the same location, as outlined in step 1.

As already stated above, HA has added a recent feature to help streamline the process. Within the blueprint, during input selection, you can now create a new toggle helper directly by scrolling to the bottom of the list of entities and selecting Create a new Toggle Helper. This avoids the need to leave the blueprint editor. The toggle helper created this way is exactly the same as the one created via the steps above, making it easier to incorporate into your automations.

Once you create a toggle helper and add it to an automation, you don’t need to manually turn it ON or OFF
 the automation will handle that for you. If you add the toggle helper to a dashboard, you’ll see it switch ON when the automation is running and OFF when it’s not.

Creating the toggle helper and selecting it in this input is all you need to do. Note that this toggle helper should be dedicated to this one automation only and shouldn’t be used for anything else. If you create another automation, you’ll need to create a new toggle helper specifically for that automation. You only need to create this toggle helper if the minimum brightness value is set to 0%.

Hope this helps you understand helpers and why we use them.

Blacky :smiley:

1 Like

Maximum ON Time even if Triggers do not clear?

I use door/window sensor in some scenarios, but sometimes the door isn’t closed, so the light never turns off automatically. Is there an elegant way to turn off the lights even if the triggers never clear?

@SpaceGlider

In the FAQ I show examples of template sensors. This is the one that would best suit your needs. It will auto turn OFF. Once created you sue it in the trigger rather than your door/window sensor. Click Here

You could also create (add to this template sensor) a template binary sensor that has auto OFF with it turning OFF if the window/door turns OFF.

Note: I also have other blueprints that handle this like :door: Closet, Pantry, and Cupboard Lighting just depending on what you are trying to do.

Blacky :smiley:

1 Like

I’m new at setting up this blueprint, but it looks so amazing! I’m trying to have two lights switch.outside_front_porch_lights and switch.outside_garage_door_light turn on at sunset and turn off at sunrise. Here’s my yaml. What am I doing wrong?

description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    time_delay: 5
    include_sun: sun_enabled
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - sun_enabled
    night_lights:
      entity_id:
        - switch.outside_front_porch_lights
        - switch.outside_garage_door_light

Thank you!

Hi!
I’m trying this blueprint for the first time to replace my light automations.
I’m having trouble with the bypass. I want to use 2 different bypasses:

  1. Sleep mode: I turn this helper ON to prevent my pets to trigger the lights while I’m sleeping.
  2. Manual mode: I turn this helper ON to avoid lights from turning off, when I want to control them manually.

When I use them both simultaneosly the whole automations stops working, lights don’t turn on/off anymore.

Am I doing anything wrong here?

@bmbouter

Hi Brian,

If you would like to just turn the lights ON and OFF at sunset and turn off at sunrise then use this blueprint :high_brightness: Smart Light - Entity - Sun Elevation - Ambient & Time Triggers. Once you installed it I have provided your YAML for you to copy / paste it in. Look in Trigger - Sun Elevation and adjust your falling and rising settings to sure your requirements. Then sit back and enjoy.

alias: Outside Front Lights
description: ""
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    include_sun:
      - sun_falling
      - sun_rising
    light_switch:
      entity_id:
        - switch.outside_front_porch_lights
        - switch.outside_garage_door_light

Blacky :smiley:

1 Like

@PeL4

Everything looks good! No matter which bypass you use, it will disable the automation. When you select options 1, 2, or 3, you’re simply deciding what happens when it’s turned ON.

For example, if your light is ON and you activate Sleep mode, the light will turn OFF, as per option 2. If you turn ON Manual mode, the light will remain either ON or OFF, depending on its current state.

When any bypass is active, the automation is disabled. For the automation to function, all bypasses must be OFF. If multiple bypasses are ON at the same time, the entire automation will stop, allowing the lights to be controlled manually only.

Also note the Bypass - Time Delay

Blacky :smiley:

1 Like

For some reason this is what happens with my occupancy sensor:
image

The device only registers a occupancy, but it somehow triggers the automation twice


Hi,

I have used the blueprint succesfully in the past and its working perfect when I dont have night mode. The second I do have nightmode on, it doesn’t work. Day or night


This is what I have setup:

Tried to do it in once picture by zooming out. Please let me know if its unreadable.

At first I filled in Night Lights - Entity State but then I read thats only when you want the nightlight to be triggered by an entity state and it this point I would be fine with the automation being triggered by time. So what am I missing?

Hello Blacky, thank you very much for the Blueprint. I am new to Home Assistant and unfortunately not very experienced in such things. I use the entities from Homematic as an example oil a presence detector with which I want to switch a light on and off and this depending on the time of day. Unfortunately, I can’t get it to work in the Blueprint. Where could the error be or what should I post to get help? Many thanks in advance.
Thank you very much

How can I configure my motion lighting such that it always turns on, but during certain hours it holds the lighting on? The current state bypass seems close to a solution. But IIUC, it would also prevent the lights from coming un during the bypass period.

Hey Blacky, thank you so much for your very detailed explanation! I really had a complete misconception of what this toggle helper does. It didn’t even cross my mind that creating and assigning one is all that is required from me. It’s a little bit hard to test my automations right now, but I am confident it’ll work now.

Thanks again for taking the time and helping out so quickly!

Best,
Chris

Edit: works like a charm! :heart:

@Hometoza

At 10:25:26 = Switched on triggered by automation corridor light triggered by the status of motion detector occupancy

then

At 10:25:27 = Switched off triggered by automation corridor light triggered by the status of motion detector occupancy

For some reason it is triggering ON and OFF in 1 second. Do you have a time delay? The time delay is under Lights

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:

@Limbeck

Welcome to the community.

I am not sure what domains you used for lights. If it a scene or script could you provide what each one does and maybe the entity used in them.

Then could you also 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:

@derBremser

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.

EDIT: I see you deleted a post so I not use if you now got it working.

Blacky :smiley:

@darryldaytona

Welcome to the community.

You probably be best to create scripts for Lights - Switches - Scenes - Scripts & Scenes - Scripts To Turn OFF.

Lights - Switches - Scenes - Scripts = Just tun the light ON

Scenes - Scripts To Turn OFF = Turn the light OFF but during certain hours it holds the lighting ON and when X time if light is ON turn OFF. So there would be a IF Then for this to happen.

Make sure you also use the Scenes & Scripts - Toggle Helper

Blacky :smiley:

@charlydelta

Hi Chris, nice one thanks for getting back to us.

Enjoy

Blacky :smiley:

1 Like