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

  1. I quickly did the brightness before but when testing it, if a light didn’t have the ability to adjust the brightness then the light didn’t turn ON. If all the light can be adjusted to a brightness then it worked and it set them all to the same brightness.

  2. no problem

  3. If you have a condition just before the action then it will never turn the light OFF. Maybe give us a example of the condition you are thinking of.

It is not a special condition, just a check if the light is on or off. It should not impact the OFF function or anything else. So just before sending the off comand, check the state of the light. If it’s off already then do nothing, if it’s on call service turn_off.

Why do you think it will never turn off? I could be missing something obvious :innocent:

Thanks for your response and advices, totally understood. I’m going to take a look into it.

1 Like

Scenes are used by 99.6% of the active installations. With scenes you can change the brightness, colour and effect of each individual light. It is maintained by HA, so it is a really good way of doing it. If you would like to change the brightness according to the time of day / sun position then Adaptive Lightning is really not that complicated. I have also explained the simple slider for brightness, hope this make sense and is why scenes just work and it is simple.

If we check if the light is ON before we turn it OFF knowing that we just turned it ON is not going to reduce traffic it will increase traffic and code. If we put a condition in before we turn it ON say “if OFF then turn ON” to reduce traffic then the first motion detected will turn the light ON but because the automation is a “restart” then if motion is detected again it should stop and not turn the light OFF.

The “ON / OFF every time it is triggered” looks to be your motion sensor not the automation. This is why I suggested a group or your inbuilt motion sensor delay. When a trigger is received it will only send a ON, wait until motion is not detected then the time delay has to pass and then turn light OFF. If you stop it with a condition then it will never send a OFF and the light will stay ON.

Hope this helps and makes sense.

Thank you for the patience and very detailed info :smiley: Things are clearer now. But i still do not like scenes :rofl:

Hi Blacky,

great Blueprint you created - thx for sharing.
As i found your blueprint i thought all my wishes comes true …but :wink:

There is a little issue in the end for me.
My problem is, that the motion sensor is the same as the brightness sensor.
So after the first trigger ( Motion on, brightness under 20 ) light goes on.
I move in front of the motion sensor and he should retrigger the automation as long as i´m in the room.
But that do not happen , because the condition “brightness under 20” is no more true because the light is on :frowning: . So the automation waits definded time (120s) and the light switch off -
Is there a way to check the automation is trigger the second time and so the condition “brightness under 20” will switch off or a simlilar logic ??

I hope you understand my issue …
Greetings,
Andreas.

I have many motion sensors with integrated LUX, so i know what you mean :smiley: The only solution i found for this was to tweak the LUX value, so those 20 in your case to a number which is higher then when the light is on.

I thought on something like check the retrigger index (starting with 0, if the automtions starts the first time after switch off) in the conditions togther with the brightness check.
→ condition sample: "… if the brightness is under 20 or the retrigger counter is not 0 … "
Don´t know how to implement this in detail, but i will go reading and check if this could be a way to solve this…

Hi @EsserA

Is it possible to use the sun condition rather than the LUX?

This can be done just trying to understand the use case and if other people would like it too. This way if I add it to the blueprint we get it right.

1 Like

Hi Blacky
This is amazing!! It worked to solve my biggest marriage conflict so thank you for that :laughing: . I didn’t create the helper switch and it just works fine without but bypass only works when I turn on the light manually on home assistant but it doesn’t work when I use the physical switch thats on my wall. Is there anyway around it?
I’m thinking it may work if I put a few seconds delay: when the lights turn off then motion is detected again wait a few seconds before turning on the light again and before the motion sensor triggers the light I will use the physical switch to turn the light on, I have no clue of why I think it may work.

Cheers :beer:

1 Like

love it :+1:

If you have a physical by-pass it must have a “ON” & a “OFF” state (not ON/OFF). It should work perfectly if you manually turn a light ON or OFF from either HA or the physical switch on the wall.

So if the by-pass is in the “ON” state you should be able to turn the light/s ON & OFF manually with a physical switch on the wall or in HA and they should stay ON or OFF depending on what you have selected (No delay time OFF). When you turn the by-pass OFF you will then have to manually turn OFF the lights unless all the options are true, and the trigger is triggered… it will then start the automation and turn OFF the lights.

