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

I’ve got this blueprint in use in a few places across the house, and it works wonderfully. However I got a new motion sensor (IKEA Vallhorn) on ZHA which works, but when it comes to setting it up the Automation never gets triggered. I’ve tried setting it up multiple times and gone as simple as below, but it never happens. Any ideas at all why?

alias: "Landing "
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.landing_motion
    light_switch:
      device_id: 6cf031215afdb1d7d17bfe8bd234e66a

@Pate78

Hi Patrick, you can’t use a button. The entity must have an ON / OFF state like a toggle helper.

Blacky :grinning:

@Generationgav

Your using a device and you can only use entities. See this FAQ, click here

Blacky :grinning:

1 Like

Thanks so much - was looking at the motion sensor bit, completely missing the lights…
Love your work on this by the way.

1 Like

Will give it a go as soon as possible, to be fair your previous automation also works fine for my usecase

@danielo515

I have a saying “If it is not broken then don’t touch it”

Blacky :grinning:

Hi,

I’ve been using our sensor-light blueprint (great work!!) for quite some time, but had another blueprint for circadian (dynamic) lighting. I’m now trying to eliminate this separate dynamic lighting option as it is also available in yours.
I installed the latest version 8.3 and created an automation from scratch.
I opted for a time controlled option, as it is easier to test.
The main trigger (kantoor_occupied) is a helper that is normally triggered by a couple of motion sensors and other triggers. It is robust in the sense that is stays on for as long as I am in the room.
When the I trigger the automation (via kantoor_occupied) all seems to work well and both brightness and colourtemp are adjusted. But then it the automation is not triggered again and the dynamic lighting does not work.

Here is my yaml:

alias: Kantoor auto light
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - input_boolean.kantoor_occupied
    light_switch:
      entity_id: light.kantoorverlichting
    include_light_control: []
    light_brightness: 100
    motion_bypass_lights_on: []
    motion_bypass_lights_off: []
    motion_bypass_lights_stop:
      - input_boolean.kantoor_automation_blocked
      - input_boolean.alle_automations_blocked
      - input_boolean.beneden_automations_blocked
      - input_boolean.manual_control_verlichting
    bypass_time_delay: 5
    include_bypass_auto_off: []
    bypass_auto_off_delay: 1
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.tuin_outdoor_motion_sensor_illuminance
    ambient_light_value: 10
    night_lights_conditions:
      - entity_state_enabled
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.kantoorverlichting
    include_night_light_control:
      - use_brightness
      - use_colour_temperature
      - use_transition
    night_light_colour_temperature: 2000
    night_lights_after_time: "01:00:00"
    night_lights_before_time: "06:00:00"
    time_delay: 1
    night_light_brightness: 2
    before_time: "00:00:00"
    include_bypass:
      - bypass_enabled_stop
    night_lights_entity_state:
      - input_boolean.nachtverlichting
    include_dynamic_lighting: enable_time_controled_colour_brightness
    dynamic_lighting_min_brightness: 15
    dynamic_lighting_max_colour_temp: 6500
    dynamic_lighting_min_colour_temp: 2300
    dynamic_lighting_sun_elevation_end_rising: 10
    dynamic_lighting_heartbeat: 1
    dynamic_lighting_max_lux: 400
    dynamic_lighting_max_brightness: 100
    dynamic_lighting_state_control: disable_state_control
    dynamic_lighting_state_control_activation_state: "off"
    include_night_light_colour_control: use_colour_temperature
    night_lights_sun_elevation: -10
    night_lights_sun_elevation_rising: -8
    dynamic_lighting_min_lux: 0
    dynamic_lighting_time_end_evening: "23:00:00"
    dynamic_lighting_time_start_evening: "16:00:00"
    ambient_light_high_value: 80
    include_state_control: state_control_disabled
    state_control_activation_state: "off"
    include_light_colour_control: use_colour_temperature
    light_transition_on: 2
    light_transition_off: 2
    dynamic_lighting_boolean: input_boolean.kantoor_dynamic_lighting
    dynamic_lighting_step_value: 4
    dynamic_lighting_time_start_morning: "07:00:00"
    dynamic_lighting_time_end_morning: "08:30:00"

Can you spot where I go wrong?

Regards

@Pkurst

Welcome to the community.

All your YAML looks good. The key is understanding how this automation behaves:

  • Ambient condition – The automation only runs when this condition is true. If it’s false, nothing happens.
  • Bypass options – If any of your four bypass entities are ON, the automation will not run.
  • Night light option – When this entity is ON, night lights take over. If your lights are already ON and you want them to adjust to the night light settings, you’ll need to enable “If lights are ON, adjust the lights when crossing over” in Night Light control. Dynamic lighting does not run while night lights are active.
  • Dynamic lighting – Your settings look good. Lights will only adjust between 7:00–8:30 AM and 4:00–11:00 PM, provided Ambient is true, bypasses are OFF, and night lights are OFF. Outside of these time windows, the automation simply waits for the next range.

Hope this helps you. If your still not sure just reach out again.

Blacky :grinning:

Hello there!
Just installed your blueprint and basic functionality works like a charm, thank you.

I want to utilize dinamic lighting feature, but I have a bit strange setup.
So I have a smart switch and smart bulb. Due to various reasons I need to switch off the lights via switch and can’t keep bulb under voltage for all time.
If I add both entities (switch and bulb) to the blueprint and enable dynamic light (variant 6 if it matters), automation stops working. Without dinamic lights automation works and light is turned on and off based on presence sensor.

I read in a FAQ that dinamic light is not supported for switches, only for bulbs themselves, but wanted to ask if it is possible just ignore (one of) unsupported entity and adjust light settings on the second entity which is supported?

I can collect some logs if needed.

Thanks in advance!

alias: Управление светом - Туалет
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.datchik_prisutstviia_tualet_presence
    light_switch:
      entity_id:
        - light.vykliuchatel_tualet
        - light.lampa_tualet
    time_delay: 0
    include_dynamic_lighting: disable_dynamic_lighting
    dynamic_lighting_boolean: input_boolean.input_automation_dynamic_lighting_toggle

@nixel2007

You can have lights and switches and still use dynamic lighting. The problem you may have is that your Dynamic Lighting - Min Brightness Value is set to “0”. A brightness value of “0” will turn your light OFF. Try setting it to 10% for testing and then you can set it back to 0% if you like.

Try this YAML, copy and paste it in.

alias: Управление светом - Туалет
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.datchik_prisutstviia_tualet_presence
    light_switch:
      entity_id:
        - light.vykliuchatel_tualet
        - light.lampa_tualet
    time_delay: 0
    include_dynamic_lighting: enable_sun_elevation_colour_brightness
    dynamic_lighting_boolean: input_boolean.input_automation_dynamic_lighting_toggle
    dynamic_lighting_min_brightness: 10

Blacky :grinning:

1 Like

Have been using this blueprint since i started my journey in the beginning of the year and its amazing so thank you!

One issue I haven’t been able to resolve is that the light turns off after 10 min of doing dishes under the motion sensor. I expect the lights to turn off 10 min off no motion, not 10 min after being triggering by motion.
I have to walk away and wait for the sensor to Clear then come back. What am I missing?

@Hugobosss

Welcome to the community and thanks for your kind words.

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 :grinning:

ah ok thanks for reply. will look into toggle helper.

1 Like

Thanks for looking into it!

alias: Sensor Light - Kitchen Counter Sink
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.motion_sensor_sink_kitchen_occupancy
      - binary_sensor.motion_sensor_counter_kitchen_occupancy
    light_switch:
      entity_id: light.kitchen_counter_led_driver_light
    include_bypass:
      - bypass_enabled_turn_off
    motion_bypass_lights_off:
      - input_boolean.night
    include_ambient: ambient_disabled
    include_light_control:
      - use_brightness

