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

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:

No problem at all, let us know how you go. :slightly_smiling_face:

I tested version 2.0 with the Lux option set to “YES”, but I have the feeling that it didn’t bring any improvement.

@fakorte Can you please confirm if you are just using only scenes? (no individual light selection) If so I will do a FAQ for this on how to resolve it.

@fakorte I will do a FAQ for the LUX option. This will also help if someone is having a similar problem. It will be my next post.

FAQ - Ambient Light Sensor & Site Conditions

If you’ve only selected scenes or script in the Lights - Switches - Scenes - Scripts or Night Lights sections, please continue reading. If you’ve chosen an entity in these sections, the automation should work as expected.

Sometimes, when setting the Ambient Light Sensor - Site Conditions to YES, the lights may not stay on, giving the impression that this option isn’t functioning. This issue often occurs when no entity has been selected in the “Lights - Switches - Scenes” or “Night Lights” sections.

To resolve this, ensure you add a toggle helper to the Scenes & Scripts - Toggle Helper section. This will help ensure the smooth operation of the automation.

Below is where you should add the toggle helper to ensure smooth operation of the automation:

Now, your selection of YES in the Ambient Light Sensor - Site Conditions should work and function correctly. :wink:

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

Back to “The Settings & Best Practice Guidelines” Click Here

1 Like

Thank you very much, that looks very helpful I will test it soon. I really only had scenes in my automation

No problem, your welcome :slightly_smiling_face:

Hi, great blueprint thanks!

Is it possible to adapt this for check to see if known people are at home?

I have pets and they’re forever triggering these types of things, so I need a way to stop this from running if no-one is at home. I have the zone.home to check against as well as a person group.

I tried it with a scene and a single device (that is also in the scene) and it still doesn’t work
 :triumph:

alias: Sensor light Kueche Nacht
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.zb_ms_kueche_occupancy
    light_switch:
      entity_id:
        - scene.szene_sensor_light_kueche_nacht
      device_id: 648d94f5811833b627d23b8da05897a5
    end_scenes:
      - scene.szene_sensor_light_kueche_aus
    time_delay: 2
    ambient_light_sensor: sensor.zb_ms_kueche_illuminance_lux
    ambient_light_value: 4
    motion_bypass: input_boolean.dauerlicht_kuche
    include_bypass: bypass_enabled
    include_ambient: ambient_enabled
    after_time: "21:00:00"
    before_time: "06:00:00"
    include_time: time_enabled
    ambient_light_options: ambient_light_option_enabled

@fakorte So close :slightly_smiling_face: It can’t be a device. It must be a entity with a ON / OFF state. This is what we are looking for. Drill into the device and just add the entity your turning ON and OFF or just select a separate light or switch.

@romprod I will PM you.