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

Thank you so much for building this! Iā€™m wondering if you could easily add a cool-down delay of a couple seconds either baked in or as a toggle? If using binary-sensor.cam-motion sensors as triggers, unfortunately with many cameras, the act of turning the light off retriggers the detection.

This doesnā€™t seem to be working. I set the light I want to control under ā€œLights - Switches - Scenesā€ and the motion sensor under ā€œTrigger Sensor - Binary Sensors - Scheduleā€. Then I turned on ā€œUse The Sun Option (Optional)ā€ and set both sliders to 2Ėš as I want the light on for a little bit less than the time the sun is up. The light comes on when the motion sensor is detected, but doesnā€™t come on at all otherwise. Iā€™m manually having to turn it on and off via HA. Am I missing something here?

So ive tried to setup a simple automation with your marvelous blueprint.
I just love the amount of options.
But i can get it to run.
When i try to do a test run on it, i just end up with the following string
Stopped because of unknown reason ā€œnullā€ at December 16, 2023 at 11:40:16 PM (runtime: 0.00 seconds)

@ZzetT

Hi Alex, when adding in this feature way back in version 3.4 the colour temperature ā€œKelvinā€ was not an option for a selector input. It has just been introduced in this months release of HA 2023.12. When I originally added it to the blueprint, HA would convert kelvin to mireds so it should convert it for you automaticity. The new kelvin input still only provides a number value and it is just the way it looks in the UI.

I would like to use the new selector and have already reviewed it. There are a few concerns that I have and have already approached HA on it. They are;

  1. No text box. It is very hard to select what you would like especially when using the mobile app. If we had a text box then we could just simply input the number and click save.
  2. No step value provided in the kelvin input makes it hard to use the slider as the step value is 1. From 2002 to 8000 there 6000 step values.

I like to wait when new features are added so users have the time to update their HA. If I add it now and your are not on the latest version the blueprint will break.

It is interesting that you say HA didnā€™t convert kelvin into mireds as this is the first time someone had brought this up. I think when you are trying to get a warm light in mireds you have to use a higher value in kelvin instead of the lower value you were trying as I think they work in opposite as seen in your image of mired and kelvin.

That all being said I think adding in the new kelvin selector will look nice but at this point it will reduce the functionality we currently have, so I will hold on this until I hear back from HA.

Blacky :smiley:

@Radixb

The best way to do this is by using template sensors. You then are able to get exactly what you would like. I have a FAQ on this Click Here. REF - TS-2 is for a camera but I am not sure that is the one you are after so maybe look at them all as they may give you an idea on how to achieve what you are after. If not then maybe post another topic asking the community on how to create a template sensor for your needs. There are many community members that will help you achieve this.

Blacky :smiley:

@jaevans

The blueprint work of the trigger sensor. So if the trigger sensor is OFF then the light will not come ON. The sun is a condition and not a trigger, so it will not come ON when the sun sets and your motion sensor is OFF. There are ways to use the sun as a condition trigger but your motion sensor (Trigger Sensor) must be ON.

If you would like a sun trigger then you can use this blueprint. :gear: Turn Light, Switch or Scene On & Off with Trigger Conditions

If I am not on track with you then just let us know if you need more help.

Blacky :smiley:

@zeducky

Hi Kim, you canā€™t use areas and or devices. Please expand down to entities. See the FAQ

Q: My Trigger Is Not Triggering The Automation?

A: Please follow these steps Click Here.

Let us know if this works for you.

Blacky :smiley:

Hi Blacky,

Iā€™m not sure if I am doing something wrong, but my lights donā€™t turn off at Sunrise.

I tried to configure the following:

  • Lights On between 6:00 and Sunrise. After Sunrise, Lights must turn Off
  • Lights turn On at Sunset and turn Off at 23:00.
  • Nightlights active between 23:00 and 6:00. During Nightlight, my Lights must be Off and only turned on based On motion.

My motion trigger is a grouped helper and is a combination of:

  • Scheduled helper (6:00 to 23:00) that is transferred to a binary sensor by using the Template sensor.
  • My motion sensor.

During Night time (23:00 and 6:00) light seems to work ok (Basically Off and turned On for a few minutes based on motion).
Problem is that my lights turn On at 6:00 and turn Off at 23:00, while they should be off during daytime (Sunrise/Sunset)

What am I doing wrong?

This is my Yaml:

