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

Hi Blacky,

It seems like the Transitionā€™s donā€™t seem to be working with my old Yaml code. I have put some exaggerated Sun present numbers in just to activate the Blueprint earlier.

Iā€™m a little confused about the use of the Transition options ā€“ Transition off or on? If Iā€™m going from lights off to lights on at 50Ā° do I use the Transition to ON and leave the Transition to OFF to whatever?

When Iā€™m dimming down in ā€˜Night Lightsā€™ do I use the Transition OFF (or ON)

I managed to get option 4 in Dynamic Lighting but to transition from 10% to 75% I had to use the SunĀ° angles to make any Transition ā€“ The Transition in the Dynamic Lighting seems to do nothing.

Again Iā€™m probably totally misunderstanding something but Iā€™m dammed if I can see it!!

Any help?

Perhaps you could configure and send me your Yaml file so I can see what works for you.

My need once more so we are both on the same page.

1, At a set Sun position in the evening I would like my outside lights to gradually get brighter following the Sun as it moves into darkness and the light would be at 100% brightness.

2, At a set time I would like the same lights to dim down slowly to a set level apx 10%, depending on the ability of my light to stay flicker free at whatever % - once I get it going I can adjust the Brightness, Transition and Sun elevation to suit my needs.

3, At a set time in the Evening/Night turn off the lights completely.

Again any help to get this going would be much appreciated and thanks in advance for the help.

Below in my latest YAML dump.

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
    include_sun: sun_enabled
    light_switch:
      entity_id: light.my_test_moer_zigbee_dimmer_light_2
    include_light_control:
      - use_transition
      - use_brightness
    light_brightness: 50
    light_transition_on: 600
    light_transition_off: 0
    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: 0
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "18:30:00"
    night_lights_before_time: "19:10:00"
    time_delay: 0
    light_colour_temperature: 5500
    night_lights_sun_elevation: 2
    night_lights_sun_elevation_rising: -4
    sun_elevation: 50
    night_light_transition_off: 600
    night_lights_entity_state: []

Regards,

Bobā€¦

Hi there,
i checked out this blueprint and i think this is very good.
But I canā€™t manage to use the AMBIENT function. My light always comes on, even if the ambient sensor delivers lux values ā€‹ā€‹higher than 5. What could I possibly be doing wrong?

This is my configuration:

alias: Licht bei Bewegung BĆ¼ro
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bewegungsmelder_buro_motion_detection
    light_switch:
      entity_id:
        - light.dimmable_light_1_26
        - light.dimmable_light_1_27
        - light.dimmable_light_1_28
        - light.dimmable_light_1_29
    time_delay: 0.5
    include_light_control:
      - use_brightness
      - use_colour_temperature
      - use_transition
    light_brightness: 25
    light_transition_off: 10
    ambient_light_value: 5
    include_ambient: ambient_enabled
    light_transition_on: 0
    light_colour_temperature: 7600
    include_dynamic_lighting: disable_dynamic_lighting
    motion_bypass_lights_on: []
    ambient_light_sensor: sensor.bewegungsmelder_buro_illuminance
    include_bypass: []
    motion_bypass_lights_off: []

Greetings Karl Heinz

Hi Blacky,

The light went straight up to 50% and is staying there - Iā€™m only a little way into the automationā€¦ Again it seems to be ignoring the Transition ON timing.

Regards,

Bobā€¦

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.