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

Hi Blacky,
fantastic blueprint. Thank you very much for your work.
I do have the same issue though that you may have solved with momo earlier in this thread.
I want to use 2 motion sensors (each side of the stairs). The sensors support illumination/lux, but the value is only sampled when motion is detected. Hence, the triggering sensor contains the ā€œcorrectā€ value, the other one is outdated. Do you know of a way to handle that?

I have the same issue with lux sensor in my Philips Hue Motion sensors. The official site points out that there was an firmware update which should fix the issue: Philips Hue Support - Release Notes Accessories | Philips Hue US

Unfortunately I donā€™t know how to check current firmware version (I donā€™t have hue bridge) and how to updateā€¦

After a good night sleep and some more considerations, I solved this by feeding the blueprint with a virtual motion sensor, which is loaded with either sensor1 or sensor2 data by some pre-processing automation rules.

@narandill , firstly welcome to the community.

Your welcome, glad you enjoy it.

You can have a door sensors as a trigger. You can use one or multiple Binary Sensors for the trigger sensor. If you are going to use 2 or more binary sensors in the trigger selection and 1 of them is a sensor that can stay in the ON state for some time (like a door sensor) then I would recommend you consider using a group helper as shown in our FAQ. If your just using one trigger sensor that stays on for a long time then you will not need a group helper and you can just add it to the automation by selecting it.

@Seger85

This would be because the Philips Hub would of controlled it and now the HA stick lets you have the control.

I use Shelly to do the control and they do a good transition. Maybe I need to get one of those sticks so I can test it out with a Philips globe :thinking:. It is on my list to do.

@elk Firstly welcome to the community.

You can have 2 motion sensors on each side of the stairs as I have 2 down my hall way and it works perfectly. My motion sensors are fast to react and clear in about 3 to 4 seconds if no motion is detected.

The problem you have if you would like to use the LUX as a option then it will need to send updates to HA without the need for the motion sensor to be triggered before a new value is sent.

Could you let us know what sensors you are using?

narandill suggested there could be a update if you are using Philips sensors. I would look into the sensor and the settings. Sometimes they have options that you need to set so you can have them reporting as needed.

If you get your sensors reporting LUX to HA without the need to be triggered (there must be a way or a setting) and you would like to have both LUX values considered and then averaged, then I would use the new ā€œSensor Groupā€ that has just been release this month. I will do a FAQ on how to set this up correctly soon.

EDIT: Just read this

Not sure what you did but maybe read what I said above, If you need more help just let us know.

Hi @Blacky ,
I am using aquara motion sensors connected to home assistant through the zigbee2MQTT integration (aquaria motion sensor p1 @ zigbee2mqtt). The illuminance is only published when occupancy toggles. But, that is ok for me. Anyway, once the lights are on, I cannot use the LUX value, as the lights will determine the illuminance. This is why I use the ā€œYES - My Ambient Light Sensor is affected by the Lightsā€ option in the blueprint, and would expect the LUX is not used when the lights are already on.
Here is my solution, maybe it helps others who have a similar setup. It requires, the ā€œvirtual componentsā€ integration from HACS
1.) create virtual motion sensors in configuration.yaml, then register these sensors on your blueprint

binary_sensor:
  - platform: virtual
    name: 'Flur_Motion'
    initial_value: 'off'
    class: motion
sensor:
  - platform: virtual
    name: "Flur_Illuminance"
    class: illuminance
    initial_value: 20
    unit_of_measurement: lx

2.) Create an automation on the real motion detector and feed forward the values:

alias: Flur_Motion_Upstairs_ON
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.aquara_motion_detector_occupancy
    to: "on"
condition: []
action:
  - service: virtual.set
    data_template:
      entity_id: sensor.virtual_flur_illuminance
      value: "{{states('sensor.aquara_motion_detector_illuminance_lux')}}"
  - service: virtual.turn_on
    data:
      entity_id: binary_sensor.virtual_flur_motion
mode: single

