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

Congrats @Blacky, this must be one of the best blueprints here. Great work. Really appreciated.

But I have a small problem I hope you can help me with. My lights are controlled by a motion sensor with integrated lux sensor. With your automation, I have properly set them up to be switched on when a motion is detected, but only below a certain lux value.

The problem is, that as soon as the lamp is switched on, the lux value goes up. When I leave the room, after one minute, the lights go off. So far, so good. But when I re-enter the room less than one minute after the lights went off, the lights don’t go back on. Here’s why: the lux sensor has not yet updated the lower lux value, as it only sends the new lux value every 60 seconds, if there is no motion detected.

So what I need is kind of a grace period, in which the lux value is ignored, so the light always switches back on, when there is a motion detected. Is this possible? I think it could be done with a timer, which is set every time the light is switched off by your automation, and the running timer is a bypass for the check if the lux value is low enough to switch on the light.

I have seen this in another blueprint in this forum, but the blueprint was otherwise far from being as great as yours is.

Best regards,
Eb

Hi @Eber, just an idea: can’t you adjust the refresh time in de lux/motion sensor? most of the sensors have an option for that.

Another option is of course to is the lengthen the time the lights stay on
 at least a bit longer that the refresh time of the sensor.

regards,
jn

Unfortunately that doesn’t work. The 60 seconds are already the smallest value for the refresh.

And keeping on the lights for a longer time doesn’t help as the lux value stays high as long as the lights are on.

hmm, and you did set the option in the blueprint: ‘YES - My Ambient Light Sensor is affected by the Lights’ ?

if so, then i’m out of options


hello, replying to myself:

I made a input.boolean for dimmed mode and setup it as bypass in the blueprint.

Then I wrote this automation:

alias: "## Set Ambiance Rez"
description: ""
trigger:
  - platform: state
    entity_id:
      - input_select.ambiance_rez
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_select.ambiance_rez
            state: Normale
        sequence:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id:
                - input_boolean.mode_rez_auto
                - input_boolean.modes_rez_dimmed
          - service: script.tts_on_sonos_talvish
            data:
              entity_id: media_player.living_room
              message: Ambiance Normale
              volume_level: 0.45
              min_wait: 0.5
          - service: hue.activate_scene
            data: {}
            target:
              entity_id: scene.rez_de_chaussee_normal_rez
          - service: light.turn_on
            data:
              brightness_pct: 5
            target:
              entity_id:
                - light.salon_salon_1948
            enabled: false
          - service: light.turn_off
            data: {}
            target:
              entity_id:
                - light.salon_lampadaire_boule_2149
                - light.salon_lampadaire_bois_2147
          - service: light.turn_on
            data:
              brightness_pct: 100
            target:
              entity_id: light.sam_salle_a_manger_1965
            enabled: false
      - conditions:
          - condition: state
            entity_id: input_select.ambiance_rez
            state: Versailles
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.mode_rez_auto
          - service: script.tts_on_sonos_talvish
            data:
              entity_id: media_player.living_room
              message: Versailles.
              volume_level: 0.45
          - service: hue.activate_scene
            data: {}
            target:
              entity_id: scene.rez_de_chaussee_lumineux_rez
          - service: light.turn_on
            data:
              brightness_pct: 100
            target:
              entity_id:
                - light.salon_salon_1948
                - light.salon_lampadaire_bois_2147
                - light.salon_lampadaire_boule_2149
                - light.sam_salle_a_manger_1965
      - conditions:
          - condition: state
            entity_id: input_select.ambiance_rez
            state: Lecture
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id:
                - input_boolean.modes_rez_dimmed
          - service: script.tts_on_sonos_talvish
            data:
              entity_id: media_player.living_room
              message: Lecture.
              volume_level: 0.45
          - service: hue.activate_scene
            data: {}
            target:
              entity_id:
                - scene.rez_de_chaussee_lecture_rez
          - service: light.turn_on
            data:
              brightness_pct: 100
            target:
              entity_id:
                - light.salon_salon_1948
                - light.salon_lampadaire_bois_2147
                - light.salon_lampadaire_boule_2149
                - light.on_off_plug_1_3
      - conditions:
          - condition: state
            entity_id: input_select.ambiance_rez
            state: Relax
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id:
                - input_boolean.modes_rez_dimmed
          - service: script.tts_on_sonos_talvish
            data:
              entity_id: media_player.living_room
              message: Relax.
              volume_level: 0.45
          - service: hue.activate_scene
            data: {}
            target:
              entity_id:
                - scene.rez_de_chaussee_detente_rez
          - service: light.turn_on
            data:
              brightness_pct: 2
            target:
              entity_id:
                - light.salon_salon_1948
          - service: light.turn_on
            data:
              brightness_pct: 5
            target:
              entity_id:
                - light.salon_lampadaire_bois_2147
                - light.on_off_plug_1_3
          - service: light.turn_off
            data: {}
            target:
              entity_id: light.salon_lampadaire_boule_2149
      - conditions:
          - condition: state
            entity_id: input_select.ambiance_rez
            state: Tamisé
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id:
                - input_boolean.modes_rez_dimmed
          - service: script.tts_on_sonos_talvish
            data:
              entity_id: media_player.living_room
              message: Tamisé.
              volume_level: 0.45
          - service: hue.activate_scene
            data: {}
            target:
              entity_id:
                - scene.rez_de_chaussee_attenue_rez
          - service: light.turn_on
            data:
              brightness_pct: 1
            target:
              entity_id:
                - light.salon_salon_1948
                - light.sam_salle_a_manger_1965
          - service: light.turn_on
            data:
              brightness_pct: 5
            target:
              entity_id:
                - light.salon_lampadaire_bois_2147
                - light.on_off_plug_1_3
          - service: light.turn_off
            data: {}
            target:
              entity_id:
                - light.salon_lampadaire_boule_2149
                - light.lampadaire_sam
      - conditions:
          - condition: state
            entity_id: input_select.ambiance_rez
            state: Cinéma
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id:
                - input_boolean.modes_rez_dimmed
          - service: script.tts_on_sonos_talvish
            data:
              entity_id: media_player.living_room
              message: Cinéma.
              volume_level: 0.45
          - service: hue.activate_scene
            data: {}
            target:
              entity_id:
                - scene.rez_de_chaussee_nightlight_rez
          - service: light.turn_off
            data: {}
            target:
              entity_id:
                - light.salon_salon_1948
                - light.salon_lampadaire_boule_2149
                - light.salon_lampadaire_bois_2147
                - light.on_off_plug_1_3
                - light.lampadaire_sam
                - light.bureau_bureau_49
                - light.hue_lightstrip_plus_1_2
                - light.hue_lightstrip_plus_2_4
                - light.sam_salle_a_manger_1965
mode: single

Normal it the full auto mode
for mode Versailles, it’s in manual mode (input_boolean.mode_rez_auto)
for modes lecture, relax, tamisĂ© and cinĂ©ma, it’s in dimmed mode (input_boolean.modes_rez_dimmed)
I have an s2 push button on one of my zwave fibaro dimmer who cycles trough the modes when I click it.
So no need to reach the phone.
My sonos says the curent mode.
Hope it will helps someone one day :wink:

1 Like

Yes, I did. That doesn’t help either, the setting is only to prevent the automation from shutting of the light because of the higher lux value.

So I’m pretty sure my problem can only be solved with a change of the blueprint.

@Eber

Thanks for your kind words :smiling_face_with_three_hearts:

Just a quick thought. What is your low lux value and what is the lux value when the lights are ON. Is this close or could you live with raising the lux value to be just above the value when the lights are ON. The reason I ask is sometimes when the lights turn ON the lux value only raises a bit but I have no idea of your site.

Blacky :smiley:

Unfortunately it’s about 200 Lux when the lights should switch on and about 2700 Lux when it is actually on :neutral_face:

I have “solved” the problem by creating a sensor using the statistics platform. The newly created sensor contains the lowest value measured by the real illuminance sensor in the past 30 minutes. By referencing the statistics sensor in the automation created with your blueprint, the change of illuminance caused by the lamps switching on doesn’t interfere anymore.

sorry this might be a silly question but what ways are there no to trigger this automation?
For example if I wanted to use this automation for bedroom and I don’t want it to run in the middle of the night when I’m asleep?

@JaccoN

Hi, sorry I missed your post :pensive: If you are still working this out let me know and I will do my best.

We use to link automations but targets are a different beast.

Blacky :smiley:

Okay, I would also contact the manufacture as the 60 sec is not realy that good. Some do a 60 sec but also have a 5% max change. They may have a work around or they may update their firmware (they should
 at least give you the option). If not maybe just dont purchase another one. Anyway looks like your up and running and that is the main thing.

Blacky :smiley:

@xXAzazelXx

You have 2 options.

  1. If your not using night lights then use that and just create a dummy switch and turn that ON / OFF.
  2. You can use the by-pass. More info is in the FAQ for this. There are many options with this that will work.

Blacky :smiley:

Hi @Blacky, yes i would appreciate it if you can look at it. i’m still testing it but i get the same results.
thks

@Blacky I have an entertainment room that has a presense sensor, an Apple TV and Hue lights. I have a custom automation that turns on the lights based on presence to about 75%. But when I turn the Apple TV on they dim to about 10%, and go back to 75% when the ATV turns off. Is there a simple way to do this with your blueprint?

Hey @Blacky ,

Sorry so if i want the automation to run only during the times when sun is down, and if the entity group “Phone Charging” is state false, this this how you would set it up?

Basically only run during the sunset, don’t run automation if the “Phone Charging Sensors” is true?



@JaccoN

Okay, can you describe again what you are trying to do and we will go from there.

Blacky :smiley:

@DuckDuck25

Yes, you use this blueprint for your 75%. Then you use this blueprint :infinity: Sensor Light Add On - Media & Movie Lights - House Alarm Lights - Smoke Alarm Lights & Exhaust Fans + More to do the 10%. It also has intermission + more. This was all tested with Apple TV.

Blacky :smiley:

@xXAzazelXx

You can do it like that. Be mindful with the “Phone Charging”
 the state may change when it is charged and turn OFF. We use “focus” but in night lights as we would like some light to come ON if we get up. Focus is the apple of do not disturb.

Tip: With your by-pass option 3 it will just keep the current state of your light so if they are ON you will have to turn it OFF. If you use option 2 it will turn your light OFF for you. You can set the “By-pass - Time Delay” so when you plug it in it will go OFF in the set time period.

Blacky :smiley:

Okay @Blacky, here is the required situation:

my front light goes on an 20% when its dark, this is controlled by another scene.
If somebody comes to my door, a motion sensor triggers and the front light and an extra ceiling light go on at 100% until the motion is gone. After that time T (5 min), the ceiling light goes off and the front light goes back to 20%.

This can be done with your blueprint, i call an extra scene as a turn-off scene. In this scene i set the front light at 20%. This idea was already suggested by you.

But: it doens’nt work as expected. If the front light is already on, BOTH lights wil turn off after time T.
But i noticed that if the front light is off before the blueprint is called it works as expected: the ceiling lamp goes of after time T and the front light goes to 20%.

Is this expected behaviour or not? i would assume not? the inital state should not matter i would expect.
thks
Jacco