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

Hey Blacky,

Thank you very much for your new update. I haven’t been in the HA world and your Blueprint for very long, but I am really very happy.

Maybe you or the community can help me with a thought that I can’t quite get through my head. As already mentioned, I am using your Blueprint, which works just fine. But now I also like to use Siri and tell it to set the light to 100% in the kitchen, for example, because I’m cooking and need more light than usual (65%) via the motion sensor. But now it is the case that the set brightness is reset to 65% by the motion sensor. I have no idea how I could implement this.

Can anyone follow me and is there perhaps already an idea for this?

Thank you very much
Seger

Hi @Seger85

Your welcome, glad you like it.

Now with the new update V2.8 and the new by-pass options it will work with the voice (Siri). We need to think of the voice as if we were to do it manually but we are just using our voice.

So what we will need to do is set up the by-pass so you can have manual control of your lights. In the FAQ it will walk you through the steps on “How to use the “Trigger Sensor By-pass” without having a physical switch”. In the FAQ we used “Sensor Light By-pass” as the name but you will need to think of a name that suits you better, maybe “Kitchen Lights By-pass”. Then you will need to enable the by-pass and select “Enable the By-pass - If lights are ON, leave lights ON”. Also maybe have the “By-pass Time Delay” set to the minutes that suits you.

So now when you ask Siri set the light to 100% in the kitchen you would say something like this.

“hey Siri, could you turn on the kitchen light by-pass and set the kitchen lights to 100%”.

or you could try this

“hey Siri, could you turn on the kitchen light by-pass for 1 hour and set the kitchen lights to 100%”.

If the 1 hour doesn’t work with Siri then you could try my Entity - Run ON Timer blueprint. Or you could just remember to ask Siri to turn off the kitchen light by-pass when you are done.

Hope this works, let us know how you go.

Disclaimer I don’t use voice commands yet.

Blacky :smiley:

1 Like

Hey @Blacky,

Thanks again! I figured it was something to do with the bypass option. I will definitely have a look at it. In your description you mentioned separate bypass names, which I don’t think is quite optimal in the wake of the language glitch. I fiddled around a bit last night and something has come up, but there’s still one point where I’m stuck. If necessary, you can also integrate the thoughts into the Blueprint. So what have I done and what is the initial situation?

I currently have 3 different Blueprints (hallway, kitchen & bedroom “living room to come later”). Each room has max. 65% light intensity set via your Blueprint.

Attached is an example for viewing (this makes it easier):

alias: licht_kuche_automation
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bewegungsmelder_kuche_1_0_occupancy
    time_delay: 6.5
    include_light_control: use_brightness
    light_brightness: 65
    include_bypass: bypass_disabled
    include_time: time_disabled
    after_time: "00:00:00"
    before_time: "00:00:00"
    include_night_lights: night_lights_enabled
    night_time_delay: 1.5
    include_night_light_control: use_night_brightness
    night_lights_after_time: "01:35:00"
    night_lights_before_time: "07:00:00"
    end_scenes: []
    night_light_brightness: 7
    night_lights:
      device_id:
        - 48feb7e201d1d2ee7b6158b4f277ea74
    include_ambient: ambient_enabled
    ambient_light_options: ambient_light_option_enabled
    ambient_light_value: 60
    ambient_light_sensor: sensor.bewegungsmelder_kuche_1_0_illuminance
    light_switch:
      device_id:
        - 48feb7e201d1d2ee7b6158b4f277ea74

Then I created an additional automation per room (which is called Light 100% - which is not quite right). Attached is the automation:

alias: licht_kuche_100_prozent_automation
description: ""
trigger:
  - platform: numeric_state
    entity_id: light.signify_netherlands_b_v_lwb010_huelight_2
    attribute: brightness
    above: 169.8
condition: []
action:
  - service: automation.turn_off
    data:
      stop_actions: false
    target:
      entity_id: automation.licht_kuche
  - service: script.xx_minuten_licht_automationen_wieder_einschalten
    data: {}
mode: single

As you can see from the automation, the automation switches off your main automation/blueprint as soon as the light goes above 65% and starts a script that specifies the minutes how long the automation should be off. After the time has elapsed, your Blueprint automation is switched on again. The advantage of this procedure is that I don’t have to say a separate name, I just have to set Brighter or Light to xx% percent. Furthermore, after the time has elapsed, your Blueprint is activated again and it automatically returns to the set value from your Blueprint when movement occurs.

Unfortunately, there is still a catch in my script that I can’t get past. If I am no longer in the room after manually increasing the brightness, your blueprint naturally lacks movement and the light remains on. I would like to set it so that if no movement is detected after XX minutes, the light goes out. I have already reached the point where your Blueprint is reactivated after the time lapse and the standard brightness is selected, but it continues to light up.