Then create similar automations for the 2nd motion sensor and create similar automations that clear the virtual occupancy sensor (maybe with a condition to only clear if both real sensors are ā€œclearā€).
I am waiting for my second sensor to arrive so that I can actually test this with 2 sensors :grinning:, but I feel very comfortable that it will work.
Anyway, I am very fresh into this HA motion topic and so happy I could find the template that solves most of my problems. Thx again.
Btw, I do also have a Hue Motion sensor which is connected to a Hue-hub, which I can monitor in HA through the Hue integration. Illuminance & temperature is reported by this sensor every 5 minutes.

FAQ

HOW TO ADD MORE THAN ONE AMBIENT LIGHT SENSOR TO THE AUTOMATION

With the new release of Home Assistant 2023.2.0, the HA team has added a new sensor to the helper group called ā€œSensor Groupā€. You can now group two or more ambient light sensors together.

How it works: Type ā€œArithmetic meanā€ = If one sensor reads 20 and the other sensor reads 40 then the sensor group will read 30, (20 + 40 = 60, divided by 2 sensors = 30). Note: There is a selection when creating the ā€œSensor Groupā€ to have different types. This will change how the ā€œSensor Groupā€ works. Example: The types you can choose from are, Minimum, Maximum, Arithmetic mean, Median, Most recently updated, Statistical range & Sum. We are using ā€œArithmetic meanā€ in this example but you can choose the one that bests suits you. For this automation I recommend you stick with either, Minimum, Maximum or Arithmetic mean.

If this is something you would like to use in the automation, then follow these steps.

ADD A AMBIENT LIGHT HELPER SENSOR GROUP TO THE AUTOMATION

  1. Go to Settings / Devices & Services / click on the ā€œHelpersā€ tab / click ā€œ+ CREATE HELPERā€ and select ā€œGroupā€.

  1. Select ā€œSensor groupā€.

  1. Then enter a name, in this example we put ā€œLUX Groupā€. Then select your ā€œMembersā€ or entities (all of them that will be in the blueprint automation). Keep ā€œHide Membersā€ toggles OFF and select ā€œArithmetic meanā€ as shown below. Note: You can choose a different ā€œTypeā€ rather than ā€œArithmetic meanā€ if it suits you better. Once happy click submit.

  1. Then go back into the automation and in the ā€œAmbient Light Sensor" selection search for the name (Sensor Group) you just created, in this case ā€œLUX Groupā€ and select it. Now you have two or more ambient lux sensor averaging the readings for you in your automation. If you would like to add more or remove some entities you will have to go back into the helper and edit it (see below, edit helper).


.
Note: If one of your sensors is offline then it will report as unknown, have no lux value and you will not be able to select it in the ā€œAmbient Light Sensor" selection. If you would like to ignore a sensor that is offline, report a lux value and still be able to select it in the ā€œAmbient Light Sensor" selection then see read through the ā€œEdit Helperā€ and toggle ON ā€œIgnore non-numericā€ option.

EDIT HELPER

  1. If you need to edit the Helper. Go back to Settings / Devices & Services / click on the ā€œHelpersā€ tab / click the helper you would like to edit, in this case ā€œLUX Groupā€ and then select ā€œGroup Optionsā€

  1. You will then see your entities and your options. Then just edit as required.

  1. You will also notice one extra option ā€œIgnore non-numericā€ and a description above for it. If one of your sensors is offline or unknown it will report as unknown. If you would like to ignore this then you can toggled it ON. Note: A offline sensor will also prevent you from selecting it in the ā€œAmbient Light Sensor" selection of the automation.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

Back to ā€œThe Settings & Best Practice Guidelinesā€ Click Here

Thanks for reply @Blacky, my door sensor goes to on state when I open the doors. Itā€™s pretty simple to use it as an additional trigger. What I have in mind is a bit more complex - I donā€™t want to use door sensor as a additional trigger, but as a logic gate. Hereā€™s the few examples:

  1. Turn the lights on when motion detected:
  • Initial state: bathroom doors are open (on), light is off, motion is off
  • When: motion goes on (so basically default logic of this blueprint)
  • Then: light goes on until time_delay runs out
  1. Someone closed the bathroom doors after triggering motion:
  • Initial state: bathroom door are open (on), light is on, motion is on
  • When: doors goes from open (on) to closed (off) and its before motion time_delay runs out. - here we know that someone is in the bathroom and until doors will open again we want to have the light on
  • Then: light stays on until time_delay runs out and after that, if motion is detected one more time - the lights should stay on until the doors are opened (on) again.
  1. Turn the lights on when doors are opened:
  • Initial state: bathroom doors are closed (off), light is off, motion is off
  • When: bathroom doors goes from closed (off) to opened (on)
  • Then: light goes on until time_delay runs out or if doors close without motion detected - a bit different logic as you see @Blacky than door sensor as a trigger in the blueprint
  1. Someone opened the bathroom doors after triggering motion:
  • Initial state: bathroom doors are closed (off), light is on, motion is on
  • When: doors goes from closed (off) to open (on)
  • Then: the light goes off

I hope that itā€™s logical :crossed_fingers: if not fell free to ask any questions.

Does that mean @Blacky that you also have Philips Hue Motion Sensors? I found pretty solid step-by-step guide how to OTA by ZHA here: How to update the firmware of ZigBee devices using Home Assistant ā€” Rudd-O.com but unfortunately Iā€™m clueless from where to download correct firmware version.

Hi @narandill thanks for you questions. Well tough of and laid out to understand.

As you said default logic.

Are you sure that someone is in the bathroom? or did they just leave and close the door?

If motion is detected inside the bathroom when this happens we know that someone is in the bathroom, lights on and the default logic will work.

As you open the door motion detected and light onā€¦ the default logic will work.

If you open the doors and walk out, leave the door open and no motion is detected light will go OFF, the default logic will work.

It seams that you may not need a door sensor but I can see your way of thinking. If your lights are not staying on when your in the bathroom maybe consider a mmWave sensors.

No, but if you use the Philips app I would say that they would have a update option. The link you provided is a bit technical if your not sure what to do. Maybe try the app as Philips should make it very simple to do.

Hey there! First of all, I wanted to thank you for this blueprint, I started using it a few weeks ago and itā€™s been working great and pretty much all the features I could want are included out of the box :slightly_smiling_face:.

There are two or three things Iā€™ve run into that would be nice to either fix or make a bit more flexible:

The lux threshold before turning on the lights is currently limited to 500 as a maximum value, which in my case seems to be a bit low. Iā€™ve positioned a single luminance sensor that Iā€™m using globally with all my uses of the blueprint, and I positioned it right next to a window to check what the outside luminance is like. Iā€™ve noticed that it gets kind of dark inside before the sensor reports a value below the threshold, even when set to 500, Iā€™d like to be able to set it probably around 1000 if possible.

The other thing Iā€™ve noticed is that when you have multiple sensors triggering the automation, it seems like the lights will turn off when a single motion sensor hasnā€™t detected movement for the timeout period. I would have expected the lights to stay on until all motion sensors stopped detecting occupancy for the timeout. I can probably work around this issue with a sensor group, but I wasnā€™t sure if this was expected behavior so Iā€™m bringing it up :slightly_smiling_face:.

Last point, which is mostly just a wish list item that I can live without, is to be able to have the blueprint re-evaluate whether the lights should be on or off when the bypass trigger is deactivated. Iā€™m currently using it with the option to keep the lights on when itā€™s activated, and I trigger this from the light switch to force on or off the lights. This would allow me to not have to know the state of the motion sensor when putting the lights back to ā€œautomaticā€ mode, since I donā€™t know for sure if the blueprint will send the off command or not in the future. Itā€™s a minor item since I can always just turn it off and it will re-sync with the blueprint, itā€™s mostly for when I have guests and they donā€™t know about that little detail.

Thanks a bunch :slightly_smiling_face:

Hi @yrivardmulrooney firstly welcome to the community.

Your welcome, I am glad you like it :slightly_smiling_face: :+1:. Also thank you for asking the questions and for your suggestion.

This is in or FAQ. If you would like to enter 1000 or any other number the slider is not allowing then just simply type the number you would like in and click save :wink:.

This is also in or FAQ. I wouldnā€™t add the new ā€œsensor groupā€ but you can add a ā€œBinary sensor groupā€. The FAQ is below, follow the steps in the link and it will walk you through it.

Q: I have more than one trigger sensor / binary sensor and my light will come ON then it will turn OFF and stay OFF? - or - The automation is not working correctly with 2 or more trigger sensor / binary sensor and is driving you crazy?

A: Please follow these steps Click Here

Thanks for your suggestion :+1:. I have this on my list to do as I would also like to have it linked with my Bathroom Humidity Exhaust Fan blueprint (both blueprints work together). I will try and get this out in the next release soon.

Well thatā€™ll teach me not to read FAQs thoroughly enough :slightly_smiling_face:. Thanks for getting back to me.

1 Like

Well it made me do the update anyway :wink:ā€¦ I have the new blueprint ready and will update now. Just doing final checks.

New update 2.7

Changed what happens when the by-pass is turned OFF. It will now re-evaluate the trigger sensor.

When the by-pass is turned OFF and trigger sensor is ON.

  • If the lights are OFF, turn lights ON and run automation.
  • If the lights are ON, leave lights ON and run automation.

When the by-pass is turned OFF and trigger sensor is OFF.

  • If the lights are ON, turn lights OFF and wait for the trigger sensor.
  • If the lights are OFF, leave lights OFF and wait for the trigger sensor.

Enjoy

Blacky :grinning:

2 Likes

Absolutely love every version! Very practical and reliable automation!

I would like to suggest addition of transition time!
Use case: For a smoother transition for night lights, giving the room a calmer ambience with a slower transition, easier on the eyes too!

1 Like

Hi @samuelthng

:heart:

Thanks for your suggestion :+1:. I have this on my list to do and would like to have this option included to. I will look into it again.

1 Like

Edit: For future comers. I disabled the ā€œsave stateā€ option from the integrations page (choose light > configure) and the error is no longer showing. Blueprint is working fine!

Original post: I have the original aqara motion sensor, and Iā€™ve setup a simple Turn ON lights for 1 minute when motion is detection. It looks like the sensor does activate the Lights ON scene, but it fails to activate the Lights OFF scene for some reason. I checked the Trace timeline and found an error. Iā€™m not sure if itā€™s related but Iā€™ve attached it for reference. Thanks!

New update 2.8

Fixed a bug when selected ā€œEnable the By-pass - If lights are ON, turn lights OFFā€. If trigger sensor was ON and stayed ON the light would not turn OFF.

Added the "By-pass Time Delayā€ option.

Use case.

  • You turn the by-pass on and you have ā€œEnable the By-pass - If lights are ON, turn lights OFFā€ selected. You then need some time to exit before the lights turn off.
  • When you turn your by-pass off and at the same time your trigger sensor is off but your still in the room and need to keep the lights on while the motion sensor will trigger again soon (within the set by-pass time delay) and take over the automation. This will stop you flapping your arms around to trigger the sensor again so you lights will turn back on.

TIP: You can now also link this blueprint with my Bathroom Humidity Exhaust Fan blueprint. So if you use this blueprint to control the lights in your bathroom sometimes when having a shower the motion sensor doesnā€™t work when you behind the shower screen turning your lights off. If you put the bathroom exhaust fan used in my Bathroom Humidity Exhaust Fan blueprint into the by-pass of this automation the lights will stay on while you are in the shower. When the fan turns off it reset this automation and the light will stay on or go off depending on the trigger sensor.

Enjoy

Blacky :grinning:

2 Likes

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