šŸ’” Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

@Blacky,
I would like to thank you for writing this blueprint up, but alsoā€¦ I spent 2 hours ripping out my hair cause I apparently donā€™t know how to read the part where it says that it only uses entities and nothing elseā€¦

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

@iandogherty

I use WLED and HA with colour temp and it works for me problem at all.

Dynamic lighting option 8 will not use RGBW it will use colour temp and brightness. Selecting this in light control will do nothing as the automation will not look at these settings. The only thing that will be active in light control will be transition.

Blacky :smiley:

@Yaksha

It would be them most FAQ I get and it is #1 FAQ. Glad you got it workingā€¦ hope you like it.

Enjoy

Blacky :smiley:

1 Like

Iā€™m sure the answer is in here somewhere and I just canā€™t find it, so I apologize in advance.

I am looking to build an automation that will turn on a set of lights when a door is unlocked or opened, and give up control (not turn them off, ignore the door being closed or locked.)

Thanks much folks, and especially @Blacky.

@jlh1

Welcome to the community.

Take a look at this blueprint :high_brightness: Smart Light - Entity - Sun Elevation - Ambient & Time Triggers and use the stat ON only.

Blacky :smiley:

Iā€™m running this blueprint and canā€™t wait to fully understand everything, but for now, Iā€™ll just ask this awesome community for help.

I recently made the jump to Home Assistant for more refined actions. I have a motion sensor in my master bathroom, and Iā€™d like to set up a door sensor as a bypass switch. The goal is to turn off the motion feature so the light stays on until the door is opened again, at which point the motion detector would resume its normal functionā€”turning the light on when motion is detected.

The motion detection works flawlessly, but as soon as I add the bypass, nothing works. Any advice on how to fix this?

Also, I have so many other things Iā€™d love to add, like buttons to perform additional tasks.

@WilliamHill

The best way to do this is to use my :honeybee: Bee In The Hive Sensor :honeybee: Click on the link and it will walk you through on how to set this all up Click Here. I developed it for this.

Let us know how you go.

Blacky :smiley:

How do I get my hands on the bee in the hive sensor ?

@WilliamHill

You can create a template binary sensor using the code I provided (:honeybee: Bee In The Hive Sensor :honeybee:) with your motion and door sensors. The code goes into your configuration.yaml file. To edit this file, youā€™ll need the File Editor add-on, which is easy to install and supported by Home Assistant.

Installing the File Editor Add-on:

  1. In Home Assistant, go to Settings ā†’ Add-ons ā†’ Add-on store.
  2. Search for ā€œFile editorā€ and click on it.
  3. Click ā€œINSTALL.ā€

Using the File Editor:

  1. Toggle the ā€œShow in sidebarā€ option to access it easily from the main menu.
  2. Start the add-on.
  3. Refresh your browser; youā€™ll see ā€œFile editorā€ in the sidebar.
  4. Open the File Editor, click the folder icon in the top-left, and find the configuration.yaml file.
  5. Add the code I provided there.

Modifying Entity IDs:

Before the code works, youā€™ll need to update some entity IDs:

  • binary_sensor.your_door_sensor_here: Replace with your door contact sensorā€™s entity ID.
  • binary_sensor.your_motion_sensor_here: Replace with your room motion sensorā€™s entity ID.

Reloading the Code:

After adding the code, you need to reload it for the changes to take effect:

  1. Go to Developer Tools ā†’ YAML.
  2. Under YAML configuration reloading, click Template Entities.

This reloads the template binary sensor.

This will create a new binary sensor to be used in the automation :partying_face:. Read the information on :honeybee: Bee In The Hive Sensor :honeybee: for more details.

Note: Be careful when editingā€¦ donā€™t delete anything important. If you run into issues, simply remove the added code.

Hope this helps! Let us know how you go.

Blacky :smiley:

Iā€™ve hit a bit of a roadblock at step 5. Iā€™m able to open the config.yaml file, but Iā€™m running into trouble when trying to add the Bee Hive code. Hereā€™s whatā€™s happening:

  • I can copy the Bee Hive code, but when I try to paste it into the config.yaml file, it wonā€™t let me.
  • When I open config.yaml, it auto-populates with some code. Am I supposed to delete this or paste the Bee Hive code below it?

Essentially, my question is: how do I correctly get the Bee Hive code into the config.yaml file? Should I delete the lines that appear automatically or add the new code after them?

Any guidance would be much appreciated!

Thanks again for all the support.

Iā€™ve created the binary sensor group called ā€œBee in the hiveā€ and linked it to this blueprint, which is working flawlessly with the sensors in the group. However, Iā€™m facing an issue with The door contact sensor its working in reverse ā€” when the door is closed, the sensor reads ā€œoff,ā€ and when the door is open, it reads ā€œon.ā€

What I need is to flip this behavior so that the contact sensor reads ā€œonā€ when the door is closed and ā€œoffā€ when the door is open.

Any advice on how to fix this would be greatly appreciated!

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: