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

@AndyMUK

If you would like to disable the automation and turn the lights OFF then you would use the bypass option 2. A toggle helper will do this for you. You then ask Siri to turn your “Kitchen Lights Bypass” ON (example only) or you can add the bypass to the UI. There is a auto OFF in the bypass but if you would like it to turn OFF if it is ON at 11am the next day then a simple automation can do this for you.

Blacky :smiley:

Thank you @Blacky, turns out this is a more profound issue as sometimes the whole Zigbee communication fails which is also a reason why the lights never turn off.

I configured two extra automations and so far they seem to do the job:

alias: >-
  Execute automation when lights are on but the sensor hasn't seen anyone for a while
description: ""
triggers:
  - trigger: time_pattern
    minutes: /2
conditions:
  - condition: state
    entity_id: light.bedroom_lights
    state: "on"
  - condition: template
    value_template: >-
      {{ as_timestamp(now()) -
      as_timestamp(state_attr('automation.automatic_bedroom_lights',
      'last_triggered')) > 400 }}
actions:
  - action: automation.trigger
    metadata: {}
    data:
      skip_condition: true
    target:
      entity_id: automation.automatic_bedroom_lights
mode: single
alias: Execute automation when the lights are turned on using manual switch
description: ""
triggers:
  - trigger: state
    entity_id:
      - light.bedroom_lights
    from: unavailable
    to: "on"
conditions: []
actions:
  - action: automation.trigger
    metadata: {}
    data:
      skip_condition: true
    target:
      entity_id: automation.automatic_bedroom_lights
mode: single

1 Like

This is a very impressive blueprint! Thank you @Blacky for all of your hard work and dedication to making it incredible. I’m extremely new to HA but not to home automation in general. I am trying to figure out if what I want to accomplish with some under cabinet kitchen lights can be done with your blueprint.
I have some zigbee cob light strips in my kitchen and I want to have them come on at dusk daily at 10% brightness at 8000k color temperature. That’s obviously the easy part. I would then like a motion sensor (wireless zigbee) trigger to brighten those lights to 80% at 5000k for 5 minutes and then go back to the original setting (10% at 8000k) afterwards.
The reason for the different color temperatures is because these lights change color when dim vs when bright. I’m trying to use color temp setting to keep the color consistent whether dimmed or bright.
I’ve experimented with different combinations in the blueprint and unfortunately not achieving my goal. Not even close. I appreciate any assistance you can provide!

I’m using a Ring Video Doorbell’s binary sensor as the trigger. It’s been working but I’ve seen a warning saying that the binary sensor is deprecated and I should move to using an event instead. How might I go about changing the trigger to an event? The blueprint/automation doesn’t show event entities as an option in Trigger entity dropdown, and changing the YAML to an event entity doesn’t trigger either.

@JP505050

Welcome to the community.

This is easy.

  1. Set up your lights in Lights - Switches - Scenes - Scripts, Night Lights & Night Glow - Lights. Don’t worry we will only be using night lights for this.
  2. Then set ups your brightness and colour temp.
    • Lights - Switches - Scenes - Scripts = Just add the lights in this will do nothing anyway but you need them entered.
    • Night Lights = Set the lights to 80% @ 5000k, Night Lights - Time Delay = 5 min
    • Glow - Lights = Set to 10% @ 8000k
  3. Set up sun elevation to your liking in Sun Elevation and in Night Lights Conditions… the night lights sun elevation settings to be the same settings you have in Sun Elevation. This will force it to only use night lights.
  4. Set up your motion sensor as the trigger.
  5. Save and your done.

Enjoy

Blacky :smiley:

@Garrick

Have a look here and have a look in developer tools to see what entity’s you have for your ring doorbell. You then may need to create a trigger binary sensor that turns ON / OFF for the event or they say there is a motion sensor but you will need to look in developer tools to see what you have.

If you like to provide a screen shot of your ring entities in developer tools I can take a look at them.

Blacky :smiley:

1 Like

Thanks. How would I then link that bypass to the light switch? It seems the bypass option will only work if it’s a separate switch.

The input boolean is my bypass and then I have the bypass set up like so…

This causes the lights to turn off, on and then back off again. I’d like pressing the toggle button on the light switch to turn the lights off and leave them off until the following day.

