💡 The Everything Light - Trigger a light any way and turn it on in any way

Get it now:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Introduction:

The Everything Light: select any trigger and turn on your light in any way.

  • Turn on a light at the push of a button
  • Turn on your stairwell lights when motion is detected and then turn them off again after a set time
  • Turn your living room lights to a warm color at 20% when your TV turns on?

This and much more is possible with this Blueprint.

How it works:

Select any trigger.
Select any condition.
Choose the lights you want to control (switch entities are supported, but due to their nature they only support the DEFAULT and TOGGLE modes.)
Choose the mode the light should use to turn on:

  • DEFAULT MODE: The light will turn on at its default setting.
  • FIXED BRIGHTNESS MODE: The light will turn on at a set brightness percentage, optionally color or temperature can be set.
  • DYNAMIC MODE: The light will be assigned a brightness value based on the value of a ambient light sensor, optionally color or temperature can be set.

Choose if the light needs to turn off again or not. There are 3 possiblities for this (multiple options can be activated at once).

  • TURN OFF WITH TRIGGER: Select triggers that turn off the light.
  • TURN OFF AT TIME: Turn the light off at a set time.
  • STAIRCASE FUNCTION: Waits after the light has been turned on and then turns it back off after the set duration.

Credits:

Special thanks to the following users for their help:


Most recent version:

2.6:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
:link: Source code (Github)
:gear: See code changes (Github)


:memo:Changelog:

23/01/2024 - Version 2.6

  • General spelling corrections
  • Amended syntax to new guidelines (HA 2024.8 & 2024.10 changes)
Open to see older changes.

23/01/2024 - Version 2.5

  • Corrected logic in the turn off functions where the triggers where activated regardless of the required conditions in some cases.

21/10/2024 - Version 2.4

  • BREAKING: removed the ‘turn of at time’ configuration. This option was redundant as it can also be set through the ‘turn off with trigger’ configuration.
  • Re-activated the option to use the staircase function and the turn off triggers simultaneously.
  • Fixed the turn off conditions (yes, again…)
  • General lay-out corrections to improve user friendliness and legibility.

21/01/2024 - Version 2.3

  • Fixed the turn off conditions. They are no longer ignored.
  • Only 1 turn off option is possible while I’m working to fix interoperability of multiple options.

10/01/2024 - Version 2.2

  • Added support for switch entities (Only DEFAULT & TOGGLE modes are supported due to the nature of this entity type)
  • Added a new TOGGLE mode, allowing users to toggle light and switch entities with a simple setup instead of using the turn off triggers.
  • Adjusted and corrected descriptions to make the blueprint more user-friendly
  • Correcting some spelling errors

09/01/2024 - Version 2.1

  • Corrected a bug where the automation would not run unless an optional light sensor was selected.
  • Removed the ‘don’t turn the lights off’ option since it was redundant and could cause an error.
  • Changed the order of the turn off selectors to make them more user-friendly (Thanks @freddeh for the feedback).
  • Modified selector descriptors to make the automation more user friendly.
  • Modified the automation description for better legibility.
  • Moved some default values around for better consistence in the code base.
  • Slight modifications to templates for consistency and legibility.

02/01/2024 - Version 2.0:

  • Added a way to turn off the light in 3 ways:
    - at a set time
    - with 1 or more triggers
    - with a staircase function (turn off the light after a set time has passed)
  • Changed the operating mode to allow the turn off functions to work correctly
  • Modified descriptions and layout for better usability
  • General code corrections

31/12/2023 - Version 1.3:

  • Change the mode to restart (BREAKING, reload the blueprint!)

31/12/2023 - Version 1.2:

  • Added switch entity types to the target light selector
  • Corrected code with regards to color temperature setting

30/12/2023 - Version 1.1:

  • Bugfix in the dynamic lighting algorithm
  • General editing and text modifications to make it more user friendly

29/12/2023 - Version 1.0:

  • Original release
4 Likes

NEW RELEASE:

30/12/2023 - Version 1.1:

  • Bugfix in the dynamic lighting algorithm
  • General editing and text modifications to make it more user friendly

Just tried it, all looks good, but the blueprint is not able to find any of my devices, with the exception of two of them (?). Other similar light blueprints can see all of them.

NEW RELEASE:

31/12/2023 - Version 1.2:

  • Added switch entity types to the target light selector
  • Corrected code with regards to color temperature setting

