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

The blueprint only accepts sensors that belong to the device_class ‘illuminance’ .
You can check if your sensors matches this by going to: Developer tools > States
Once there: type the name of your sensor in the search field and see what comes up.
It should look something like this:

If it doesn’t: feel free to upload a screenshot of your sensor’s states. There may be some options to add to the blueprint.

NEW RELEASE

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.

This has been fixed in version 2.4.

Hey AntonH, thanks for your response. Its an Homematic Motion Detector and there is no devie class. only parameter: brightness

A device class ist only @ the motion Section:

I am getting the error:

Message malformed: Unexpected value for condition: ‘[{‘condition’: ‘time’, ‘alias’: ‘Run only at these times ( - Remove me if not needed - )’}]’. Expected and, device, not, numeric_state, or, state, sun, template, time, trigger, zone @ data[‘condition’][0]

Am I supposed to remove that in the blueprint, that is, edit the YAML code of the blueprint? I am using to have a motion sensor trigger a light and then turn off after 5 minutes.

Here is my code:

description: ""
alias: EntryLight2
use_blueprint:
  path: Twanne/the_everything_light.yaml
  input:
    trigger:
    - type: turned_on
      platform: device
      device_id: 1fab1a313e20a49fddcf64f63e0f61fd
      entity_id: f52570a003ca9189922cb478f38db62f
      domain: binary_sensor
    mode: fixed
    brightness: 50
    include_turn_off:
      - staircase
    staircase_duration:
      hours: 0
      minutes: 5
      seconds: 0
      days: 0

While I am still interested in what I’m doing wrong with blueprints, I found an easier solution to what I wanted to accomplish:

alias: EntryMotionTurnsOnLight
description: ""
trigger:
  - type: turned_on
    platform: device
    device_id: 1fab1a313e20a49fddcf64f63e0f61fd
    entity_id: f52570a003ca9189922cb478f38db62f
    domain: binary_sensor
condition: []
action:
  - type: turn_on
    device_id: 78a3627b4ad0fdf31cde674190a60e4a
    entity_id: 8d932891a63118b7b01a2d672984916b
    domain: light
    brightness_pct: 50
  - delay:
      minutes: 5
  - type: turn_off
    device_id: 78a3627b4ad0fdf31cde674190a60e4a
    entity_id: 8d932891a63118b7b01a2d672984916b
    domain: light
    brightness_pct: 50
mode: single

In the UI configurator, click the 3 dots on the condition and select ‘remove’.
That should do it.

That did it. I was removing with YAML. Thank you!

1 Like

I think this is nearly perfect, certainly looks to be the easiest blueprint for this functionality… except one thing but that is probably my configuration

Basically what I am after is:

  • Turning on:
    – By occupancy/PIR (EP1)
    – Toggle of Physical switch (Shelly)

  • Turning off:
    – Timeout of occupancy/PIR
    – Toggle of Physical switch

At the moment all is working perfectly… except the toggling to turn off. I am assuming that the having the same states for the same device in both on and off are causing this.

If I only set “powered” for on, and “not powered” for off then there is a really odd feeling not knowing if the switch will work. For example if I walk in and the sensors turns the light on, but when I walk out I press the button… it will not turn the light off until I press it a second time.

Any ideas how I could achieve this?

1 Like

NEW RELEASE:

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.

A couple of things:

  1. There was an issue in the turn off logic where lights would be triggered to go off immediately after being triggered on. In practice, this meant that they actually never came on.
    You may have been affected by this issue, so I would suggest re-importing the blueprint by going to: Settings > Automations & scenes > Blueprints. Once there, click on the 3 dots and select ‘Re-import Blueprint’.
  2. I would suggest always using ‘state’ triggers instead of ‘device’ triggers.
    Device triggers never work great in my experience. So in your case, your trigger to turn on should be: State ‘Office PIR motion’ turned to ‘on/detected’. And state ‘Office occupancy’ turned to ‘off’ to turn the light off.

See below for an example configuration:

thanks for that I have updated it. But I think my question is still the same.

If I walk into the room and the light switch is set to off; and the sensor turns the light on for me it is all ok. The light will stay on until occupancy is no longer detected.
But when a guest goes to leave the room they often try to manually turn the light off due to habit.
But cause the current state of the switch is “Off”, it will change to “On” and hence the light also stays on…, So as a result they will often mash the button.

How do I get the light to turn off with a single press of the button?

I think you’re better off making a separate automation that changes the button’s state when the light goes on.

Hi
Thanks for a great blueprint.
Mine is working to the extent that when I restart the automation then it correctly adjusts the light brightness, However, it does not dynamically change as the lux sensor lux changes.
My bulbs are smart dimmable, and some color as well, but they are old and I am guessing that the supported feature is not there to dynamically chage the brightness of the bulb.
Am i correct in this assumption, or is there something I am missing? Once i turn off the light and re trigger the motion sensor I can see that the brightness has changed.
Thanks again for your blueprint, and assistance.

That’s correct behavior: the trigger in you case is the motion sensor and not the lux sensor. so only when the motion sensor gets triggered the automation goes through the calculation again and sets the light to the changed value.

If you want it to work with the lux sensor only, you could try my other blueprint: 💡 Smart lux dimmer - Adjust light brightness depending on light sensor value

Thank you for that information
Am trying your other Blueprints

1 Like

Hi @AntonH. I am a huge fan of your blueprint. I have one more suggested feature.
I use the blueprint to turn on the lights in a room, if there’s motion detected in the room. I use the staircase option to countdown x minutes.
In my use case, I would like the lights in the room to turn on when I enter the room as they do now, but then only to turn off if there han’t been any motion in the room for x minutes.
For this, I would like the staicase countdown to restart if any of the triggers fire off again during the staircase timeframe.
Hope this makes sense.

1 Like

Hi @AntonH

I just switched from one of your templates (controlling just the brightness) to this one, which helped me delete a few of my own automations (thanks for that :+1:). I have two question.

I have two motion sensors in my hall because it is build like an L. Therefore I have set two deactivation triggers (certain amount of time after one of the sensors does not detect movement anymore), which only work if none of the two detects movment, so that there are no unsure states. The deactivation trigger condition does somehow prevent the deactivation flow to be executed and I’m not sure how to correct that. Without the condition the deactivation flow is executed but if there is continuous movement just one of the two sensors is detecting, the deactivation is still triggered.

I only want the automation to work between 7:00 - 22:00 but the deactivation triggers shall still work outside the given time plan. This does not seem to work so I have to set up an additional deactivation automation.

1 Like

The Blueprint’s mode is set to ‘restart’, so what you’re describing should work by default. Each time it’s triggered the staircase timer resets.
Do take into account that motion sensors usually have a built-in cool down period during which they will not re-trigger.

This is normal. The mode of the blueprint is set to ‘restart’. This means that it will restart the automation when one of the sensors is triggered and reset the turn off triggers.

I don’t understand what you mean by this. Could you clarify a little more?

This is normal. The mode of the blueprint is set to ‘restart’. This means that it will restart the automation when one of the sensors is triggered and reset the turn off triggers.

That does not seem to work for me. If sensor 1 starts the deactivation flow (because a switch to no movement was recognised) and I move within the area only sensor 2 is detecting, the deactivation flow will still be executed (because sensor 1 is not detecting movement) and deactivate the light for the whole area.

Imagine there is movement at 21:59 (continuously until e.g. 22:03) the deactivation flow will not run anymore or this happened for me at least.