I tested it again here and it worked. If you can check yours again and let me know it would be appreciated. :slightly_smiling_face:

Delays and that kind of stuff can break the blueprint. I would like the blueprint to just work an you shouldn’t have to do anything. Plug and play. If you would be so kind and check again and let us know.

New update 2.0

Added a option for the Ambient Light Sensor.

In some cases when your lights turn ON your ambient light sensor is affected increasing its LUX value. This can cause the lights to go OFF prematurely. You now have the option to set the “Ambient Light Sensor - Site Conditions”.

  • YES - My Ambient Light Sensor is affected by the Lights
  • NO - My Ambient Light Sensor is not affected by the Lights

Enjoy

Blacky :grinning:

1 Like

@Momo @EsserA

Please upgrade to V2.0 and select the “YES” in “Ambient Light Sensor - Site Conditions”. This should resolve your automations.

Enjoy

Blacky :grinning:

I was drunk when i was doing this​:joy::joy:. Now i have to drink again to get into the mode​:rofl:. My physical switch is a toggle if thats the correct way to name it? I can easily remove the spring behind the button then i have a on and off but then i will lose the possibility of dimming which is used very frequently. But how about using a cheap smart switch behind a wall switch ( a different wall switch) and then make the new smart switch as a trigger to the lights without dimming option and also use it as the by pass switch. Or does it have to be physically connected to the lights?
In other words the new smart switch will be used in an automation to trigger the lights on and off😊. I hope this makes sense and not just a hungover brain😵‍💫😵‍💫

Is there a way to deactivate the motion detector when a computer is turned off?

Thanks in advance

First go into developer tools / states / select the entity you are using. Then look at the state see if it goes ON and OFF when you toggle it.

If you use the same switch for the light and the by-pass it will only work when the light is ON (switch is ON) and you must manually turn it on before the automation does. So if your switch is connected to the lights and you have it selected in the by-pass and you manually turn on the light with the switch the light will remain ON until you turn the light OFF. The by-pass will not work if you would like to keep the lights OFF. This is why it says next to the by-pass selection that the switch must not be included in the lights selection.

So if you would like a by-pass for ON and OFF you will have to have a separate independent switch for your by-pass or you can create a helper in HA and you will have to use the HA to turn the by-pass ON and OFF.

If you would like to have a by-pass that will only ever keep the light ON then you can use the same switch in the by-pass selection, but remember you must turn the light ON before the automation turns the lights on, or you will have to turn the light OFF manually and then turn the light back ON manually.

Yes you can but you will have to do a few things.

First in order for HA to know your computer is ON or OFF. The best way I have found is to have a smart plug that will measure your power in watts. Then plug your computer into the smart plug. Add the smart plug to HA devices.

Then you will have to create a switch that has a ON and OFF state when your computer turns ON and OFF. To do this you will need to add this into your “configuration.yaml” file

binary_sensor:
  - platform: template
    sensors:
      computer:
        friendly_name: "my computer"
        device_class: power
        icon_template: mdi:laptop
        value_template: >-
          {% if states('sensor.your_computer_power_sensor_here')|float < 85 %}
            on
          {% else %}
            off
          {% endif %}

Now you will need to add this binary sensor into the by-pass selection.

So now when your computer is OFF the binary sensor will be ON and thus the by-pass will be ON deactivating the motion sensor. When you turn your computer ON the by-pass will be OFF and the motion will be active.

Some Notes:
This part in the code; ‘sensor.your_computer_power_sensor_here’ you will need to change to suit your power (smart plug watts) entity ID. They normally read watts so the “85” will need to be adjusted to your computer watts. Example if your computer watts when ON reads 100W and OFF reads 5W then 85 will be ok. But just adjust that works best for you.

1 Like

Hi,

great news! I will test the new version soon .
THX a lot :slight_smile: !!

Hey

so the Helper works flawlessly. I was wondering if one could use on of those ikea Zigbee buttons like the coffee maker button. Seeing that the helper works I thought the Ikea button could work😀.

I really thank you for the time you put into our comments😀

As long as the button has a ON & a OFF state for the by-pass it will work.

No problem at all, happy to help. :slightly_smiling_face: