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

@otto001

No problem, any other question please ask… always happy to help.

Blacky :smiley:

it is related to the blueprint …on my automation I was able to select a button then select an action for that button to turn off the light

now it is not possible to chose the button on the blueprint as Im forced with the entities only (which is on the screenshot the entities exposed by the button)

Hi blacky,

First of, Thanks for this amazing blueprint.

It has been running fine for over a month and now all of a sudden I noticed since a few days back that the lights didn’t trigger anymore.

I went and looked at the home assistant core logs and found this

Logger: homeassistant.components.automation.test
Source: helpers/script.py:1805
integration: Automation (documentation, issues)
First occurred: 09:15:12 (9 occurrences)
Last logged: 09:20:44

Woonkamer - Sensor light: Choose at step 1: default: Error executing script. Error for parallel at pos 4: Error rendering data template: UndefinedError: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'brightness'
Woonkamer - Sensor light: Choose at step 1: default: Parallel Actions for dynamic lighting: parallel 1: Choose at step 7: Set the Sun Elevation Lighting - Colour Temp + LUX Controled Brightness for the normal lights switch: Dynamic Lighting Control: Choose at step 1: Set the transition, dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights switch: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'colour_temp_value' is undefined
Woonkamer - Sensor light: Choose at step 1: default: Parallel Actions for dynamic lighting: parallel 1: Choose at step 7: Set the Sun Elevation Lighting - Colour Temp + LUX Controled Brightness for the normal lights switch: Dynamic Lighting Control: Error executing script. Error for choose at pos 1: Error rendering data template: UndefinedError: 'colour_temp_value' is undefined
Woonkamer - Sensor light: Choose at step 1: default: Parallel Actions for dynamic lighting: parallel 1: Choose at step 7: Set the Sun Elevation Lighting - Colour Temp + LUX Controled Brightness for the normal lights switch: Error executing script. Error for repeat at pos 1: Error rendering data template: UndefinedError: 'colour_temp_value' is undefined
Woonkamer - Sensor light: Choose at step 1: default: Parallel Actions for dynamic lighting: parallel 1: Error executing script. Error for choose at pos 7: Error rendering data template: UndefinedError: 'colour_temp_value' is undefined

I previously managed to fix it just by restoring a backup wich seems to help but it keeps coming back after a certain amount of time.

I also tried deleting the blueprint and reimport it and set it up again as I had it before and that also works, but again only for a certain amount of time until the same error happens.

Could you please help me trouble shoot where this is coming from? I’m at a loss here.

Kind regards,

Isy

just one question:

I have 4 driveway lights I control by motion. 2 of these are default on from sunset for 2 hours.
problem: when motion is detected all 4 lights are turned on (good), but after n minutes all 4 lights are turned off, including those being on before (not so good).

How can I make “Sensor Light” keep a light on after turn-off time when it was already on when motion was detected?

Thank you for maintaining this automation @Blacky :smiley:

Quick question: is it possible to have the automation NOT change to night light while there is motion detected?

Typical scenario: a person enters the bathroom at 9:58PM. The lights turn on at 100%. At 10:00PM the automation is set to activate night light mode (40% brightness). I would like the night mode not to activate immediately if the light was previously triggered during daytime. The moment the light is turned off due to inactivity the night light can then activate with the next motion detection.

I’m trying to avoid changing the brightness while a person is in the room.

Thanks​:grin::+1:

@isy-NL

Firstly welcome to the community :wave:

It seems like the issue you’re encountering is related to a problem in your Home Assistant, specifically in the area where you’re trying to access attributes like ‘brightness’ and ‘colour_temp_value’. The error message indicates that these attributes are undefined or missing when the automation is triggered.

Because it works we know the blueprint is working and then it stops working… maybe light is not communicating with HA. I would start there.

EDIT: Just checking you know you have selected ‘Use The Dynamic Lighting Options’ as sometimes when you scroll the mouse it changes a selection without you knowing and then you save something that you don’t want.

Blacky :smiley:

@paulk2

Hi Paul, and welcome to the community.

I not sure what turns ON the 2 lights at sunset but maybe if it is another automation then let that automation control those 2 lights. Then you could have this blueprint control the other 2 lights.

If you would like it to control all 4 lights after 2 hours after sunset then you could use scripts that turns ON and OFF 2 lights between sunset and 2 hours, then after that time frame turn ON and OFF all 4 lights when motion is detected, or you could also use nightlights and maybe a toggle a helper through the other automation.

So you would use the toggle helper in the night lights state condition. Then between sunset to 2 hours the toggle helper is OFF… then use normal lights and the 2 lights that get turned ON / OFF, Outside those hours the toggle helper is ON activating night lights, then use all 4 lights that will be turn ON / OFF together. Then you could set a global condition to only tun between sun condition (sunset to sunrise),

Blacky :smiley:

@Cregeland

Yep, just make sure you don’t select the crossover in night lights light control as shown below.

Blacky :smiley:

Great - thanks😁 I just noticed I was running v4.9 so I did not have those options. Updated now😁

Will this work when using scenes as well or only with light entities? I have created night and day scenes that are triggered with motion.

@Cregeland

Nice one :+1:

It should but make sure you use the ‘Scenes & Scripts - Toggle Helper’ if you are using a scene.

Blacky :smiley:

Hi Blanky,
I don’t seem to be able to get this going… The light doesn’t come on at all. I’ve tried manually to dime the light entity and it dimes up and down.
In 7 above you mention ‘Brightness’ and ‘Transition’ I ticked the Brightness box but does one need to tick the ‘Transition’ box and the (8 above) ‘If lights are ON, adjust the lights when crossing over’ tick box, both of them ticked or just the ‘crossing over’?
BTW: What does the ‘Crossing over’ mean?

Is there a chance you also implement colorselection voor LED/HUE/…?

Hello everyone,

First of all, thanks a lot for your work @Blacky !

I’m trying to do something easy, turn on a light if motion is detected and LUX value is below some value. I’ve this at the moment:
Motion sensor & light that will be turned on/off

LUX settings

And if I understood correctly, it should only trigger light ON if LUX < 20 (not sure if 20 is also included) and should trigger light off is LUX > 40.

The issue is that it’s always triggering, even during the day when LUX is 350+. Am I doing anything wrong ?

yaml config
alias: Hall - Sensor movimento acende luz banco
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.sensor_movimento_hall_entrada_occupancy
    light_switch:
      entity_id: light.luz_hall_banco
    time_delay: 3
    ambient_light_sensor: sensor.sensor_movimento_hall_entrada_illuminance_lux
    ambient_light_high_value: 100
    ambient_light_value: 20

Thanks a lot for your time and happy easter to everyone :slight_smile:

Hi Bobie,

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:

Thanks for your suggestion, colour is on my list to do.

Blacky :smiley:

@lmarcelocc

Please enable ambient option as shown below.

Blacky :smiley:

1 Like

Hi Blacky,

Thanks again for your replying to my queries. I think I have managed to sort most of the problems myself - see there is a god…

I removed the ‘Transition’ tick in the ‘Light Control Option’ and only ticked ‘Brightness’ and ‘If lights ON, then adjust the lights when crossing over’.

I’m about to change a few settings so I can see more clearly the ‘transition’ and the dimming taking place.

Can I ask you one more question: How is the transition done? Is it a stepping brightness motion and if so how many steps - is it Time/100 = the stepping iteration or time/256 perhaps?

I’m fascinated how you’ve managed to implement a dimming process.

Thanks again for all the help…

Bob…

@Blacky thank you for looking into my post.

You asked for the yaml of the automation. I think I posted it within my first post describing the issue or am I mixing things up here?

I played around with all the settings related to the “Dynamic Lighting Options” and whatever I change, as soon I select a Dynamic Lighting Option, lights wont turn on anymore.

I also tried it with another light entity and its still the same. It wont switch on the light as soon I select a Dynamic Lighting Option.

Hi - did you get a chance to have a look at the ‘If lights are ON, adjust the lights when crossing over’ option. Mine have that option disabled but they still change over to the night scene at the selected TIME but the night option.

Thanks.

Hi I’m trying to use the bypass functions but can’t seem to get what I want to work.

My scenario is:
Front door opens > turns the light on > start timer when the door closes > turn light off when timer expires. All pretty straight forward and works well.

However, I want to bypass this functionality if the light is already on when the door opens and do nothing. Any suggestions?

I’ve read the section on configuring the bypass ON/OFF buttons but I want my light switch to directly control the light and not be a remote switch running the Sensor Light automation.

The best workaround I’ve come up with so far is to have a 2nd automation that disables the Light Sensor automation when the light switches on and the Light Sensor automation hasn’t run for 5 seconds. Then re-enables it again when the light switches off.