script

alias: xx Minuten Licht Automationen wieder einschalten
sequence:
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
    alias: "Delay for xx minutes <65% light "
  - service: automation.turn_on
    data: {}
    target:
      entity_id:
        - automation.licht_flur_automation
        - automation.licht_kuche
        - automation.sz
  - choose:
      - conditions:
          - type: is_no_motion
            condition: device
            device_id: b561c53667f7e18f61e01b5ff0d4e8ed
            entity_id: binary_sensor.philips_sml001_motion_2
            domain: binary_sensor
          - condition: and
            conditions:
              - type: is_no_motion
                condition: device
                device_id: f29fd1904e863c533a1d9a69fac9e0d1
                entity_id: binary_sensor.philips_sml001_motion
                domain: binary_sensor
        sequence:
          - service: automation.trigger
            data:
              skip_condition: true
            target:
              entity_id: automation.licht_flur_automation
          - delay:
              hours: 0
              minutes: 0
              seconds: 15
              milliseconds: 0
            enabled: false
          - service: light.turn_off
            data: {}
            target:
              entity_id: light.flur_licht_gruppe
    enabled: true
mode: single

Maybe you can do something with the thoughts and maybe you also want to help me with the completion.

Thanks and best regards
Seger

Hi @Seger85

You will find that the blueprint will do what you are asking for if I am understanding you correctly by just using the by-pass. I personally wouldn’t enable or disable an automation to make it do what I would like.

If you don’t want to say

“hey Siri, could you turn on the kitchen light by-pass and set the kitchen lights to 100%”.

and just say

“hey Siri, kitchen lights to 100%”.

and then HA will run a set of actions, then I would look more into this. Fast forward to the 22:00 minute mark. It is mind blowing

The HA team are at the next level and they are doing a fantastic job with the voice.

Hope this helps you

Blacky :smiley:

I believe that the bypass achieves almost exactly what I want, only I am missing, I think, a crucial point, and that is a time-defined period where the bypass is activated. I don’t want to say anything, but I want it to go back to normal mode automatically, so that the light also switches off at some point without saying anything. Your suggestions are worth their weight in gold though, look at it again, does a timed sequence make sense from your point of view and can integrate it if necessary without me having to mention it separately (globally per Blueprint, so to speak).

Many thanks
Seger

You could try my Entity - Run ON Timer blueprint. It will turn off the by-pass in a set time period and the automation will work how you would like it to work.

Thank you very much for the great tips and the time to explain things to me. I will dedicate myself to this topic again. Maybe one other thing gferagt, before I devote myself to the other topics. I have noticed some warnings in the log, do I see it correctly that they are only warnings / information and not an actual error, because some optional things were not selected, or is it possibly an incorrect setting on my part?

To investigate, please show me the log and the automation that triggers the warning:

Logger: homeassistant.components.automation
Source: components/automation/__init__.py:517
Integration: Automatisierung (documentation, issues)
First occurred: 09:49:07 (27 occurrences)
Last logged: 11:55:26

Error evaluating condition in 'licht_kuche_automation': In 'condition' (item 4 of 6): In 'or' (item 4 of 5): In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id' In 'or' (item 5 of 5): In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'
alias: licht_kuche_automation
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bewegungsmelder_kuche_1_0_occupancy
    time_delay: 6.5
    include_light_control: use_brightness
    light_brightness: 65
    include_bypass: bypass_disabled
    include_time: time_disabled
    after_time: "00:00:00"
    before_time: "00:00:00"
    include_night_lights: night_lights_enabled
    night_time_delay: 1.5
    include_night_light_control: use_night_brightness
    night_lights_after_time: "01:35:00"
    night_lights_before_time: "07:00:00"
    end_scenes: []
    night_light_brightness: 7
    night_lights:
      device_id:
        - 48feb7e201d1d2ee7b6158b4f277ea74
    include_ambient: ambient_enabled
    ambient_light_options: ambient_light_option_enabled
    ambient_light_value: 60
    ambient_light_sensor: sensor.bewegungsmelder_kuche_1_0_illuminance
    light_switch:
      device_id:
        - 48feb7e201d1d2ee7b6158b4f277ea74

I would be happy if you could give me a short hint about this.

Thank you
Seger

Your welcome, I have also added your request above to a list of possible future additions.

It could be that you had something wrong in the past. Clear the log and if you restart and there is no error then you should be all good. If you have a error then try delete the automation, not the blueprint and add it back in.

Blacky :smiley:

not sure if you meant me with your last’n message. I updated the blueprint and copied the yaml code and created a new automation. Same error. I also see that it is probably related to the Philips Lux Sensor.


@Seger85 I just tested V2.8 here and it works.

Check your entity to see if it has a “entity_id”

settings / devices & services / entities

You can also check if that entity is reporting a lux value by adding it to a dashboard.

Edit:

it is looking at your

    light_switch:
      device_id:
        - 48feb7e201d1d2ee7b6158b4f277ea74

and looking for a ON state.

what is

        - 48feb7e201d1d2ee7b6158b4f277ea74

Is it a light, or a scene?

If it is a scene see our FAQ

Q: I have set the “Ambient Light Sensor - Site Conditions” to “YES” and the lights keep turning OFF. I have only selected scenes in the “Lights - Switches - Scenes”. Am I doing something wrong?

A Please follow these steps Click Here

Hey :wink:

Perhaps first of all, the Blueprint works as it should and I do not detect any errors, only this note in the log. I only use sensors in the Blueprint and no scenes. The specified device is a motion sensor from Phillips, which also provides a lux value under the Entities tab, as can be seen in the picture, currently a value of 6 lux. The entity ID is: sensor.bewegungsmelder_kuche_1_0_illuminance can’t find the number anywhere, except in the Blueprint’s Yaml.

Does this help, or am I on the wrong track?

Thanks

Edit: I think I got it, your question about the number was exactly right, it was the light and not the motion sensor which also sends Lux and was correctly present in the Blueprint.

Namely I added the one sensor obviously as a device and then the number is taken and not the entity name, when I clicked on the <> sign it is also made an entity in the blueprint and the number is changed by the entity ID in the blueprint (yaml).

Anbei ein wenig bildlich:

Ich glaube das war es … :slight_smile: Thank you!!!

1 Like

New to Home Assistant, coming from almost 20 years with ISY (Universal Devices)
This blueprint is amazing, the manyprograms I have in place to do a fraction of what your does, is why
I’m looking to move over to HA.
Please forgive my ignorance, but I’m not understanding the elevation and sun. Do you have to have to sun option on to use the elevation? Is the sun elevation a logic gate that has to be true for the automation to work? I might be trying to fit a square peg into a round hole on this, because after years of working with ISY their solution to automation is state logic.

I think this is a simple solution
I have led strips in the bathroom, and during the day the motion should trigger 100% brightness on for 30 seconds unless there is motion, then stay on, and after sunset, motion should trigger 17% brightness on for 10 seconds unless there is motion. (I see the nighttime lights option, but it’s elevation of the sun dependent not time of day.)
I was thinking I might need to have one blueprint for the daytime, and one for the nighttime but I’m not sure how to have that based on elevation using the blueprint.

Thank you for your time that you have spent on this blueprint. :+1:
-Todd

@toddhutch

Hi Todd, firstly welcome to the community :+1:

Thank you for your kind words.

Yes the sun elevation is global. If you use the sun it will be for normal lights and night lights. If the sun is not below your elevation setting the automation will not run. More information on sun can be found in our FAQ.

Currently the blueprint will not work this way… but I do really like your idea and suggestion. I will be adding this to the future options to come. Yes the elevation is global :pensive:

Currently you could just use one automation but it would be time based for night lights time and not sun. You don’t need to use the sun as it is an option. You will just have to pick a time of the day that it will change from 100% to 17% and set the night time to do this, but keep an eye out as your suggestion may be added. I know it really doesn’t help you currently, sorry.

Blacky :smiley:

1 Like

Hello,
i want to use Night Lights - Brightness.
i turn it on and set it so 25%.
But it dont work. What make i wrong?

THX

Hi Sir,

Very GOOD and nice BluePrint.

Only one remark/question, is it possible to add seconds/minutes to the delay to turn off the lights?

Thank you and once again thanks for you work.

Kind regards

Thank you. This is exactly what I was looking for.

1 Like

Hi @Blacky
Just want to say thx for the amazing work and blueprint :smiley:
+1 for the transition time feature. Would be amazing if you could add a smooth turn on/off sequence.
And a trigger value to override the night mode would be great too. The time based setting is great but sometimes plans are changing and a party is going on :wink: so would be great to temporarily disable the night mode as long as the party is on.
Thanks again for your great work

Hi @lucascoco

I will have a look at it for you. Could you provide us your YAML of your automation.

Go into your automation and 3 dots at the top click on it and selece “Edit in YAML”. Copy the code. When you post it into this forum use the “</>” and paste it in there.

Hi @Fazenda

Glad you like the blueprint :+1:

This can be done with a bit of maths if you like. Here is a example for you.

Say you would like 5min and 12 seconds.

First we need to work out the seconds, so

60 div 12 = 5

then we need to convert it because 1 = 60 seconds, so

1 div 5 = 0.2

Now we need to type the value into delay time of 5.2

It will now do the seconds for you. Remember it will not be 100 % accurate due to other factors but it will be close.

Hope this helps you.

Blacky