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

@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

Big thanks. I configured as needed now it works as expected.
20$ for your motivation support it!

Thanks for the awesome blueprint. I’ve been able to replace all my existing motion-activated light automations with this blueprint and works solid. One scenario I’m trying to work with involves NOT doing anything if the light is already on. Currently if the light is on and the automation is triggered by motion, it takes over control of the light and turns off the light following the motion sensor clearing up.
I’d do this in an automation by using a condition that runs the automation only when the light is OFF. Is there a way to achieve the same with this blueprint, effectively ONLY taking action if the light is OFF.

Thank you!

Hi Blacky, thank you for your amazing work on all your blueprints, they have transformed by Home Assistant experience! I hope you kindly assist me with the below query, perhaps what I am trying to achieve is already possible with the blueprint but I am just not seeing how!

I am currently using the ‘Sensor Light’ blueprint to automate turning on flood lights in my driveway when my camera (Unifi Protect) detects a person or vehicle in the driveway, this is working flawlessly however currently triggers anytime of day or night. I wish for it only to trigger at night time when it is dark outside.

I am aware of the ‘Ambient’ and "Sun Elevation’ features of your blueprint which are designed to achieve this however my camera integration provides a binary sensor (‘is_dark’) which is ON when the camera detects it is dark and the Infared light on the camera is active. Is it possible to use this binary sensor in the blueprint, i.e. only turn on the flood lights if ‘is_dark’ is ON. In the meantime I am using the ‘Sun Elevation’ feature.

Thanks again.