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.
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 . 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 , 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
- Go to Settings / Devices & Services / click on the āHelpersā tab / click ā+ CREATE HELPERā and select āGroupā.
- Select āSensor groupā.
- 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.
- 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
- 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ā
- You will then see your entities and your options. Then just edit as required.
- 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
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:
- Turn the lights on when motion detected:
- Initial state: bathroom
doors
are open (on
),light
isoff
,motion
isoff
- When:
motion
goeson
(so basically default logic of this blueprint) - Then:
light
goeson
untiltime_delay
runs out
- Someone closed the bathroom doors after triggering motion:
- Initial state: bathroom
door
are open (on
),light
ison
,motion
ison
- When:
doors
goes from open (on
) to closed (off
) and its before motiontime_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
stayson
untiltime_delay
runs out and after that, ifmotion
is detected one more time - thelights
should stayon
until thedoors
are opened (on
) again.
- Turn the lights on when doors are opened:
- Initial state: bathroom
doors
are closed (off
),light
isoff
,motion
isoff
- When: bathroom
doors
goes from closed (off
) to opened (on
) - Then:
light
goeson
untiltime_delay
runs out or ifdoors
close withoutmotion
detected - a bit different logic as you see @Blacky thandoor
sensor as a trigger in the blueprint
- Someone opened the bathroom doors after triggering motion:
- Initial state: bathroom
doors
are closed (off
),light
ison
,motion
ison
- When:
doors
goes from closed (off
) to open (on
) - Then: the
light
goesoff
I hope that itās logical 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 .
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 .
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
Hi @yrivardmulrooney firstly welcome to the community.
Your welcome, I am glad you like it . 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 .
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 . 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 . Thanks for getting back to me.
Well it made me do the update anyway ā¦ I have the new blueprint ready and will update now. Just doing final checks.
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
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!
Hi @samuelthng
Thanks for your suggestion . I have this on my list to do and would like to have this option included to. I will look into it again.
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!
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
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