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

Dear Blacky, Thanks for this blueprint, just found it and excited to get it working. I tried setting it up with the binary_sensor motion sensor entity from my Aqara Camera Hub G3, but the automation isn’t triggering :'{

I have made sure that the target lights for the trigger is are entities. Also added a toggle helper in case this was the issue but this made no difference. Any advice is much appreciated!

@h4x0rdentist

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:

1 Like

Thank you so much for your response, actually in looking at the YAML I think I figured out the problem. But will post the code here if it might be of help to others:

alias: Living Room Sensor Light
description: >-
  Turn on Living Room Lights if motion detected by camera. Turn off lights after
  X minutes of no motion detected.
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.living_room_camera_motion_sensor
    light_switch:
      entity_id:
        - light.living_room_light_left
        - light.living_room_ceiling_light
        - light.living_room_right_light
    time_delay: 1
    light_transition_on: 1
    light_brightness: 30
    include_dynamic_lighting: disable_dynamic_lighting
    include_sun: sun_enabled
    include_night_lights: night_lights_disabled
    end_scenes: []
    boolean_scenes_scripts: input_boolean.living_room_lights

I changed sun_enabled to sun_disabled

Yep it could be that the sun condition was not allowing it to run. Nice one glad you are up and running.

Blacky :smiley:

1 Like

Haha :sweat_smile: Appreciate the touch! I wasn’t aware of template triggers. I will give it a try. Thanks a lot! :blue_heart:

1 Like

As a non pro tech person… this has brought magic into my home. Thanks!

@h4x0rdentist

Thanks for your kind words, glad you like it.

Enjoy

Blacky :smiley:

Hi,

Is it possible to use something like this sensor for ambience SONOFF SNZB-06P ? It provides illumination but not as a lux value but as an enum.

Illumination (enum)
Only updated when occupancy is detected. Value can be found in the published state on the illumination property. It’s not possible to read (/get) or write (/set) this value. The possible values are: dim, bright.

@siddharthdevilz

You will have to create a template sensor an add the code to your State template*. You will need to replace the “binary_sensor.your_illumination_sensor_here” with your sensor entity ID.

Go to settings > devices & services > helpers tab > create helper > template > Template sensor and then add name, code, xyz as shown below.

{% if states('binary_sensor.your_illumination_sensor_here') == 'dim' %}
  1
{% elif states('binary_sensor.your_illumination_sensor_here') == 'bright' %}
  3
{% else %}
  0
{% endif %}

Then add your settings into the blueprint using 2 as your high and low.

Blacky :smiley:

Hi Blacky and All,

Apologies if this has already been asked solved.

My binary sensor is the motion sensor entity in an Aqara Camerahub G3.

However, when the lights turn off, the motion sensor is triggered and so the lights turn back on.

I can’t figure out what I’m missing in the configuration; or if I need to do something differently.

Many thanks in advance!

@h4x0rdentist

I have seen this before in cameras. Your camera is picking up the light change (ON to OFF) thinking it is motion. I don’t have the Aqara Camerahub G3 so I am unsure what settings you have. Try reducing the sensitivity or on that line of thinking. It is not the BP it is your Aqara Camerahub G3.

If all else fails then I have a template example on how to do a delay but then you will have a delay for when it comes ON so it is best to try an resolve it in your settings. The link to the template example is here… see REF - TS-2. The delay is 2 seconds but try reducing it down as much as possible. You then use this template as the trigger.

Blacky :smiley:

1 Like

Awsome thank you, it’s reassuring to know that it’s not me being stupid.

I will try your suggestions, but I have ordered the new Everything Presence Lite sensors and so will be using these instead with the blueprint. Thanks again :pray:

1 Like

I want the garage lights to come on when 1) garage bay door open or 2) garage door into the house opens. This works fine (I’ve grouped them). However, how can I turn the light off (it was on) when a different door (let’s say “side door”) is opened? Is this a “bypass” logic? I don’t want bugs to be attracted to the lights so I want them to go off should that side door be opened.

@soundneedle

Yes use bypass option 2 with a door sensor on your side door.

Blacky :smiley:

New update 6.9

Your lighting experience, your way – take control and customize it to perfection! :bulb::sparkles:

New Feature :new:

  • Collapsible Sections - Added collapsible sections to the blueprint. This enhancement improves the blueprint user interface by making it cleaner and more organized, allowing sections to be collapsed.

    :warning: This feature was introduced in Home Assistant 2024.6, so you must have this version or later for the blueprint to work.

Maintenance :toolbox:

  • Update deprecated code for light control in kelvin.

Code Clean Up :broom:

  • Cleaned up code for reliability that could cause a bug.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

5 Likes

Hello
The blueprint looks nice but it wil not trigger,
I have a aquara motion sensor as trigger and it wont start. when motion is detected.

alias: Vorraum 2 Licht
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bs_vorraum_2_occupancy
    light_switch:
      entity_id:
        - light.sl_vorraum_2_a
        - switch.p_vorraum
        - light.sl_vorraum_2_b
    boolean_scenes_scripts: Vorraum 2 Licht
    time_delay: 2

@alexebner

Looks like you edited your YAML manually as your “Scenes & Scripts - Toggle Helper” is wrong. This is not an input_boolean entity ID. You are only using lights and a switch so you don’t need this input boolean. Please remove the bottom line and test it again.

boolean_scenes_scripts: Vorraum 2 Licht

Blacky :smiley:

Thank you for the tip. Now its working.

Amazing job :slight_smile:

Is it possible to configure the color of a RGB light with differents colors for differents range of time ?
Example red after the sunset (Night) and white after a certain time.

Hey, thank you for the great blueprint. I have a question.
I have a stair with 2 doors at the bottom and the top of the stair. Both doors have sensors and my goal is to turn on lights on the staircase the moment any of the doors open. Also my goal is to extend the time lights are on, each time any of the doors close and then open again.

You recommend to group multiple trigger sensors into a group sensor. But in this case as long as one of the doors is open, no matter how many times I open/close the 2nd door, binary group sensor says door is open once and then doesn’t register future door opening/closing. Hence duration that light is on doesn’t get extended with each opening and closeing of the 2nd door as long as 1st remains open.

Do I understan correctly that in this case I should not follow your advice and create a group binary sensor, but instead use each of the door sensors separately inside the blueprint settings? Would appreciate your advice here.

And if my assumption is correct and scenario legitimate perhaps its worth updating the documentation to differentiate your advice depending on the scenario?