@Hugobosss

Thanks for your YAML.

What you need to do is group both your motion sensors and then just use the group as the trigger (not the motion sensors just the group). This is the FAQ on how to do this click here. Once this is done it will work perfectly.

Blacky :grinning:

Hi,

Thanks so much! Will pile up on dishes and test it :slight_smile:

1 Like

Hi Blacky !
Many thanks for your so useful blueprint !
I just have one question about the behaviour with the bypass :

  • When your motion sensor detects someone, it turns on the lights.
  • Then I unintentionally push my bypass button (it bypasses the automation and lights are still ON).
  • Then if I push my button again : And nothing happens : Lights are still ON because of a delay of the automation, I think.

Then another test :

  • Motion sensor turn the lights ON
  • I push the ByPass button
  • I wait for 10 or 20 seconds
  • I move in front of motion sensor
  • I push again the bypass button
  • Lights are still ON for the delay I configured in the automation.

So, it seems like the Bypass does not really put the automation on hold, but it forces the lights to turn ON (it I choose the corresponding option) with the motion still working in backgrounds.

Am I doing something wrong or is this the normal way it works ?
Do you think it could be possible to ADD something thats turns lights OFF when I turn OFF the bypass with the 1st Option ?

Thanks again for your work !
JCharles

@JCharles

Welcome to the community.

You can’t use a button as it has no state being ON or OFF. We need to know if the bypass is ON or is it OFF. Buttons don’t provide that information.

Try using a toggle helper and not a button. It should all work then.

You can use a button to toggle a toggle helper if you must use a button. If you are unsure how to do this or it can’t be done directly in the device than you can use my :nazar_amulet: Press Button - Turn ON & OFF Entities blueprint. Add your button to Press Button and then create a toggle helper and add it to Main Entity. Then use the toggle helper in the bypass.

How to create a toggle helper.

  1. Go to Settings > Devices & Services > Helpers (tab at top).
  2. Click “+ Create Helper” and choose Toggle.
  3. Set a Name for your new toggle helper.
  4. Set Icon if you like.
  5. Click Create.

Blacky :grinning:

Hi again!

It’s time to deal with a big issue I have been having since installing dimmer switches in the whole house. Here’s what I want:

Use Sensor Light Blueprint for each dimmer obviously. When interacting with the physical dimmer the light should stay at that state for 30 min. When using the physical dimmer I have an automation runs that enables the bypass keep current bool helper, after 30 min it turns off the helper. In order to differentiate what changed the light state, either physical dimmer, automation or UI I look at the Context ID, Parent ID and User ID. Physical interaction has only Context ID, when using automation it has also Parent ID.

Problem is that when using your blueprint, there is often times no Parent ID resulting in a false trigger and the bypass enables without physical interaction. I get a notification with the details whenever the light turns on and when the blueprint runs, it will update multiple times, from what I have seen, first time there is a Parent ID but then it will run again without Parent ID. Below you can see an example using a simple automation that turns light on when motion sensor is on, and your blueprint.

I hope you will be able to resolve this otherwise I have to use simple automations instead.

Sensor light:
Ceiling Light Elias Room – Fysisk knapp
State: on Context ID: 01K470MHCERA93V1PEQXHG6DC3 Parent ID: None User ID: None

Normal automation:
Ceiling Light Elias Room – Diagnostik
State: on Context ID: 01K470JX48G52D5PRH2D0SB10N Parent ID: 01K470JX463FS739ZHGWVBZTZ3 User ID: None

Hi @Blacky ,

I am using various of your automations for a while now (+ already donated :wink: ). Amongst others, I use this one here for my supply closet with a door/window sensor and a dimmable light bulb.

Unfortunately, sometimes me and my wife forget to close the door of the supply closet, which means the light stays on for a couple of hours.

Could you tell me, what is the smartest way to turn the light off after a specified time? Something like the maximum run time in the Bathroom Humidity Exhaust Fan blueprint.

Thanks!
Arne