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

Is it possible to collapse and expand entries in blueprints? That would be awesome and make these blueprints so much easier to modify :grin:

2 Likes

First, thanks for this powerful blueprint!

I’d like to trigger an automation based on multiple situations with some overlapping conditions. Here’s an example:

  • Trigger 1: Light level drops below 40lx AND someone is at home AND time is before 23:00 (11:00 PM)
  • Trigger 2: First person arrives home (e.g., through location tracking or door sensor) AND light level is below 40lx AND time is before 23:00 (11:00 PM)

Question: What’s the recommended way to achieve this? Here are some options I found:

  • Multiple Simple Binary Triggers:
    • Trigger 1: Light level < 40 lux OR First person arrives home
    • Use the UI to set conditions (start/end time, days of the week, device tracker, sun, light level) for all triggers.
  • Template Trigger:
    • Define a single template trigger with the specific combination of triggers and conditions: (First person arrives home & time is < 23h & lux) OR (Lux < 40 & someone is at home & time is < 23h)
    • No need to set conditions separately in the UI.

I’m unsure how the conditions (Lux, time, presence) interact with each other in the UI. When setting multiple conditions like Lux below 40lx, time before 23h, sun below horizon, and someone at home, are these treated as:

  • OR conditions: (If any one condition is met, the automation triggers)
  • AND conditions: (All conditions must be met for the automation to trigger)

For example, if the trigger is occupancy > 0 and I also set a device tracker as a condition for other triggers, how would they interact?

I tried to play around with the options and the simpler automations work without problems. However, adding more conditions makes it difficult to troubleshoot why they aren’t working.

Thanks in advance for any help!

Thank you very much! :smiley:

@Bobie

Hi Bobie

Transition ON

Night Lights - Transition - ON

In your YAML you have no Dynamic Lighting options selected.

Below I will provide your YAML you need. Copy and paste it replacing your YAML and I will explain below.

alias: Blacky Outside light tester
description: Blacky Outside Lights on and off test
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - schedule.a_test_light_schedule
    light_switch:
      entity_id: light.my_test_moer_zigbee_dimmer_light_2
    time_delay: 0
    include_light_control:
      - use_transition
    light_transition_on: 5
    include_dynamic_lighting: enable_sun_elevation_brightness
    dynamic_lighting_min_brightness: 10
    dynamic_lighting_sun_elevation_start_falling: 5
    dynamic_lighting_sun_elevation_end_falling: -3
    include_sun: sun_enabled
    sun_elevation: 5
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.my_test_moer_zigbee_dimmer_light_2
    night_time_delay: 0
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
      - use_brightness
      - use_transition
    night_light_brightness: 10
    night_light_transition_on: 600
    night_light_transition_off: 5
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "18:30:00"
    night_lights_before_time: "19:10:00"
  1. I have set up dynamic lighting option 4.
  2. Because we are only concerned about dynamic lighting at sunset we are only concerned with these inputs. You will have to play around with them but it will start you of. Dynamic lighting will control the brightness so we don’t need to select it in the light control options but we will use transition to smooth it out between changes within dynamic lighting and 5 sec will do that.
    • Dynamic Lighting - Max Brightness Value = 100%
    • Dynamic Lighting - Min Brightness Value = 10%
    • Dynamic Lighting - Sun Elevation Descending - Start Point = 5 Deg
    • Dynamic Lighting - Sun Elevation Descending - End Point = -3 Deg
    • Dynamic Lighting - Heartbeat
    • Dynamic Lighting - Step Value
    • Dynamic Lighting - Dead Zone (±)
  3. In ‘The Sun Option’ we are only concerned with ‘Sun Elevation Falling’ as we are just dealing with sunset. this allows you to use your timer helper is from 4pm until 9pm. Having a start time of 4pm is earlier and allows us to use the sun to trigger it ON when it gets to 5 deg. Note the 5 deg is the same as used in ‘Dynamic Lighting - Sun Elevation Descending - Start Point’ so you will need to adjust these together if required. Also when adjusting the 5 deg make sure 4pm is well before this happens and you could even have 3pm if you require.
  4. Nightlights set up for you.

I haven’t tested this set up but you should be good to go. The main thing to adjust is

  • Dynamic Lighting - Sun Elevation Descending - Start Point = 5 Deg
  • Dynamic Lighting - Sun Elevation Descending - End Point = -3 Deg
  • Sun Elevation Falling = 5 Deg

Let us know if this works for you.

Blacky :smiley:

@kallecux

You are probably finding that your light is coming ON when it is below 5 but it will not turn OFF until it is above 80 as your ‘Ambient Light - High Lux Value’ is set to this. Having a Low and High setting allows us to have a buffer zone so the light wont flicker. You can adjust the ‘Ambient Light - High Lux Value’ down to 5 but it can be lower then your low setting.

Let us know if this works for you.

Blacky :smiley:

@pgale

Agree, please see this feature request and vote on it as it is a limitation in HA.

It is under development so HA is onto it. GitHub Link. It is why we love HA they really listen to us all.

When HA release it it will be implemented.

Blacky :smiley:

@jmesam

First thing is to work out your trigger. Normally it is a motion sensor but it looks like you are asking for 3 things.

  1. Time
  2. LUX
  3. Device Tracker

Out of the 3 we can use time as the trigger and set LUX and Device Tracker as conditions. If you use a schedule helper for your time and enter it into the trigger. This will be the time you would like the lights ON when it is below 40lux and someone is home.

Then set 2 conditions. Both have to be met (True) for the automation to run.

  1. The Ambient Options
  2. The Device Tracker Options

Hope this helps
 let us know how you go.

Blacky :smiley:

Hi Blacky,

Any luck on looking at the night lights crossover function?

I have sensor light in many of my rooms now and they all crossover to night light scenes (using the time option) even when the option is unchecked so I don’t think that check box is working.

Thanks.

@pgale

100% that is the next thing on my list and I am back to normal now with work so I have some free time now.

Stay tuned

Blacky :smiley:

1 Like

Thanks very much :grin:

New update 6.4

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

Bugs Fixes :bug:

  • Fixed bug when using scenes and crossing over from normal lights to night lights and vice versa. The option ‘If lights are ON, adjust the lights when crossing over’ now works with scenes but you must use ‘Scenes & Scripts - Toggle Helper’.

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:

1 Like

Newbie here. Your Sensor Light blueprint is awesome, and your user support is very kind. Thank you for everything you are doing for this community.

I have a Lutron Casetta inwall-switch, paired to a Lutron Casetta wireless pico-remote switch, and your blueprint is turning their light circuit on and off using a Hue outdoor occupancy sensor.

My wired Casetta in-wall-switch sometimes appears as an Entity in HA, but the wireless pico-remote I have paired to this wired Casetta in-wall-switch, does not. I suspect pico-remote switches are stateless togglers, although some pico-models include dimming and a favorite-dimness-button, so maybe they do remember something
? Anyway.

If I manually turn the light on, using the wireless pico-remote, your blueprint will soon turn the light off again, because no occupancy is being sensed. If I manually turn the light off, using the wireless pico-remote, your blueprint seems to disable itself. (BTW, to add to the confusion, I actually have several wireless pico-remotes paired to this wired switch, and all of them look identical to the wired switch because they are wall mounted with a faceplate).

I tried some of your very impressive bypass settings, trying to get the wireless pico-remote’s on-button to disable the occupancy automation – at least until the wireless pico-remote’s off-button is pushed. However, your bypass settings require me to select the in-wall casetta switch as a Device, and the pico-remote as an Entity, which it is not.

So, maybe wireless pico-remotes are not compatible with your blueprint? If so, would you suggest I simply unpair the (non-wired) pico-remotes from the light circuit, and replace them with a parallel-wired casetta switches? Hopefully there is a better solution, because that would require a lot of house re-wiring.

@rick.ball

Welcome to the community.

Your welcome and thanks for your kind words.

This will only happen if the automation is triggered then the Hue outdoor occupancy sensor goes clear.

If you turn the light OFF and the Hue outdoor occupancy sensor is true/active/occupied then in order for the light to be turned ON again the Hue outdoor occupancy sensor must go clear then true/active/occupied.

Regarding your Casetta in-wall-switch or your pico-remotes they must have a entity and it must have an ON / OFF state. You also can have it connected to the light but I am assuming you are using your Casetta in-wall-switch in ‘Lights - Switches - Scenes - Scripts’ so that will make the automation work but if you turn the light ON or OFF using this switch then the automation will be active and work of your Hue outdoor occupancy sensor. If you would like manual control then you can use your pico-remotes to turn ON / OFF a bypass option and you would normally use option 1 for this. You wouldn’t link it to your Casetta in-wall-switch and keep it as a independent switch just to control the bypass for manual control. If your pico-remotes don’t have a state then you can create a toggle helper and use the toggle helper in the bypass and have your pico-remotes toggle the toggle helper ON and OFF. Also note that you can use the ‘Bypass Auto OFF Option’ so you don’t forget to turn the light OFF.

Hope this all make sense

Blacky :smiley:

Thanks Blacky,

I’ve just seen this update - thanks I’ll give it a try this evening - I’m sure it’s work


I’ll also adjust the Sun elevation as you suggested and the on/off Helper so as to not miss the Sun trigger time


When I said I managed to get option 4 in Dynamic Lighting going I was just experimenting and didn’t copy you the YAML


One last question (I hope): Is the ‘Transition’ the total transition time from ‘off’ to ‘on’ say or the step transition from one light level to the next in the transitioning sequence?

Thanks again for your help - very much appreciated.

@Bobie No problem
 I think the dynamic lighting option 4 may be opposite to what you are after though. If so just let us know as I may need to make another option.

Blacky :smiley:

Hi :wave:

sometimes the bp sends multiple OFF and ON command to my devices. That’s pretty bad if the last command is the OFF command :confused:

The motion sensor one from Hue connected to a Hue bridge.
The light is served by Zigbee2MQTT, it’s this one: Lidl 14153806L control via MQTT | Zigbee2MQTT

The following log entries are from Zigbee2MQTT. It send 2 times OFF and 1 time ON. All at the same time?!

Debug 2024-04-14 18:47:09Received MQTT message on 'zigbee2mqtt/Light Staircase FF/set' with data '{"state":"ON","transition":5.0,"brightness":254,"color_temp":153}'
Debug 2024-04-14 18:47:09Publishing 'set' 'brightness' to 'Light Staircase FF'
Info 2024-04-14 18:47:09MQTT publish: topic 'zigbee2mqtt/Light Staircase FF', payload '{"brightness":254,"color":{"h":212,"hue":212,"s":10,"saturation":10,"x":0.3131,"y":0.3232},"color_mode":"color_temp","color_power_on_behavior":null,"color_temp":153,"do_not_disturb":false,"last_seen":"2024-04-14T18:47:10+02:00","linkquality":255,"state":"OFF"}'
Debug 2024-04-14 18:47:09Publishing 'set' 'transition' to 'Light Staircase FF'
Debug 2024-04-14 18:47:09Publishing 'set' 'color_temp' to 'Light Staircase FF'
Info 2024-04-14 18:47:09MQTT publish: topic 'zigbee2mqtt/Light Staircase FF', payload '{"brightness":254,"color":{"h":212,"hue":212,"s":10,"saturation":10,"x":0.3131,"y":0.3232},"color_mode":"color_temp","color_power_on_behavior":null,"color_temp":153,"do_not_disturb":false,"last_seen":"2024-04-14T18:47:10+02:00","linkquality":255,"state":"OFF"}'
Info 2024-04-14 18:47:09MQTT publish: topic 'zigbee2mqtt/Light Staircase FF', payload '{"brightness":254,"color":{"h":212,"hue":212,"s":10,"saturation":10,"x":0.3131,"y":0.3232},"color_mode":"color_temp","color_power_on_behavior":null,"color_temp":153,"do_not_disturb":false,"last_seen":"2024-04-14T18:47:10+02:00","linkquality":255,"state":"ON"}'

trace json: { "trace": { "last_step": "action/0/default/3/parallel/1/sequence/10", - Pastebin.com

Thank you so much for getting back to me – so crazy fast. You must be chained to your monitor, with your eyes glued open.

So
 I will unpair the Lutron picos from the circuit that the Hue occupancy sensor is controlling, and pair these picos up to a circuit that turns something else on/off instead, like an unused Lutron plug-in dimmer which is not controlling anything. Then, I will use this plug-in dimmer as the Entity required in your blueprint’s bypass off (option 1).

However, you suspect I need a toggle-helper attached to this unused plug-in dimmer entity. That way, multiple picos, all paired to this same plug-in dimmer, can control the toggle state. Yet, if the toggle type is a boolean input helper with either a value of on, or off, any use of any pico would trigger this toggle. So, conditions may need to be attached to the toggle-helper to make it work more sensibly.

Blacky, this work-around had not occured to me. I was thinking software, without thinking about reconfiguring the hardware connections. Yet, this is likely a mental hurdle faced by most folks who use bypass switch devices. It is obvious, in hindsight, but it had me stumped for days.

Maybe a teaching version of your blueprint would help educate folks about bypass switches? When these folks have their hardware properly connected, your full blueprint could be loaded, along with all its incredible options, and the teaching blueprint could help populate it, and get out of the way.

Meanwhile, I do not recall setting your blueprint to respond to a clear status from the Hue occupancy sensor. Your blueprint seems to default to turning the lights back off again, after the Hue occupancy sensor shows clear. And when a pico is pressed-off, it seems to permanently bypass the blueprint. I wonder if this bug-like behavior is caused by same object being listed with different labels, under target device and bypass entity? If so, I’m surprised the blueprint allows me to misconfigure it this way.

Hi Blacky,

In some of your explanation I think you say the light(s) will Decrease as the sun drops below the horizon. Again, I might be reading this all about face - I was thinking “why would anyone want to turn off lights as the Sun is going down”. I would have thought that one would want the lights to come on as the Sun sets.

I gave your YAML a go yesterday evening but I think I messed with the Sun elevation too much and screwed it. I’ll see what happens this evening.

Your support for this Blueprint is magnificent - I really hope I/we can get this going to suit my needs, odd as they are.

Light’s getting slowly brighter as the Sun goes down (1/2 hr perhaps) - then at a fixed time the lights Dim down slowly, 10mins perhaps, to a low light level and stay ON but dim - Then at a set time all go OFF.

Regards,

Bob


Very interesting: ESRL Global Monitoring Laboratory - Global Radiation and Aerosols

Hey Blacky! I found issue/bug with your blueprint and latest HAOS but not sure what exactly cause this, could you help please?
Using your blueprint with mix of zigbee/wifi lights (aqara) and motion/light PIR sensor, they are added as entity; dynamic light enabled as first option (lux controlled brightness). Before 2024.4 everything was fine: light could be switched on when motion detect and stay at brightness value based on dynamic light (50% for example), changing only when lux value changes too.
After 2024.4 HAOS update my light turning on with brightness based on dynamic light but right after it always goes up to 100% brightness according to step and heartbeat values. Looks like it ignoring my lux sensor after light turning on initially.
Nothing was changed from my side from february, only updates comes from HAOS. Restarting HAOS doesn’t help with this, 6.3