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

Hi there.
Firstly, thanks for the blueprint :slight_smile:
Then, I have 2 questions pleaseā€¦

  1. Is there a way to separate the temperature and brightness? For example, I want the lights to fade to a warmer temperature in the early evening, but I only want the brightness to fade much later. Option 6 to do both keeps them on the same schedule as far as I can tell.
  2. Is there a way to have them maintain a state until only triggering on from off again? By that I mean not to change everytime there is motion but only if they were turned on from an off state. So, I may change the brightness via another means (e.g. asking google or alexa) and it stays that way until they turn off from no motion. At the moment, it resets every time it picks up motion whether they are on or off so I have to constantly change brightness the whole time. I know I can set a bypass, but that seems a very complicated means just to maintain a state until off (or maybe I just donā€™t know a better way of doing it).
    Thanks
    Alan

@HopsPopsAl

Hi Alan,

  1. The only way to do this it to set up 2 automations. You could use time or sun elevation condition to change when the automation can run.

  2. It will look at what happening every heartbeat and trigger.There is no option to know if you changed the setting manually it just keep checking. I put it on the list to investigate.

Blacky :smiley:

1 Like

Thanks for the quick reply.
I think Iā€™ve managed to get around my first issue with nightlights. I just control temperature with dynamic lighting and then have the lower light through nightlights. Not as gradual but Iā€™m fine with it.

Is it possible to invert the state for the bypass? I have a helper to say whether ALL automations should be disabled. Basically a toggle with on being that automations should run and off being they are disabled. However, for the bypass to work, it seems I need to have that helper in the on state which is the other way round I have it set up with my other automations.
Thanks

Hi
I have some problems with Dynamic Lighting.
1, it seems that it totally kills switches that are not on dimmers. Like a light switch wont turn on unless the desired brightness is 100%. My problem here is that in most rooms, I have LED strips and undimmable lights. Iā€™d like to have both controlled, if possible by the same automation. Idally, I want separate settings for each light (or each light group), so for example dim the LED strip between 10-60% (they are very bright), and if the desired setting is over 40, turn the ceiling light on.

2, the times seem way off. I have set 1 minute run times, and I have Fibaro motion sensors. As you can see in this Trace, the light ran for 2 minutes, and somehow its still onā€¦

3, I have a hard time troubleshooting the dynamic lights. Is there a point in the trace or anything else where I can see what the desired settings are? Like it should be 4500K and 75%?
Speaking of which, how do you translate Kelvin to RGBW? is there a matrix?

Thanks

All right, there is something I am messing up here.
The night lights sorta worked as expected in my foyer. When the sleep helper was on, the lights came up when motion detected for the night settings (low intensity red), and when the sleep option was off, they came on with motion at high intensity white.

I tried to copy it in my closet, where there are 3 small lights, one of them an RGBW light strip. I want them to come up, the latter on blue, on daylight. When the bedroom is in sleep mode, the sleep helper should switch this in a way that only the RGBW comes on (since its the only one dimmable) to a low intensity red, at motion detected (!).

what happens is, with the motion sensor off, as soon as I activate sleep, the red light comes on. As soon as I deactivate the sleep helper, all the lights come on, even without motion in both cases, and the RGBW stays red.

I could somewhat understand the ā€˜night lightā€™ coming up without motion, but I want it to be with motion, and somehow I got it in the other room. But why does it trigger when the night state comes off?

Iā€™ve noticed this blueprint seems to turn off all the lights at the scheduled end time, even if there is still motion. If lights are on at the end time, Iā€™d prefer to keep them on and rely on manually turning the lights off. Is there any way to configure the blueprint for this behavior? Thanks!

okay, so I figured if I set ā€˜night_lights_entity_stateā€™ to the motion sensor instead of the sleep helper, and set ā€˜night_boolean_scenes_scriptsā€™ to the sleep helper, then the day light works okay, and the night light only comes up when motion is detected.

However, the sleep helper is turned ON every time when the automation runs. I dont get why this happens, and cannot really figure out how.

@HopsPopsAl

Hi Alan.

Yes you just create a template binary sensor that looks at other toggle so when it is OFF the helper will be ON. Follow the steps below.

To create a Template binary sensor, follow these steps:

  1. Navigate to Settings > Device & Services > Helpers tab at the top.
  2. Click the Create helper button.
  3. Select Template and then choose Template a binary sensor.

Next, provide a Name and Device class of your choice. If applicable, you can link this template to an existing device so it appears under that deviceā€™s details.

In the State template field, add the code below, replacing binary_sensor.your_toggle_helper_here with your entity ID.

{{ is_state('binary_sensor.your_toggle_helper_here', 'off') }}

Once created then add it to the bypass option you like.

Blacky :smiley:

@rbhun

Post 1

  1. Canā€™t do it you need to have multiple automations.

  2. Once the motion is cleared then your time delay is applied.

  3. The sensor works. In your trace you can see what is applied to the lights. The data is sent as kelvin, some lights can translate it.

Post 2

Looks like it is working.

Motion is ON I can see it in your trace.

Post 3

Not sure why you are doing this and not really sure what you are doing.

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.

Then just explain what you would like to happen.

Blacky :smiley:

@davenaum

Yes this is correct as it is what you are asking the automation to do. Turn light ON and OFF as per the scheduled time. Once the lights turn OFF then you can manually turn them ON again.

You can write a script for the Scenes - Scripts To Turn OFF input that checks if the light was on half a second ago. If it was, the script should turn the light back on. The brief delay (half a second or even a millisecond) is necessary because lights and switches are turned off slightly before scenes and scripts in the automation process.

It makes no sense to me as the lights will always be ON. Maybe you are after the light to be turned ON at X time and then manually turn it OFF always. If so look at my :high_brightness: Smart Light - Entity - Sun Elevation - Ambient & Time Triggers blueprint and just use the ON time. Then you have to manually turn it OFF every nightā€¦ maybe that is what you are after :thinking:

Blacky :smiley:

Sorry in advance if this has already been asked/answered (I didnā€™t see it when I searched)ā€¦ Is there a way I can set separate trigger entities for ā€œonā€ and ā€œoffā€? Hereā€™s the scenario Iā€™m thinking:
-Light turns ā€œonā€ if either of two binary sensor entities (one PIR and another mmwave) turn on. Iā€™ve already created a combined entity.
-Light turns ā€œoffā€ only if the mmwave sensor changes from ā€œonā€ (occupancy - detected) to ā€œoffā€ (occupancy - clear).

Thanks!

JCG

Hy @Blacky thank yu for your answer.

This is my closet lights

What I want:
1,use it as a motion light with a motion sensor
2, when we are awake (sleep=off), turn on 3 lights (one RGBW led, one ceiling light, and a power plug that has some ikea furniture lights plugged in. Th eRGBW lights come up in a cool blue
(-ideally Iā€™d love some dynamic lighting, but thats later)
3, when I turn sleep=on, nothing happens to the lights themselves
4, when motion is detected while sleep=on, only the RGBW light come up red.

right now, I either have a night light all the time when sleep=on, or I have a motion detected light which is always red.

alias: gardrob konnektor led
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.gardob_mozgas_motion_detection
    light_switch:
      entity_id:
        - switch.gardrob_led_konnektor
        - light.g_v
        - light.gardrob_lampa
    time_delay: 1
    include_dynamic_lighting: disable_dynamic_lighting
    dynamic_lighting_lux_sensor: sensor.gardob_mozgas_illuminance
    dynamic_lighting_min_lux: 30
    dynamic_lighting_max_lux: 200
    dynamic_lighting_min_brightness: 15
    dynamic_lighting_max_brightness: 100
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - entity_state_enabled
    night_boolean_scenes_scripts: input_boolean.halo_i_sleep
    night_lights_entity_state:
      - input_boolean.halo_i_sleep
    include_night_light_control:
      - use_brightness
    night_lights:
      entity_id: light.g_v
    include_light_control:
      - use_brightness
    include_light_colour_control: use_rgb_colour
    light_rgb_colour:
      - 0
      - 97
      - 255
    night_time_delay: 1
    include_night_light_colour_control: use_rgbw_colour
    night_light_rgbw_colour:
      - 255
      - 0
      - 0
      - 0

@jayceegee

Welcome to the community.

Normally you would set up a group helper and add your PIR and your mmwave into the group. This is the link on how to do that click here. This will turn On when ether are ON and turn OFF when both are OFF. It should work well this way.

If you would like to do it your way you would have to set up a trigger template binary sensor. You mmwave as one trigger and it to be any state and your PIR to be another trigger with only ON state. If you would like this and unsure just provide your entity ID for your PIR and your mmwave and I can guide you but you will need to set this up in your config file.

I would recomend your try the group helper first and if you are unhappy with that and you are unsure how to do the trigger template binary sensor just let us know.

Blacky :smiley:

1 Like

@rbhun

I removed the input_boolean.halo_i_sleep from Night Lights - Scenes & Scripts - Toggle Helper. This only if you are using a scene or script in night lights and you also used the same entity for night lights state condition.

night_boolean_scenes_scripts: input_boolean.halo_i_sleep

Try the below YAML and see how you go.

alias: gardrob konnektor led
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.gardob_mozgas_motion_detection
    light_switch:
      entity_id:
        - switch.gardrob_led_konnektor
        - light.g_v
        - light.gardrob_lampa
    time_delay: 1
    include_dynamic_lighting: disable_dynamic_lighting
    dynamic_lighting_lux_sensor: sensor.gardob_mozgas_illuminance
    dynamic_lighting_min_lux: 30
    dynamic_lighting_max_lux: 200
    dynamic_lighting_min_brightness: 15
    dynamic_lighting_max_brightness: 100
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - entity_state_enabled
    night_lights_entity_state:
      - input_boolean.halo_i_sleep
    include_night_light_control:
      - use_brightness
    night_lights:
      entity_id: light.g_v
    include_light_control:
      - use_brightness
    include_light_colour_control: use_rgb_colour
    light_rgb_colour:
      - 0
      - 97
      - 255
    night_time_delay: 1
    include_night_light_colour_control: use_rgbw_colour
    night_light_rgbw_colour:
      - 255
      - 0
      - 0
      - 0

Blacky :smiley:

I have Everything Presence One. The Sensor Occupancy goes from Detected to Clear. It does not use On and Off. Is there best way to make it work with this blueprint?

Thanks for the warm welcome and quick reply, @Blacky!

I didnā€™t realize that the automation was already configured such that it was an ā€œORā€ function for on and an ā€œANDā€ function for off. Thatā€™s great! Iā€™ll give it a try and see how well it performs.

I think the only concern I have is that the PIR sensor Iā€™m using is an Aqara P2 that tries to moonlight as an occupancy sensor, and has a 1-minute cooldown after it detects ā€œpresenceā€ (though itā€™s really just motion). I was hoping for something a bit shorter than that, but Iā€™ll keep things simple to start.

Cheers,

JCG

thank you very much. That did it.
If I may say the description on these two items could be a little longer, I had trouble understanding it.
Thanks
Balazs

1 Like

Dear All,

Thanks for the author for this blueprint, very helpful.

Is it somehow possible to restore light state after the automation turns off the lights?

@skynetAI

Hi Rob, welcome to the community.

Nice oneā€¦ I donā€™t have one (It would be nice to have one).

It is a bit tricky to get your head around it at the start but all binary sensors have an ON / OFF state. They may display it as Detected (ON) and Clear (OFF) but it will all work the same.

Below is a image from the HA website that shows you what binary sensors will display in HA when they are ON and OFF. This is the link directly to HA website if you would like more information on binary sensors. You can use these sensors in your trigger. In the Presence One you will have a PIR sensor and a mmwave sensor. The best way to get the most out of this device is to group these 2 sensors and add the group into the trigger. Click Here on how to group sensors.

Hope this is what you are looking for and it helps you.

Blacky :smiley:

@jayceegee

This is all done by HA in the group sensor and they developed it for these types of situations.

Yeah, you will have to adjust the time delay in the BP to suit your needs and your sensor. Example if you have a cool down of 1 min, and your time delay would normally be set on 3 min then you may consider using 2 min in your time delay to cater for your cool down. It is something that only you will know what suits you best. The BP gives you full control.

Blacky :smiley: