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

Hi @tw02d008

Firstly welcome to the community :+1:

:heart:

Noted… thanks for your feedback.

You can use the “Trigger Sensor By-pass” for this and you will have full control. See our FAQ on “How to use the “Trigger Sensor By-pass” without having a physical switch?” if you like.

Hope this helps

Blacky :grinning:

alias: SensorFlurOG
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.sensorflurog_occupancy
    light_switch:
      entity_id: light.flurog
    include_light_control: use_brightness
    night_light_brightness: 25
    include_night_light_control: use_night_brightness
    night_lights_after_time: "22:00:00"
    night_lights_before_time: "08:00:00"
    ambient_light_sensor: sensor.sensorflurog_illuminance_lux
    ambient_light_value: 26
    night_time_delay: 3
    light_brightness: 35

Thank you

@lucascoco

Thanks for the info. Your missing 2 selections. You have to enable the night light option and select the lights you would like to control.

1 Like

Ohh so sorry it was in front of my eyes.

so, last sentence…it’s GREAT your blueprint and Nothing to add!

THANK you!!!

cheers

1 Like

Hi, love your blueprint.

With Version 2.8 and night lights, lights will switch on, BUT NOT turn OFF after specified time.

alias: Stiegenhaus | Bewegung erkannt Lichter X min. ein
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.stiegenhaus_bewegungssensor_sonoff_ewelink_ms01_iaszone
    light_switch:
      entity_id: light.stiegenhaus_licht_innr_rb_266_light
    time_delay: 1
    include_bypass: bypass_disabled
    include_sun: sun_enabled
    include_ambient: ambient_disabled
    include_time: time_disabled
    include_night_light_control: use_night_brightness
    night_lights_after_time: "18:00:00"
    night_lights_before_time: "06:00:00"
    include_light_control: use_brightness
    light_brightness: 10
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.stiegenhaus_licht_innr_rb_266_light
    night_time_delay: 1
    night_light_brightness: 6

What am I doing wrong?

Thanks for your help.
Greetings
Christian

@Fuchschr11

Your YAML looks good. Could you try setting your night light brightness to “10”. Just thinking it could be your light and if it works at “10” in normal time it should work in night light time.

Thanks, did change it and will observe tonight.

alias: Stiegenhaus | Bewegung erkannt Lichter X min. ein
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.stiegenhaus_bewegungssensor_sonoff_ewelink_ms01_iaszone
    light_switch:
      entity_id: light.stiegenhaus_licht_innr_rb_266_light
    time_delay: 1
    include_bypass: bypass_disabled
    include_sun: sun_enabled
    include_ambient: ambient_disabled
    include_time: time_disabled
    include_night_light_control: use_night_brightness
    night_lights_after_time: "18:00:00"
    night_lights_before_time: "06:00:00"
    include_light_control: use_brightness
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.stiegenhaus_licht_innr_rb_266_light
    night_time_delay: 1
    light_brightness: 50
    night_light_brightness: 10

Greetings
Christian

Works now, thank you :slight_smile:

1 Like

Hello!
Thanks for the Blueprints - I’m new to Home Assistant and have several Hue motion sensors and configured them with the Hue app so far and have now switched everything to Home Assistant and with the Blueprints it works really well. The only thing I’m missing or maybe haven’t found is the ability to adjust the motion sensitivity of the motion detector - I have two motion detectors that are only supposed to trigger at very short distances… can you still integrate this?

Kind Regards!
Michael

I have tried adding the condition to my blueprint but I am not having any luck.

This is the blueprint I am using:


blueprint:
  name: Motion-activated Light via Switch
  description: Turn on a light when motion is detected.
  domain: automation
  source_url: https://github.com/home-assistant/core/blob/1d9e8c873fb31d27f392a8a3eda5f72886220256/homeassistant/components/automation/blueprints/motion_light.yaml
  input:
    motion_entity:
      name: Motion Sensor
      selector:
        entity:
          domain: binary_sensor
          device_class: motion
    light_target:
      name: switch
      selector:
        target:
          entity:
            domain: switch
    no_motion_wait:
      name: Wait time
      description: Time to leave the light on after last motion is detected.
      default: 120
      selector:
        number:
          min: 0
          max: 3600
          unit_of_measurement: seconds

# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent

trigger:
  platform: state
  entity_id: !input motion_entity
  from: "off"
  to: "on"

action:
  - alias: "Turn on the light"
    service: switch.turn_on
    target: !input light_target
  - alias: "Wait until there is no motion from device"
    wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - alias: "Wait the number of seconds that has been set"
    delay: !input no_motion_wait
  - alias: "Turn off the light"
    service: switch.turn_off
    target: !input light_target

I have tried to input a condition for time into this but I am not getting it to only trigger the lights between certain times of the day when the lights in the room are not needed. All I want to do is set a start and end time for the automation to work so it only works between certain hours of the day. I know it is simple, but I am not having any luck getting it done. Can someone help?

