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

I recently upgraded to the newer version of the sensor light, and now my automation does not work anymore. I use my Unifi doorbell camera as my binary sensor for person detection, which then turns on our front porch switch and lights. The lights are then adjusted to 100% brightness and 5000K.

Since the upgrade, this automation no longer works. I have rebuilt it several times with no luck. Any help would be greatly appreciated.

Here is my automation setup. I do not have a copy of the old version.

id: '1699286846215'
alias: Front Entry Person Detection
description: Script triggered by a camera when a person approaches the front porch
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.20102_leithcrest_way_frnt_door_person_detected
    light_switch:
      entity_id:
        - light.wiz_rgbw_tunable_6bd442
        - light.wiz_rgbw_tunable_6bbae2
        - scene.front_porch_lights_on
    end_scenes:
      - scene.front_porch_off
    include_sun: sun_disabled
    time_delay: 7
    dynamic_lighting_max_lux: 900
    dynamic_lighting_min_lux: 0
    night_time_delay: 0
    after_time: '16:30:00'
    before_time: '08:00:00'
    light_transition_on: 0
    night_light_transition_on: 0
    include_light_control:
      - use_colour_temperature
      - use_brightness
    bypass_auto_off_delay: 1
    include_time: time_enabled

Here is the second automation I have created trying to perform the same task, using the same sensor and lights.

alias: Front Door Person Detection ver. 7
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.20102_leithcrest_way_frnt_door_person_detected
    light_switch:
      entity_id:
        - light.wiz_rgbw_tunable_6bd442
        - light.wiz_rgbw_tunable_6bbae2
        - scene.front_porch_lights_on
    end_scenes:
      - scene.front_porch_off
    time_delay: 7

@Blacky
Is there anyway for the “Bee In The Hive Sensor” to only keep the light on once the door is closed? AKA
Motion is detected, light turns on, timer starts
Door closes, timer stops till both door opens and motion is not detected
If that is possible anyways…

1 Like

@WilliamHill

Try this.

template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.your_door_sensor_here
        to: "off"
      - platform: state
        entity_id: binary_sensor.your_door_sensor_here
        to: "on"
        for:
          seconds: 10
      - platform: state
        entity_id: binary_sensor.your_motion_sensor_here
        to: "on"
    binary_sensor:
      - name: "Bee In The Hive"
        device_class: occupancy
        icon: mdi:account-box-outline
        state: >
          {{ is_state('binary_sensor.your_door_sensor_here', 'on') and is_state('binary_sensor.your_motion_sensor_here', 'on') }}

Blacky :smiley:

@cvbrundige

Below is your YAML to adjust the light to 100% brightness and 5000K. Look in Light Control I have selected the options there. Copy and paste it in… you may need to set your time condition up again.

alias: Front Door Person Detection ver. 7
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.20102_leithcrest_way_frnt_door_person_detected
    light_switch:
      entity_id:
        - light.wiz_rgbw_tunable_6bd442
        - light.wiz_rgbw_tunable_6bbae2
        - scene.front_porch_lights_on
    end_scenes:
      - scene.front_porch_off
    time_delay: 7
    include_light_control:
      - use_brightness
    include_light_colour_control: use_colour_temperature

When updating to V7.0 there was some work to do. Click Here for more details.

Blacky :smiley:

@Yaksha

Hi John,

Yes this is how it works.

When the door is closed if it detects motion in the room it will turn the Bee In The Hive sensor ON. It will stay ON until the door opens. Once you create it you then group it with your motion sensor, you then add that group to the trigger not the individual sensors.

The sensor is good because you can use it for whatever you like and it is not tied to a blueprint.

Please see link for more information on it.

Blacky :smiley:

1 Like

@Blacky
PERFECT!! Thank you!
I am just now figuring out all of the crazy stuff you can do with your blueprint… I am sure I will have more questions in the future. lol

1 Like

I really love the customizability of this blueprint, however every now and then the automation seems to get a hiccup, where the light turns on, and then immeaditely shuts off. I tried the FAQ, where it describes the issue im facing, but the only difference is, that I only have on singular motion detector at work here (not multiple triggers).
Is anyone facing the same issue of the light turning off suddenly?

@Hometoza

Welcome to the community.

I am not finding that here but it can be many things that could cause this.

  1. You may have another automation (forgot about) that is turning it OFF.
  2. Communications with your devices to HA.
  3. Maybe not set up correctly… if you like to provide your YAML of the automation then I can take a look at it.

Blacky :smiley:

I use something similar, but in my case when some light was turn it on manually the automation do not run, and the light stay On all the time untill I turn it off. In that case the motion sensor switch the front light again on and off

description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bewegungsmelder_occupancy
    include_light_control:
      - use_brightness
      - use_colour_temperature
      - use_transition
    light_transition_on: 0.5
    light_transition_off: 2
    light_brightness: 90
    light_colour_temperature: 2500
    light_switch:
      entity_id:
        - light.flurlicht_1
        - light.flurlicht_2
        - light.flurlicht_3
    time_delay: 2
    night_time_delay: 1.5
    include_night_light_control:
      - use_brightness
      - use_colour_temperature
      - if_lights_are_on_adjust_when_crossing_over
      - use_transition
    night_light_brightness: 5
    night_light_colour_temperature: 2500
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    include_bypass:
      - bypass_enabled_turn_on
      - bypass_enabled_turn_off
    motion_bypass_lights_on:
      - input_boolean.bypass_flurlicht
    night_lights_after_time: "23:00:00"
    night_lights_before_time: "07:20:00"
    night_lights:
      entity_id:
        - light.flurlicht_1
        - light.flurlicht_2
        - light.flurlicht_3
    include_bypass_auto_off:
      - bypass_auto_off_enabled_off
    motion_bypass_lights_off:
      - input_boolean.flurlichter_bypass_off
    bypass_auto_off_delay: 5

This is my blueprint. Not a lot of fancy stuff happening here IMO :open_mouth: thank you for the warm welcome and answer :slight_smile: Before i was using a mqtt group that grouped my 3 lights as one, but it behaved very similar

re. the WLED colour temp: can you tell me what your relevant settings are in both HA and WLED? I wonder if I’ve got one of those adrift somewhere: the WLEDs will do colour temperature beautifully in WLED natively but not in HA so it must be somehting I’m doing…

@Hometoza

When updating to V7.0 there was some work to do. Click Here for more details.

Below is your YAML

description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bewegungsmelder_occupancy
    include_light_control:
      - use_brightness
      - use_transition
    light_transition_on: 0.5
    light_transition_off: 2
    light_brightness: 90
    light_colour_temperature: 2500
    light_switch:
      entity_id:
        - light.flurlicht_1
        - light.flurlicht_2
        - light.flurlicht_3
    time_delay: 2
    night_time_delay: 1.5
    include_night_light_control:
      - use_brightness
      - if_lights_are_on_adjust_when_crossing_over
      - use_transition
    night_light_brightness: 5
    night_light_colour_temperature: 2500
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    include_bypass:
      - bypass_enabled_turn_on
      - bypass_enabled_turn_off
    motion_bypass_lights_on:
      - input_boolean.bypass_flurlicht
    night_lights_after_time: "23:00:00"
    night_lights_before_time: "07:20:00"
    night_lights:
      entity_id:
        - light.flurlicht_1
        - light.flurlicht_2
        - light.flurlicht_3
    include_bypass_auto_off:
      - bypass_auto_off_enabled_off
    motion_bypass_lights_off:
      - input_boolean.flurlichter_bypass_off
    bypass_auto_off_delay: 5
    include_light_colour_control: use_colour_temperature
    include_night_light_colour_control: use_colour_temperature

Blacky :smiley:

@iandogherty

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.

I am not the guru on WLED but I love it. I know on the WLED discord there are so many people to help and very willing, they also use HA… hats of to them. Maybe ask on that forum but I use it here and it works perfectly never missing a beat. Below are one segment of the LED I use if that helps any.

144

Blacky :smiley:

@Blacky I have a weird problem with one of the copies of this automation. It will “randomly” disable itself and thus will no longer function. I can manually “enable” the automation, but it will then go back to a disabled state. I tried re-creating the automation from the template, but it’s still happening. I probably have about two dozen copies of this blueprint running without issue…it’s just this one that appears to entirely disable itself. Any ideas what’s going on?

legend, thanks. will this do for the yaml:

alias: Sensor Light
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.everything_presence_lite_5c0774_occupancy
      - binary_sensor.dairy_maid_s_door_on_hubitat_ring_contact_2
    light_switch:
      entity_id: light.temp_office_wleds
    include_light_control:
      - use_brightness
    light_brightness: 50
    include_light_colour_control: use_colour_temperature
    include_dynamic_lighting: enable_sun_elevation_colour_lux_brightness
    dynamic_lighting_lux_sensor: sensor.office_lux_group
    dynamic_lighting_max_lux: 900
    dynamic_lighting_max_brightness: 80
    dynamic_lighting_max_colour_temp: 7000
    dynamic_lighting_min_colour_temp: 3500
    include_bypass:
      - bypass_enabled_stop
    motion_bypass_lights_stop:
      - switch.fan_2
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - entity_state_enabled
    night_lights_entity_state:
      - input_boolean.night_mode_for_lights
    night_lights:
      entity_id: light.temp_office_wleds
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
    include_night_light_colour_control: use_rgb_colour
    night_light_rgb_colour:
      - 255
      - 10
      - 10

also, sorry, i don’t get how the toggle helper for 0% fade is meant to work. i’ve created one (and left if in both an On and Off state) but as soon as the lights hit 0% they go off, the toggle goes off and the automation stops… what am i doing wrong?

@DuckDuck25

The great thing about blueprints is that no matter how many automations you create, they all use the same code provided by the blueprint. The only difference is in your YAML settings. That said, it seems like a device or sensor you’re using might be causing the issue. Double-check that everything is working properly and that no other automation is interfering with it. You could also try swapping components to help identify the cause.

Hope you find it.

Blacky :smiley:

@iandogherty

I assume you’re referring to the toggle helper in Dynamic Lighting. You only need to use this helper if you’re setting Dynamic Lighting - Min Brightness Value to 0%. When Dynamic Lighting sets your light to 0%, Home Assistant sees it as OFF, but we still need to track that Dynamic Lighting is active. The toggle helper provides this status, ensuring everything runs smoothly.

Looking at your YAML, you haven’t set it to 0%, so you don’t need to use the toggle helper. The light is turning OFF because the automation has finished running, which also turns OFF the toggle helper.

Blacky :smiley:

i figured this one out - the toggle was working perfectly but the setting that switches the lights off if the maximum lux are exceeded (as opposed to dim to 0) was also killing the toggle. so i disabled that setting and now the lights fade to 0, toggle the toggle, and come back on again when the lux drops. nice.

1 Like

i am sure this has been discussed in the 2400 replies… if i am using dyanmic light, do i still need to tinker with sun elvation and ambient?