I guess you’re referring to the light target selection field .
I’ve added the possibility to select switch entity types in addition to the light entity types now. Could you test again?

Hey guys, new here.

How do I properly paste my code in here to check it?

I can’t seem to get it to work. And it seems so easy haha.

Either post a screenshot or
Configure your automation, then on the top right, click the 3 dots and select ‘edit in Yaml’. Then paste that code here. (please select the ‘preformatted text’ option in the reply menu (it’s under the cog icon).

1 Like

There we go!

I also get this error message:

This error appears when I use the IKEA sensors. Had no problem with them the last two days. When I use the Hue sensor I don’t get this message, but no lights turn on either.

EDIT: Also tried this automation with my Google Nest Doorbell, no action either.

Thanks in advance!

alias: The Everything Light
description: ""
use_blueprint:
  path: Twanne/the_everything_light.yaml
  input:
    triggers:
      - type: motion
        platform: device
        device_id: bf96442afafe1514f1443dbe229cbdb9
        entity_id: d3a338af346d76692628d18981f0219a
        domain: binary_sensor
        for:
          hours: 0
          minutes: 0
          seconds: 0
    run_conditions: []
    target_light:
      entity_id: light.boekenkast
    transition_time: 1

The problem is that you’re using the device as a trigger.

Try using a state trigger:

platform: state
entity_id:
  - d3a338af346d76692628d18981f0219a
to: "on"

It would like like this in the visual editor:

Oh, and I would strongly advise you to change your entity ID’s to something more legible like: binary_sensor.mijn_bewegingssensor.
This will greatly help you with your automations in the future.

Thank for the fast reply!

This is what’s in the YAML right now, but it doesn’t seem to work. Sensor and lights are connected and working.

alias: The Everything Light
description: ""
use_blueprint:
  path: Twanne/the_everything_light.yaml
  input:
    triggers:
      - platform: state
        entity_id:
          - binary_sensor.sensor_toilet_motion
        to: "on"
    run_conditions: []
    target_light:
      entity_id: light.woonkamer_spots
    transition_time: 0

What does the visual configurator look like?

Like this:

Tried several sensors. Nothing works.

NEW RELEASE:

31/12/2023 - Version 1.3:

  • Change the mode to ‘restart’ (BREAKING, reload the blueprint!)

NEW RELEASE:

02/01/2024 - Version 2.0:

  • Added a way to turn off the light in 3 ways:
    - at a set time
    - with 1 or more triggers
    - with a staircase function (turn off the light after a set time has passed)
  • Changed the operating mode to allow the turn off functions to work correctly
  • Modified descriptions and layout for better usability
  • General code corrections

Hi there,

Firstly - thanks for pulling this together, it was really straight forward to follow the instructions (I think!)

I’m having an issue though, I can see the triggers I set being triggered when I flip my switch (it says triggered in the trigger setup window), however the devices I’m wanting to control aren’t reacting?! They’re all hue/zigbee lights.

When I look at the automation it say’s it has never been triggered.

The trace timeline says

Stopped because of unknown reason "null" at January 3, 2024 at 8:52:37 AM (runtime: 0.00 seconds)

Not sure what other information I can provide that would be helpful, but yeah - nothing happening for me!

Hi,

Thanks for the compliments, it means a lot.

Could you go through the step details in the traces and see what it says there?

Hey!

I just found out what the problem was. The IKEA sensor doesn’t allow you to add a ‘no motion seen’ timer.

So I just put that delay on 0 and it’s working!

Thanks for your time and effort in helping this rookie.

Have a good one!

1 Like

I had a similar issue during testing: I had changed my light sensor entity name so it wasn’t correctly setup.
Can you double check that alle entity names in your automation configuration are correct?

Hey Anton, I ended up getting what I needed working with another blueprint.

When I get a sec I’ll try yours again (it’s more flexible), however from memory, all the entity names were correct (selected from dropdown)

1 Like

As a newbie to this blueprint it is a bit confusing to have first Tiggers and then Conditions in the top section and in DYNAMIC mode you have first Turn Off Conditions and then down below Turn Off Triggers… took me a few minutes to figure that out. Might be a minor improvement to just switch the order around in the bottom.

Edit: looks like the Turn Off Conditions are not checked at all in DYNAMIC mode when the trigger is reached, is that true?