Hi @MikeDeltaHH

Sorry this blueprint will not adjust the sensitivity of your motion detectors. Some motion detectors have adjustments physically on them and some have software to do this. I would start there.

Hope this helps

Blacky :smiley:

@aparker21

Hi Aaron, please stay on topic and not post something about your blueprint (HA Blueprint) on this blueprints thread.

Consider moving it to a new topic of your own or asking a question about this blueprint.

If you use my blueprint you can achieve what you would like to do. Use the “Import Blueprint” blue button at the top to get the blueprint.

Once you import the blueprint go into the blueprint and enter your motion sensor into the “Trigger Sensor - Binary Sensors” then your lights into the “Lights - Switches - Scenes”. Now In “Use The Time Options (Optional)” select “Enable the time options” then select the start time, end time and weekdays and then click save, enter in a name you like and your done.

You can then use the blueprint again to create another automation being the same or you may choose different options next time. So it can be a blueprint that you use for many different automations.

Ok, thanks for info, will try and keep your very good work! :slight_smile:

1 Like

Having an issue with my ambient light sensors. I just updated to 2.8 and now I can’t pick my Zooz ZSE40 Z-Wave sensors anymore. The sensor shows Illuminance, but when I click the ambient light sensor dropdown, it says “No Matching Entities Found”. I used to be able to select it in previous versions, but it just seems to be missing now.

Hi @MikeMSD

If you try and create a new automation can you select it?

If not I will have a look at it for you. Could you provide us your YAML of your automation.

Go into your automation and 3 dots at the top click on it and select “Edit in YAML”. Copy the code. When you post it into this forum use the “</>” and paste it in there.

Hi

I’ve set up my desk lamp with the new Everything Presence sensor using the blueprint. The light turns on fine, but doesn’t then turn off.

YAML


alias: Desk Lamp
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.occupancy
    light_switch:
      device_id: 9b6bbfc3a533696123fa99510869108d
    time_delay: 2.5
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.illuminance
    ambient_light_options: ambient_light_option_enabled
    ambient_light_value: 30
    after_time: "08:00:00"
    before_time: "21:00:00"
    include_time: time_enabled

Thanks

Ellis

Maybe I found a bug :slight_smile:

I created an automation to switch on all lights in an area. After that I asigned the automation to this area. So I see all configuration about this area with one view.

image

When the automation starts, it switch the lights on, wait until the timeout und switch everything off in this area, including the automation itself.

Is there a way to use areas, asisgn automation to areas but exclude automations from turning off?

// EDIT \

Maybe the automation should only turn off the lights (no switches or else)?

@ellisorgan

Hi Ellis, thanks for your question and providing your yaml. You are using a device and the option “YES - My Ambient Light Sensor is affected by the Lights”. You will need to expand your device by clicking on the “<>” next to the name and use entities rather than a device. When using the option “YES - My Ambient Light Sensor is affected by the Lights” you will need to have at least one entity selected for this option to work.

Hi @motom001

firstly welcome to the community :+1: and your question.

This is not a bug as if you asigned the automation to a area and you turn it off then it will turn off everything.

This is why in the top notes we say “BE CAREFUL when selecting an Area or a Device as it will turn On and OFF everything attached, lights, switches, etc.”

You would be best not to assign the automation to an area if you are using this option otherwise you will need to expand the area and use devices or entities.

Hope this helps

Blacky :smiley: :smiley:

Thank you :kissing:

I’am new to the topic home assistant and searched for an automation. So I found your blueprint “Sensor Light - …”
What I was expected: Control the lights
What I get: Control every device, including automation and so on
For me personally, it is a mismatching between expectations and reality.

For example: I use switches with measurement for our fridge and so on. It’s not the best way to disable this device after leaving the room :slight_smile:

But I don’t want to criticize you, I want to improve. So here are different ways, which I couldn’t assess enough. Maybe you could help?

  1. turn off only lights (and maybe switches)
    1.1. use “light.turn_off”
    1.2. use additional / optional “switch.turn_off”
    Mayby with an selector at the beginning, which devices (-domains) should be disabled at the end?
  2. use only entities with domain light
    2.1. with filter at the beginning
    You use the domain filter at the target selector. Why you add also switch to it?
      selector:
        target:
          entity:
            domain:
              - light
              - switch
              - scene

When you use “only” switch and lights at the beginning, why you turn off everything and not only lights?
I think, if somebody want to use a switch as a light, he could also use the “switch as x” helper, can’t he?

2.2. with filter for variable “light_switch”
I tried with the template engine (developer tools) and get an example:

{% set input_name = 'light.og_flur_licht' %}
{{
  (
    (
      expand(input_name) +
      expand(area_entities(input_name))
    ) 
    + expand(states(input_name))
  )
  | selectattr('domain', 'eq', 'light')
  | map(attribute='entity_id')
  | unique
  | list
}}

Is it possible to integrate this into a blueprint?