Edit: It looks like rather than toggle off I can use keep the current state for the boolean input instead. The issue then would be if I want turning the lights back on to disable the bypass then it won’t. The only way I’ll be able to disable the bypass is through a separate automation triggered by the built in timer or a separate timer for next day.

@AndyMUK

The bypass has to be a different entity to the light. You have 3 bypass option depending on what you would like to happen when you turn the bypass ON. You have an auto OFF timer for the bypass. Say your bypass is called “Living Room Lights Bypass”. You would say “Hey Siri, turn ON the Living Room Lights Bypass” This will disable the automation until the bypass is turned OFF. You could also add the"Living Room Lights Bypass" helper to the UI and if you would like a physical switch you will need an independent switch for the bypass. I do have a blueprint that you can use the same light switch to turn ON the bypass but it only works one way, turn switch ON manually turns ON bypass. If you would like to test it let me know and I will provide the link.

Blacky :smiley:

Hey @Blacky,
any news on something like “pre-off” scenes?

Is there any way to avoid this from triggering when HA restarts? I’m using a sundown trigger, but this always triggers when HA does a restart.

I would assume it’s due to how you check if the sun is below horizon. Might be helpful to share more details :slight_smile:

@ChrisThomas

I looked into it but it really is controlled within the light. You could try a script to turn your lights OFF but you will need to use a scene when you turn them ON (not an entity). In your script to turn OFF you could try to run your pre-off and then turn your lights OFF. If you test this out let us know how you go.

Blacky :smiley:

1 Like

@devrsw

When HA restart it will evaluate what you have asked and turn lights ON or OFF.

Maybe you can provide your YAML of the automation and let me know what is happening when HA restarts.

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:

My outside lights is triggered by motion and should only turn on when it’s dark.
I have a boolean helper to tell me if it’s dark outside. true/false

I can’t seem to find a way to implement this, as the Ambient option relies on a LUX number, and not on a true/false value. (I could “hack” this with a helper to represent a LUX value based on true/false, but seems a bit much?)
The Night Lights Settings have a “Entity State”

My only other option is sun elevation, but I prefer my out LUX on/off value.

Is there a way to do this?

@xtfrost

The best way is to create a template sensor and use this as your lux sensor.

Create a template sensor that has if boolean helper ON (or dark) = 5 else = 20. Then just use this in the lux sensor and set the high and low lux values to 10.

To create a Template sensor, follow these steps:

  1. Navigate to Settings > Device & Services > Helpers tab at the top.
  2. Click the Create helper button.
  3. Select Template and then choose Template a sensor.

Next, provide a Name, Unit of measurement = lx, Device class = Illuminance and State class of your choice. If applicable, you can link this template to an existing device so it appears under that device’s details.

In the State template field, add the code below, replacing input_boolean.boolean_helper_here with your entity ID.

{% if is_state('input_boolean.boolean_helper_here', 'on') %}
  5
{% else %}
  20
{% endif %}

Blacky :smiley:

1 Like

First off this is reality good and a lot clearer than my own automation.

I’ve been struggling with the off delay , is there a setting for this ?

@t21drl

Welcome to the community and thanks for your kind words.

Yes look under Lights called Time Delay

If you are using night lights then the Night Lights - Time Delay is under Night Lights

Blacky :smiley:

1 Like

Is it normal if I adjust the brightness manually, that the blueprint switch back to setup brightness after motion trigger?

Thank you, as always, for your quick and detailed answers and for being so helpful.
I’ve made a small donation as a token of my appreciation.

Merry Christmas :santa:

I am new to home assistant so i might miss something but my setup has a lot of knx motion sensors and those fire telegrams that should be used as trigger. At least if i read the knx documentation: KNX - Home Assistant

Do I have to create a helper for every motion sensor (and how would that work?) or is there a way to just use a telegram trigger as I can do it in automations without this blueprint, like here:

  - domain: knx
    device_id: e694c98bb00ba1355f72fd7972c4b3cf
    type: telegram
    trigger: device
    group_value_write: true
    group_value_response: false
    group_value_read: false
    incoming: true
    outgoing: false
    destination:
    - 6/2/5