alias: "Light: Blueprint Tuin Voor"
description: Verlichting Tuin Voor
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.light_buiten_voor_schedule_and_motion
    light_switch:
      entity_id: scene.ha_scene_tuin_v_aan
    end_scenes:
      - scene.ha_scene_tuin_v_uit
    include_sun: sun_enabled
    time_delay: 2
    include_light_control:
      - use_transition
    light_transition_on: 5
    light_transition_off: 15
    sun_elevation: -1
    sun_elevation_rising: -4
    night_lights_sun_elevation: -1
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id:
        - scene.ha_scene_tuin_v_aan
    include_night_light_control:
      - use_transition
    night_light_transition_on: 4
    night_light_transition_off: 10
    night_time_delay: 3
    night_lights_after_time: "23:00:00"
    night_lights_before_time: "06:00:00"

@mars2020

Firstly, nice work looks like your going through the FAQ.

Could you try something for me.

I can see you have put in an entity in for normal lights but can you also put one entity in for night lights as you are only using scenes in night lights.

Let me know if this works.

Blacky :smiley:

As it is almost Christmas I added my Christmas tree as an entity in the nightlights. :grinning:

Nice oneā€¦ let us know if it works.

Blacky :grinning:

It looks like the Scenes work fine now (they turned off during day-time), but the entities did not turn off.

I will keep an eye on it and give you an update coming dayā€™s about how it goes.

1 Like

Blacky,
I just wanted to say thank you, I was trying to figure out how to turn on a set of lights based on 2 occupancy sensors detecting presence, and found this post, and figured it out. Kudos Sir, should definitely add this in the FAQ, I would guess other people using MMwave sensors with multiple zones this information will come in handy! Once again Thank you!!

1 Like

No problem at all and thanks for your kind words :smiling_face_with_three_hearts:

Blacky :smiley:

I had the same issue until I stumbled across this post. I tried it out and it works great!

Thanks for the blueprint and posting this easy fix.

One thing I noticed when I open the shower door the lights turn off and turn back on again when motion sensor picks up movement. Any idea how to fix it?

Actually I spoke too soon, the wife wants me to make a change. I currently have it where if Sensor 1 and Sensor 2 are triggered to on, the light turns on. Now She wants me to change it where if the above logic gets triggered, and if Sensor 2 is cleared (No occupancy) to keep the light on until Sensor 1 and Sensor 2 are clear
So in other words
S1 =on, S2 = Off Then the light is off
S1 =on, S2= on, Then the light is on Now because of this trigger, if S1 =on, S2=off then to stay on until S1=off & S2 = Off

Is that Possible?
Here is my Template sensor currently:

template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1
        to: "on"
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1
        to: "off"
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_5
        to: "on"
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_5
        to: "off"

    binary_sensor:
        - name: "Kitchen Stove and main Occupancy Sensors"
          device_class: occupancy
          icon: mdi:motion-sensor
          state: >
            {% if is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'on') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'off')  %}
              off
            {% elif is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'on') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'on') %}
              on
            {% elif is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'off') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'off') %}
              off
            {% endif %}

@ruaandeysel

No problem, your welcome.

Just put in a delay. ON or OFF. Below is an example with the ON delay @ 10 seconds. Change to your liking.

binary_sensor:
  - platform: template
    sensors:
      shower_door:
        friendly_name: "Shower Doors"
        device_class: door
        icon_template: mdi:door
        value_template: >-
          {{ is_state('binary_sensor.your_shower_door_sensor_here', 'off')
        delay_on:
          seconds: 10

You can also look at this blueprint :shower: Bathroom Humidity Exhaust Fan it will do what you are trying to do and more. Have a look at the FAQ - My set up.

Blacky :smiley:

1 Like

Try this

template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1
        to: "on"
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1
        to: "off"
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_5
        to: "on"
      - platform: state
        entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_5
        to: "off"

    binary_sensor:
        - name: "Kitchen Stove and main Occupancy Sensors"
          device_class: occupancy
          icon: mdi:motion-sensor
          state: >
            {% if is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'on') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'on')  %}
              on
            {% elif is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_1', 'off') and is_state('binary_sensor.kitchen_presence_sensor_presence_sensor_5', 'off') %}
              off
            {% endif %}

Unfortunately itā€™s not working. Scenes work fine now (they turned off during day-time), but the entities did not turn off.
Looks like a bugā€¦ā€¦

Afraid itā€™s not working, when Sensor 5 clears it still turns off the light :frowning: :face_holding_back_tears: