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

@jc2402

Welcome to the community.

I will need to look at your settings.

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:

@akira33

Welcome to the community.

Your controlling two different lights so you will need 2 automations. I am not sure how your sensor works but you should be able to identify what was the trigger. The sensor may have zones like zone 1 and zone 2. Then use the zone as the trigger.

Night lights will follow once you have your sensor is set up correctly but your sensor must be able to identify the 2 different triggers.

Zone 1 = between 40cm under 200cm.
Zone 2 = over 40cm under 500cm.

Blacky :grinning:

@herbert1910

I never really looked at it but I can see what your saying. I think it is because we are using targets in the blueprint as the input select. This looks to be a bug in HA that you could log… I will do it for you and see if HA fixes it.

Edit: Reported click here
Edit 2: New reported link as it is core related, click here.

Blacky :grinning:

1 Like

Blacky

Thanks for taking the time, and apologies if something simple I have overlooked.

alias: Front Garden Lights Control (Blacky - Sensor Light)
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.front_garden_triggers_group
    time_delay: 0.5
    light_switch:
      entity_id:
        - light.front_garden_switch_one_light_5
        - light.tz3000_ruxexjfz_ts0002_light
        - light.tz3000_ruxexjfz_ts0002_light_2
        - light.porch_light_dimmer
    include_sun: sun_enabled
    include_night_glow: night_glow_enabled
    night_glow_lights:
      entity_id: light.porch_light_dimmer
    include_night_glow_light_control:
      - use_brightness
      - use_transition
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - entity_state_enabled
    night_lights_after_time: "00:01:00"
    night_lights_before_time: "23:59:00"
    include_time: time_disabled
    after_time: "05:00:00"
    before_time: "23:00:00"
    include_light_control:
      - use_brightness
    night_glow_light_brightness: 20
    night_lights_sun_elevation: -1.5
    night_lights:
      entity_id: light.porch_light_dimmer
    night_light_brightness: 20
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
      - manage_scripts_crossing_over
      - use_brightness
    night_lights_entity_state:
      - binary_sensor.dark_outside

I have a chandelier (in a stairway) where i want to start the light at 1%, however the leds won’t turn on unless the initial brightness is 15%.

It’s been some months since I read everything available for the Sensor Light blueprint, is there any way I can cause the initial turn on to start at 15% and then immediately drop to 1% and then follow the normal blueprint behaviour.

Alternatively I can use a separate automation to set 15% → 1% and then call the blueprint.

Seems this might be a common issue and wondering how others solve it while still using Sensor Light.

Hey Blacky,
Hoping you can provide some guidance on an automation I’d like to setup. I’d like to enable specific lights to be turned on at sunset, and stay on, until I manually turn them off using a pico remote, and to stay off until the next day where they will turn on again at sunset… How can I achieve this?

Thanks
AliG

Hey, couldnt you just achieve this with a straightforward automation or perhaps two? Use the sunset as a trigger to turn the lights on with one automation, and a second to turn them off with the pico remote?

Is there any way to debug why the sensor light automation doesn’t trigger for me?
It’s a pretty simple setup (Because I’ve stripped it all back trying to get it to work). But the automation tells me the last time it triggered was 2 weeks ago.

But the trigger entity shows it triggering every time I walk past it.

The YAML is

Cheers…

@jc2402

Thanks Jon that helps.

I have changed two things.

  1. In Night Light Control I have unticked Yes - Manage OFF script when crossing over as your not using any scripts.
  2. In Night Light Control I have changed your Night Lights - Brightness from 20% to 60%. See your glow lights are set on 20% and because they are the same brightness value (20%) you wouldn’t seen any change and is why you think it is not working. Setting them to 60% you now will see the change. You will need to adjust this brightness value to your liking.
alias: Front Garden Lights Control (Blacky - Sensor Light)
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.front_garden_triggers_group
    time_delay: 0.5
    light_switch:
      entity_id:
        - light.front_garden_switch_one_light_5
        - light.tz3000_ruxexjfz_ts0002_light
        - light.tz3000_ruxexjfz_ts0002_light_2
        - light.porch_light_dimmer
    include_sun: sun_enabled
    include_night_glow: night_glow_enabled
    night_glow_lights:
      entity_id: light.porch_light_dimmer
    include_night_glow_light_control:
      - use_brightness
      - use_transition
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - entity_state_enabled
    night_lights_after_time: "00:01:00"
    night_lights_before_time: "23:59:00"
    include_time: time_disabled
    after_time: "05:00:00"
    before_time: "23:00:00"
    include_light_control:
      - use_brightness
    night_glow_light_brightness: 20
    night_lights_sun_elevation: -1.5
    night_lights:
      entity_id: light.porch_light_dimmer
    night_light_brightness: 60
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
      - use_brightness
    night_lights_entity_state:
      - binary_sensor.dark_outside

Blacky :grinning:

Legend, thank you. I look forward to trying this out this evening :slight_smile:

1 Like

@SoccerTX

What you could try is to wright a script that turns your lights ON to 15% wait a second or two then turn your lights to 1%.

In the blueprint do the following

  1. Add you chandelier entity into Lights - Switches - Scenes - Scripts.
  2. Also add your script into Lights - Switches - Scenes - Scripts that turn your chandelier lights ON at 15%, then wait and then turn your chandelier lights ON to 1%.
  3. Then make sure you also enter in a Scenes & Scripts - Toggle Helper.
  4. In Scenes - Scripts To Turn OFF you don’t need to add anything in because you have already added in your chandelier entity into Lights - Switches - Scenes - Scripts and the blueprint will turn them OFF.
  5. Set your Light Control Brightness to 1%.

Now when the blueprint automation turns on your chandelier for the first time the script will run and turn them on to 15% an back down to 1%. Because you added your toggle helper in it will only do it once. This part you said ā€œand then follow the normal blueprint behaviorā€ I am not sure what your doing maybe going from normal lights to night lights and then back to normal lights and is why I suggested to enter in your entity and a script.

Blacky :grinning:

@DaAliG

Use this blueprint :high_brightness: Smart Light. In Trigger - Sun Elevation use the Sun Elevation Falling - ON and set up your Sun Elevation Falling. Enter in your lights etc and most of the options are like this blueprint so you can decide what you would like to do with your lights. Now they will turn ON but you will have to turn them OFF manually.

Maybe you could also use the time OFF trigger and set it past when you would manually turn it OFF so if your not home and forget to turn them OFF they will turn OFF for you. Like a safety backup option.

Blacky :grinning:

1 Like

@hamish2

No need to debug, I will show you why.

You using devices in Lights - Switches - Scenes - Scripts and you must only use entities. This FAQ will show you how to get your entities for the devices you selected, click here.

Blacky :grinning:

Hello, I need help with a setting.
At the moment I use the Blueprint so that light is switched on when movement is detected and switched off with a time delay if no movement is detected. I also use the sun option. Everything works great.
I would now also like to set the light to always switch off with a time delay if no movement is detected.
My wife and children keep forgetting to switch the light off again
Is that possible?

hello and thank you for your wonderfull blueprint

i have a question, i have a lux sensor and a light, i use the dyamic lighing (option 1) and it is working fine but the brightness when the light switch on is always 100% even if i configured the brighness in light control at 45%.

if i disale the dyncamic lighting, the starting brighness is 45%

Great work with this Blueprint.

I am using it in a couple of rooms that have over 15 lights in each room. The problem I am getting, and this not to do with the Blueprint as I have the same issue without the blueprint, is that not all the lights turn on sometimes and not all the lights turn off sometimes.

I have been reading about and there is some talk about sending so many instructions at the same time sometimes causes some to get lost.

I have also tried using scenes but suffer from the same issue.

Apparently putting a small delay between sending the commands for each light may solve it but I have no idea on where or how to add this to the YAML.

Also is there a way to write a script to check to see if all the lights came on or off and if not run the automation again on those lights?

I am not sure if anyone else has had these issues or it is just my set up?

Thanks

Spent a while on it, as there were a few other bits not quite right, but, thanks to your help I now have a working automation, thank you again for supporting this.

I have one last niggle, but, it is not too important as I can find a way to work around it, but I thought I would share. If I try and turn off ā€œtransitionā€ under night lights, or indeed both under night lights and glow, my non-glow flood light will trigger on for motion, but never clear. Pop transition back on, and it works as expected. Yaml from my dummy set up below:

alias: Dummy Sensor Light
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.dummy_motion_detector_sensor
    time_delay: 0.5
    include_light_control: []
    light_brightness: 80
    light_transition_on: 2
    light_transition_off: 5
    include_night_lights: night_lights_enabled
    night_lights_entity_state:
      - input_boolean.dummy_darkness_sensor
    night_lights:
      entity_id:
        - light.dummy_light
        - light.dummy_flood_light
        - light.porch_light_dimmer
    include_night_glow: night_glow_enabled
    night_lights_conditions:
      - entity_state_enabled
    night_glow_lights:
      entity_id:
        - light.dummy_light
        - light.porch_light_dimmer
    include_night_glow_light_control:
      - use_brightness
      - use_transition
    night_light_brightness: 80
    night_time_delay: 0.5
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
      - use_brightness
      - use_transition
    night_lights_before_time: "23:59:59"
    light_switch:
      entity_id:
        - light.dummy_light
        - light.dummy_flood_light
        - light.porch_light_dimmer
    night_glow_light_transition_off: 5
    night_light_transition_off: 5

As I said, I was only playing with transition to solve an issue with one of my dimmers revertint to 1% on, and I can find another way to solve that so this isn’t causing me a big issue, but I think it may have been one of the things that caught me out in my journey with this blueprint.

Thanks :slight_smile:

Tried another time with updated blueprint but I still have the problem, after turn on from addon, the ā€œLED Scrivaniaā€ is the only one that turn off, the other lights turn on as expected

@TheBermud

Yes, but not within this blueprint. I’m assuming the lights are being turned ON manually when this blueprint can’t run due to the sun condition.

To achieve what you want, you’ll need to create a custom automation.

Use the following structure:

  • Trigger: Light turns ON
  • Condition: Sun is above the rising elevation and below the falling elevation (use the same elevation values as this blueprint)
  • Action:
    • Wait for the motion sensor to remain clear for X minutes
    • Turn OFF the light

Here’s a basic outline you can copy into a new automation. Just replace the light entity, motion sensor, and adjust the solar elevation values to match your setup.

description: ""
mode: single
triggers:
  - trigger: state
    entity_id:
      - light.your_light
conditions:
  - condition: numeric_state
    entity_id: sensor.sun_solar_elevation
    above: -4
    below: -1.5
actions:
  - wait_for_trigger:
      - trigger: state
        entity_id:
          - binary_sensor.your_motion_sensor
        to: "off"
        for:
          hours: 0
          minutes: 5
          seconds: 0
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: light.your_light

Blacky :grinning:

1 Like