I've added two new Use Cases to my Github page that turn off all the lights in the hallway, stairway, boiler room, and garage if no motion has been detected in all of these rooms. What kind of motion sensors do you use? And what are the best ones in your opinion?
I currently use the hue motion sensors using the hue app. It's easy and fast but limited to the first use case. This is an excellent nudge to finally migrate my motion detection logic to home assistant.
I have managed to create two test automations. One that checks for the wall switch state. If its "on" then it switches the lights on and sets a manual_mode helper to "on", when it is off " it resets the manual_mode helper to "off". Helper follows the light switch state. The second automation then works like your use case one, but it checks the condition of the manaul_mode helper. If manual_mode helper is "off" then the motion works as in use case one, else it blocks the automation. Next I need to look at scenes and adding in some time of day parameters, as the lights that I want to automate need to dim to 20% and go to 2700 kelvin between 22:00 and 6:00. I will be able to automate my Shelly duo's in the hallway by adding an I4 device into the wall switch box. Looking forward to the weekend 🙂
Using Xiaomi Zigbee. Works well. Recently invested in some Shelly Motion 2 devices. What I like about the Shelly Motion 2 is that I am getting a temperature sensor, and that I can set a motion blind timer in the device to extend when "motion not detected" is sent out. For example. If is set the motion blind time to 60s (minimum) and I get another trigger, the timer resets back to 60s. I can also set the sensitivity. (this might help with the wandering cat at night).
YOU HAVE A GITHUB? HOW DID I MISS THIS! You're the best. Very very good tutorials. Defining Use-cases before starting the config is spectacular. thanks.
I'm using 2 -Aqara P1's, love em! i've used several other brands on the echo and and GH, but nothing beats, or comes close in any category, i'll be buying more just to play with. Any news on when/if the Aqara FP1 presense sensor might be releasing in th U.S.?
So many ways to skin the cat in Home Assistant, and I was struggling to get a basic motion to work, some people recommended multiple automations, which causes strange race conditions, and complexity. Others recommend built in blueprints, which were problematic. This was the right way. Thanks!
I'm new and only just started setting up home assistant, I have the lights only setup so far but was able to use this principle to auto lights off without a sensor after a period of time when the kids leave lights on in walk in storage cupboards.
Thank you for your clear instructions. I was able to get a relay to be remotely controlled by a PIR sensor connected to an ESP32 C3 board, both working in Home Assistant. I’ve just bought you a coffee. Cheers!
Thanks for the content. Wanted to mention a possible gotcha on using the if-else constructs. I used your Use Case 1 to replace a simple detect -> condition -> action with delay automation. My automation used a time condition so I used the time condition in the If portion. So when my automation got triggered outside of the time period, it turned off my lights instead of turning them on. Since the else can't have a condition tied to it, any trigger will take the else, when the if condition is not met. Will be trying the Choose construct next.
Your tutorials are awesome. I am learning something new each time. I am going to replace my complex node-red code with HA automations. The new 2022.9 release has improved the UI tremendously.
Thanks for sharing the use cases and clear description. In my case I was able to run the automation (Use case 1 tested) with Tuya integration sensors/lights and HA automation. so far so good!
Thank you for your videos Ed, using the Trigger IDs have enabled me to get my automation's running a lot more reliably. I have only used the Sonoff movement sensors, so can't give an opinion on other manufacturers.
You are helping me so much with every video. ID triggers mainly helped me alot. In this particular video I however missed the option to control for illumunation. When its sunny the light is not needed :). Are they a choos condition or can they also be general conditions ( if applicable). I was hoping I also could use this for, in my eyes similar setup, but with some additional time conditions and instead of a simple turn on and off the lights work with predefined scenes. But seems not to work. Might be something you are interrested in aswel. Livingroom: two motions sensors, one for sit area and one for eat area. daytime (6-6): if one of two sensors sees motion all lights should turn on to scene helder ( if illumation is below trashold). If one Area has no motion for 5 min turn that zone off till motion is dected. Dinner time (6-7): if sit Area has no movement for 10 min and eat Area has movement switch to scene dinner time ( if illumation is below trashold). Evening (7-12): If eat Area has no longer movement for 10min but sit Area has for 10min switch to scene relax. Night (12-6): turn on night scene for 2 min Finally a condition helper binary sensor, if pressed, keep current setting as long as motion is detected within a 15 min time frame. Results: I tried using your method but I conclude that scenes cannot be changed without firts having them turned off ( so you have to wait for the 5-10 no motion trigger). I configure my scenes and add my lights using hue hub / app, because you can configure scenes easily has you go. Does feel this might interfere with native HA automations? I dont use MQTT?
This solution seems very complex. It can be done a lot easier. Scenes can be used to switch on and off the lights. And you can use the condition part of an automation to check whether it's dark or not.
Helpful video for me because I was looking for an automation solution for putting on (and of course off) the light in 2 rooms with sensors! I also apreciate the dutch translation! Thanks
So glad to see using ifthen rather than choose but why not use call service turn on light / turn off light so you can set the lamp as you want rather than the last setting for the lamp? Also I use the original Aqara motion sensors and use their illuminance level so that they only work when it is dark
Yes, you're right. I didn't use call service because I wanted to keep the tutorial tidy. When you use call service, the UI gets cluttered with all kind of options that I didn't need to show the actual point of this tutorial. I have other tutorials where I do use the call service option.
Thanks Ed, this is extremely helpful. I do have a question to make sure I understand with some clarity. At about 4:20 you show the automation previously created for 1 sensor 1 lamp and on the 2 triggers only the first gets a Triple ID. This confused me at first but is it because… This first use case is powered by the If/then/else rather than the choose so it just wasn’t necessary? The other 2 use cases used the Choose.
For Tasmota devices PulseTime command takes care to turn off light after period of time, whatever cause of turn on action it was (sensor, HA, phisical button, automation..). It resets if new puls for on action is received. And it runs locally on device (more reliable). Wish that also ZigBee devices have such functions out of box.
This was really helpful for a school project I'm doing dropped a like and a sub for the channel, might stay tuned as I'm really interested in home assistant now
Incredibly helpful! But i have an intreresting issue, have tried NodeRed, Blueprints etc. I have 1 motion & lux sensor in one, controlling 5 light entities (one Hue light). If lux is below 150 then turn on an ambient scene, if above 200lux turn ambient scene off. Outside of this i want motion to turn on a full bright scene and then revert back after 1 minute. Two issues, how to build it (your guide was very helpful with motion) and also i need to have buffer logic as the ambient scene can turn off while the full bright scene is on and it often gets stuck. Would be happy to pay for consulting hours on this!
Awesome tutorial!! Thankyou! 👍🙂 What is the best way to operate 3 motion sensors from 1 large room? Would a ZigBee group or HA group work best for this?
Thanks for walking through all the steps. I wish motion detector trigger language was standardized. Some detectors (like the ones you used) clearly tell you the triggers: "Motion detector started detecting motion." I have a Fibaro motion sensor that lists nearly 30 possible triggers (temperature, luminance, tamper), but not one mentions "motion started".
Thanks for your great video, I have a quick question, on your triggers, is there any special reason why you choose device instead of state (entity). I always used states of my entities to trigger my automations, but I am wondering if there is any advance to use device triggers instead. Cheers and keep up with your great videos!
No, not really. I just wanted to keep the tutorial simple. Most of the five I first check if there is a trigger on the device. If not, I might use a state.
Hi, not sure if you have covered this case but I am not able to work out this one. A bathroom light that turns on via motion on a low brightness at night. Easy... But if I or my wife flicks the switch, the light comes on (no matter the time of day or night) at full brightness. And when the switch is flicked off it then reverts back to the motion automation. Have you done any tutorials for this? Love to see one.
I didn't but I think you can create an automation that triggers "from off to on" or "from unavailable to on" and then changes the brightness in the action of the automation. It would still turn on at full brightness but will change the brightness immediately after that. I didn't try this, so the results may vary.
@@SmartHomeJunkie So, can an automation become "interrupted" or paused? This is where I fall into a logic trap. e.g. I walk into the bathroom at night, motion turns on the dimed lights. I flick the switch [can the automation just be turned off or ignored at this point?] Then when the switch is turned off the automation is reset and ready for the night time toilet visit. Where at my age you no longer pee but seem to be sending morse code. (Billy Crystal joke)
Thanks for another good one. There is one scenario I've been thinking about, which is entering a room for a brief period (seconds) and exiting the room but the light stays on for the configured timeout of 10 minutes. How would you approach this scenario? To quickly turn off the lights instead of keeping them on when the room is not occupied?
May be you can connect a smart switch after the MD, instead of motion sensor triggering the light use the smart switch to trigger. in the switch you can set timer for few minutes if a motion is detected and the light can be on.
Ah, great! Thanks for the video! And especially for the third example, which in my case is exactly my constellation :-) I will have a look into my code and compare it with your solution. As always, Great Videos Ed! Best presenting content.
Thank you Saure! Please don't forget to loom into the two extra use cases that I added on GitHub and on my website to make it work even more perfectly!
What can be the reason for a missing "If-then" action type? Can't find it and I wonder whether this could be caused by my slightly outdated HA (which for a reason I can't upgrade atm). Can I use another method instead?
Hello, can you please help a little bit? I have a Athom presence sensor with PIR and mm wave and i want to combine both functions, when pir detects motion or mm, to turn on light. if pir stop detect motion but mm wave keep detect motion let the light work, when both stop detect motion turn off the light. How do you suggest? :)
II followed this tutorial using a Hue motion sensor. The problem is if I stay in the room the lights go off after about a minute and don't come back on. Can you help please?
I use IKEA Trådfri Motion sensor and recently I added a third one that is controlling the ceiling lights (lightgroup) in the roof (4 GU10 spots). I've used the trigger id (in your previous videos) and my problem is that I have a massive delay. I run Sonoff USB 3 Plus zigbee stick with HA in a VM (Proxmox) and Ziggbee2mqtt. Would binding the motion sensor to the lightgroup make it more responsive?
You can of course try that. Not sure if it will fix your issue. The delay shouldn't be there really. It might be that there is an issue in your automation.
I have the same motionsensors from Ikea and have them connected thru te ikea hub. Its delayed by one or two seconds. I dont know if that changes if i connect it via my homeassistant but i have the feeling this is just how the sensor works.
I have another question about the motion sensors. On my driveway, my HUE lights are on when it is dark at 25% brightness. As soon as motion is detected (for example, when I drive my car into the driveway), and the motion sensor sees me, the lights go to 100%. I would like after e.g. 2 minutes that the lighting goes back to the original set lighting strength. Now it is 25%, but if I decide at a later time to make it 30% or 35%, I want it to go back to that setting. How can I get that done? Thanks in advance for your help.
Can there be a condition to not control the lights if the Lights (or the group) already manually ON? further can we make the brightness lower at night (time controlled) to just have a bit of stair lights for a walking down at night?
Yes, you can add a check in the condition if the lights are already on. And see this video how to set up adaptive lighting: ua-cam.com/video/c1cnccmgl3k/v-deo.html
Hmm, one question regarding use case #2, Ed. If someone walks to the door outside the inside and outside light turn on. The person realises wrong house and moves off. Motion outside stopped and the outside light turns off. There was no trigger to detect motion start inside, so how is the inside light tuned off again? Will there be an automatic trigger for stop motion inside? Still a big thank you for the tutorials you do. Cheers, Klaus
In my scenario's I have two motion sensors in my bathroom, both are in different corners of the bathroom. Currently I used the HA helper to create a group of these sensors. And after viewing you're video I changed my automations from a separate 'on' and a seperate 'off' automation to just one which seems to work fine for me. But in your video it's not really clear, atleast not for me, if this is the best solution, OR should I just add both sensors separately to the Automation? Currently it looks like this: YAML: alias: Badkamer (Z2M groep) - op beweging description: "" trigger: - platform: state entity_id: - binary_sensor.badkamer_motion_sensors id: beweging-start to: "on" alias: Badkamer beweging gedetecteerd - platform: state entity_id: - binary_sensor.badkamer_motion_sensors id: beweging-stop to: "off" alias: Badkamer beweging niet meer gedetecteerd condition: [] action: - if: - condition: trigger id: beweging-start then: - service: light.turn_on data: brightness_pct: 100 target: entity_id: light.badkamer_led_strip_in else: - condition: trigger id: beweging-stop - service: light.turn_off data: {} target: entity_id: light.badkamer_led_strip_in mode: single YAML The sensors are Z-Wave motion sensors, the light involved is a Philips Hue outdoor strip, which is not connected via Zigbee2mqtt but via the Philips HUE bridge and that integration.
A curiosity question. When you used the automations to turn on lights you used the Device rather than Call Service light.on Does one method make for less code?
I wanted to keep the tutorial clear and not clutter it up with too much code on the screen when I use the service light.turn_on. If you want to turn on the light in a specific color, then you should use the service instead.
@@SmartHomeJunkie I am glad I had watched the Trigger ID video first. It is almost a prerequisite. I think it was good that you didn’t make the automations in the demo. Especially for time and how much you delivered My only critique would be to have mentioned these trigger ids were created and named by me when I made the automations before making the video and “if you watched my super excellent video of how to use Trigger IDs, you would figure this out.” I can only imagine the number of questions if I hadn’t watch the Trigger ID vid first.
@@BELSERVICEMAN Hi Rich, I think I mention the Trigger ID video in the first and the thirth use case. It's unbelievable that people don't know about trigger IDs. They are super valuable!
Is there a way that I can have a helper the saves a light mode/dim level ?, my use case is that I would like to turn on my outdoor lights on low at sunset and off again at sunrise, but at the same time being able to overwrite the light dim level, via a motion detector, so I need to return t te "old" light level not just to off after a motion has been detected..
I would use scenes on the fly for that. Check this video. And especially the scenes on steroids part: Scenes on Steroids in Home Assistant - How To - Tutorial ua-cam.com/video/JW9PC6ptXcM/v-deo.html
The biggest challenge I faced was managing the cool off period of zigbee motion sensors. The best solution I found was to set automations to wait 1 min before turning lights off for example.
Yeah, I hear that a lot. I have all my automations set to at least 5 minutes and than they work fine. I know that you can hack the Aqara sensors, but I do believe that the battery life will be shorter after that.
Ik heb een aqara motion sensor waarmee ik een scherm van een ipad wil activeren als ik de ruimte betreed, ik wil dit automatiseren in Home assistant maar tot op heden is dat niet gelukt, wel kan ik een tekst bericht naar de Ipad sturen via een automatisering in HA. Hoe kan ik ervoor zorgen dat het scherm van de Ipad via een automatisering aangaat?
From what I notice in the second case the outside sensor turns on the outside light and the one inside, but if I decide not to enter in the house and I leave, the outside light goes out after 5 minutes but the one inside stays on until there is movement inside, maybe this is just the next day. The same goes for case 3, if I only go to the boiler room and then return to the house, the light in the garage stays on. For this reason it may be advisable to use only motion detection on and automation in repeat mode and if there is no movement for 5 minutes all lights go off.
Good point. I think adding a motion sensor group (with the all entities flag off) and one automation that checks if the group is on or off will do the trick. If the whole group is off, then turn off all the lights. This will work for both use cases I think. i'll add it to Github. Thx!
Hi there I have a situation. I have 2 mmWave sensors that triggers the same lightswitch in the living room. 1 sensor is at our desk and 1 sensor sits at the tv towards the couch. When the kids are watching tv and the sensor is triggered, and I sit at the desk, and they leave the lights turns off. While what I need is that the light stay on while I’m still working. I can’t get this to work. Anybody some advise?
@@SmartHomeJunkie I came back to say THANK YOU🙏🏽 . I was struggling a while with this. It works perfectly now. I had all kinds of crazy conditions 🤪. But I totally forgot about groups. Thanks again my fellow Dutchman 🙏🏽🙏🏽
@@SmartHomeJunkie Ooit één keer (zijn nochtans Philips Hue...) en dat was de laatste keer : voortaan laat ik steeds veiligheidshalve een timer starten die het licht nogmaals dichtdoet indien het niet zou uitgegaan zijn via de "Clear gedurende 5 minuten". Opvangen van worst case scenario :-)
I've added two new Use Cases to my Github page that turn off all the lights in the hallway, stairway, boiler room, and garage if no motion has been detected in all of these rooms.
What kind of motion sensors do you use? And what are the best ones in your opinion?
I currently use the hue motion sensors using the hue app. It's easy and fast but limited to the first use case. This is an excellent nudge to finally migrate my motion detection logic to home assistant.
I have managed to create two test automations.
One that checks for the wall switch state. If its "on" then it switches the lights on and sets a manual_mode helper to "on", when it is off " it resets the manual_mode helper to "off". Helper follows the light switch state.
The second automation then works like your use case one, but it checks the condition of the manaul_mode helper. If manual_mode helper is "off" then the motion works as in use case one, else it blocks the automation.
Next I need to look at scenes and adding in some time of day parameters, as the lights that I want to automate need to dim to 20% and go to 2700 kelvin between 22:00 and 6:00.
I will be able to automate my Shelly duo's in the hallway by adding an I4 device into the wall switch box. Looking forward to the weekend 🙂
Using Xiaomi Zigbee. Works well.
Recently invested in some Shelly Motion 2 devices. What I like about the Shelly Motion 2 is that I am getting a temperature sensor, and that I can set a motion blind timer in the device to extend when "motion not detected" is sent out. For example. If is set the motion blind time to 60s (minimum) and I get another trigger, the timer resets back to 60s. I can also set the sensitivity. (this might help with the wandering cat at night).
YOU HAVE A GITHUB? HOW DID I MISS THIS! You're the best. Very very good tutorials. Defining Use-cases before starting the config is spectacular. thanks.
I'm using 2 -Aqara P1's, love em! i've used several other brands on the echo and and GH, but nothing beats, or comes close in any category, i'll be buying more just to play with. Any news on when/if the Aqara FP1 presense sensor might be releasing in th U.S.?
Thanks!
Thank you for your support!
So many ways to skin the cat in Home Assistant, and I was struggling to get a basic motion to work, some people recommended multiple automations, which causes strange race conditions, and complexity. Others recommend built in blueprints, which were problematic. This was the right way. Thanks!
You're welcome! 👍🏻
I'm new and only just started setting up home assistant, I have the lights only setup so far but was able to use this principle to auto lights off without a sensor after a period of time when the kids leave lights on in walk in storage cupboards.
Thank you for your clear instructions. I was able to get a relay to be remotely controlled by a PIR sensor connected to an ESP32 C3 board, both working in Home Assistant. I’ve just bought you a coffee. Cheers!
Thanks for the content. Wanted to mention a possible gotcha on using the if-else constructs. I used your Use Case 1 to replace a simple detect -> condition -> action with delay automation. My automation used a time condition so I used the time condition in the If portion. So when my automation got triggered outside of the time period, it turned off my lights instead of turning them on. Since the else can't have a condition tied to it, any trigger will take the else, when the if condition is not met. Will be trying the Choose construct next.
Your tutorials are awesome. I am learning something new each time. I am going to replace my complex node-red code with HA automations. The new 2022.9 release has improved the UI tremendously.
Great decision!
Thanks for sharing the use cases and clear description. In my case I was able to run the automation (Use case 1 tested) with Tuya integration sensors/lights and HA automation. so far so good!
Dankjewel man, je legt het echt super goed uit. Beter dan ieder ander die het doet.
Thanks!
Very good tutorial. I like. Now I have to study your content. Thanks for sharing. Many thumbs up.
Another outstanding video! Implemented this one too! Thank you...
Definitely a useful tutorial.
I don't have HA, but thanks for the tutorial. Great video... I love learning about smart home stuff👍
That's great to hear!
Thank you for your videos Ed, using the Trigger IDs have enabled me to get my automation's running a lot more reliably. I have only used the Sonoff movement sensors, so can't give an opinion on other manufacturers.
Outstanding tutorial. Keep up the great work. Thank you!
You are helping me so much with every video. ID triggers mainly helped me alot. In this particular video I however missed the option to control for illumunation. When its sunny the light is not needed :). Are they a choos condition or can they also be general conditions ( if applicable).
I was hoping I also could use this for, in my eyes similar setup, but with some additional time conditions and instead of a simple turn on and off the lights work with predefined scenes. But seems not to work. Might be something you are interrested in aswel.
Livingroom: two motions sensors, one for sit area and one for eat area.
daytime (6-6): if one of two sensors sees motion all lights should turn on to scene helder ( if illumation is below trashold). If one Area has no motion for 5 min turn that zone off till motion is dected.
Dinner time (6-7): if sit Area has no movement for 10 min and eat Area has movement switch to scene dinner time ( if illumation is below trashold).
Evening (7-12): If eat Area has no longer movement for 10min but sit Area has for 10min switch to scene relax.
Night (12-6): turn on night scene for 2 min
Finally a condition helper binary sensor, if pressed, keep current setting as long as motion is detected within a 15 min time frame.
Results:
I tried using your method but I conclude that scenes cannot be changed without firts having them turned off ( so you have to wait for the 5-10 no motion trigger).
I configure my scenes and add my lights using hue hub / app, because you can configure scenes easily has you go. Does feel this might interfere with native HA automations? I dont use MQTT?
This solution seems very complex. It can be done a lot easier. Scenes can be used to switch on and off the lights. And you can use the condition part of an automation to check whether it's dark or not.
Helpful video for me because I was looking for an automation solution for putting on (and of course off) the light in 2 rooms with sensors! I also apreciate the dutch translation! Thanks
Thanks for the great video! Is it possible in ZHA to have it so that the automation only applies during the night time, e.g. 12pm to 6am?
So glad to see using ifthen rather than choose but why not use call service turn on light / turn off light so you can set the lamp as you want rather than the last setting for the lamp?
Also I use the original Aqara motion sensors and use their illuminance level so that they only work when it is dark
Yes, you're right. I didn't use call service because I wanted to keep the tutorial tidy. When you use call service, the UI gets cluttered with all kind of options that I didn't need to show the actual point of this tutorial. I have other tutorials where I do use the call service option.
Thanks Ed, this is extremely helpful. I do have a question to make sure I understand with some clarity. At about 4:20 you show the automation previously created for 1 sensor 1 lamp and on the 2 triggers only the first gets a Triple ID. This confused me at first but is it because…
This first use case is powered by the If/then/else rather than the choose so it just wasn’t necessary? The other 2 use cases used the Choose.
Yes, that is absolutely correct. because of the If Else statement, you only need a trigger ID for the IF statement.
For Tasmota devices PulseTime command takes care to turn off light after period of time, whatever cause of turn on action it was (sensor, HA, phisical button, automation..). It resets if new puls for on action is received. And it runs locally on device (more reliable).
Wish that also ZigBee devices have such functions out of box.
I just uploaded the DUTCH and ENGLISH captions for this video. Hope this helps!
This was really helpful for a school project I'm doing dropped a like and a sub for the channel, might stay tuned as I'm really interested in home assistant now
Incredibly helpful! But i have an intreresting issue, have tried NodeRed, Blueprints etc.
I have 1 motion & lux sensor in one, controlling 5 light entities (one Hue light). If lux is below 150 then turn on an ambient scene, if above 200lux turn ambient scene off. Outside of this i want motion to turn on a full bright scene and then revert back after 1 minute.
Two issues, how to build it (your guide was very helpful with motion) and also i need to have buffer logic as the ambient scene can turn off while the full bright scene is on and it often gets stuck. Would be happy to pay for consulting hours on this!
Thanks Ed I was searching for something like this, always brilliant as usual thanks
Glad you enjoyed it
Great Video, Would love to see this in Node Red.
Sorry, I do not use Node Red.
Awesome tutorial!! Thankyou! 👍🙂
What is the best way to operate 3 motion sensors from 1 large room? Would a ZigBee group or HA group work best for this?
Thx. I would create a group for this indeed.
@@SmartHomeJunkie Yes, But would you create the group in zigbee2mqtt (that's what I am using) or would you create the group in Home Assistant?
@@paulatkinson9010 Definately in Zigbee2MQTT
Bedankt Ed!
Thanks for walking through all the steps. I wish motion detector trigger language was standardized. Some detectors (like the ones you used) clearly tell you the triggers: "Motion detector started detecting motion."
I have a Fibaro motion sensor that lists nearly 30 possible triggers (temperature, luminance, tamper), but not one mentions "motion started".
Yeah, that's really annoying indeed...
Thanks for your great video, I have a quick question, on your triggers, is there any special reason why you choose device instead of state (entity). I always used states of my entities to trigger my automations, but I am wondering if there is any advance to use device triggers instead. Cheers and keep up with your great videos!
No, not really. I just wanted to keep the tutorial simple. Most of the five I first check if there is a trigger on the device. If not, I might use a state.
So we’ll explained. Thank you!
I'm glad you think so. Thank you. 👌🏻
Hi, not sure if you have covered this case but I am not able to work out this one. A bathroom light that turns on via motion on a low brightness at night. Easy... But if I or my wife flicks the switch, the light comes on (no matter the time of day or night) at full brightness. And when the switch is flicked off it then reverts back to the motion automation. Have you done any tutorials for this? Love to see one.
I didn't but I think you can create an automation that triggers "from off to on" or "from unavailable to on" and then changes the brightness in the action of the automation. It would still turn on at full brightness but will change the brightness immediately after that. I didn't try this, so the results may vary.
@@SmartHomeJunkie So, can an automation become "interrupted" or paused? This is where I fall into a logic trap. e.g. I walk into the bathroom at night, motion turns on the dimed lights. I flick the switch [can the automation just be turned off or ignored at this point?]
Then when the switch is turned off the automation is reset and ready for the night time toilet visit.
Where at my age you no longer pee but seem to be sending morse code. (Billy Crystal joke)
@@hvddrift I think that use case is difficult to catch. 🤔
Do you recommend to do everything in HA-UI, in yaml or in nodered? I am starting with a complete new installation.
I do not use Node Red. I use the UI mainly and do some more advanced things in YAML
You are awesome! Thank you so much :)
Thanks for the compliment!
Thanks for another good one. There is one scenario I've been thinking about, which is entering a room for a brief period (seconds) and exiting the room but the light stays on for the configured timeout of 10 minutes. How would you approach this scenario? To quickly turn off the lights instead of keeping them on when the room is not occupied?
I don't think you can have both scenario's within the same automation.
May be you can connect a smart switch after the MD, instead of motion sensor triggering the light use the smart switch to trigger. in the switch you can set timer for few minutes if a motion is detected and the light can be on.
Does the new “motion-activated light” preset (when clicking “Create Automation”) solve this issue?
Ah, great! Thanks for the video! And especially for the third example, which in my case is exactly my constellation :-)
I will have a look into my code and compare it with your solution.
As always, Great Videos Ed!
Best presenting content.
And if you have found a solution for the camera-snapshot-Cache problem, I would be happy to know about it :-)
Thank you Saure! Please don't forget to loom into the two extra use cases that I added on GitHub and on my website to make it work even more perfectly!
What can be the reason for a missing "If-then" action type? Can't find it and I wonder whether this could be caused by my slightly outdated HA (which for a reason I can't upgrade atm). Can I use another method instead?
That might be the reason indeed. You can also use the Choose action.
Hello, can you please help a little bit? I have a Athom presence sensor with PIR and mm wave and i want to combine both functions, when pir detects motion or mm, to turn on light. if pir stop detect motion but mm wave keep detect motion let the light work, when both stop detect motion turn off the light. How do you suggest? :)
Hi! Create a sensor group helper with both sensors in it and check on the state of that sensor group.
II followed this tutorial using a Hue motion sensor. The problem is if I stay in the room the lights go off after about a minute and don't come back on. Can you help please?
Dankjewel Ed!
Dank je wel voor je reactie Rob! 🙏🏻
Lang verhaal kort: HELD!👌
I use IKEA Trådfri Motion sensor and recently I added a third one that is controlling the ceiling lights (lightgroup) in the roof (4 GU10 spots). I've used the trigger id (in your previous videos) and my problem is that I have a massive delay. I run Sonoff USB 3 Plus zigbee stick with HA in a VM (Proxmox) and Ziggbee2mqtt. Would binding the motion sensor to the lightgroup make it more responsive?
You can of course try that. Not sure if it will fix your issue. The delay shouldn't be there really. It might be that there is an issue in your automation.
I have the same motionsensors from Ikea and have them connected thru te ikea hub. Its delayed by one or two seconds. I dont know if that changes if i connect it via my homeassistant but i have the feeling this is just how the sensor works.
I have another question about the motion sensors.
On my driveway, my HUE lights are on when it is dark at 25% brightness.
As soon as motion is detected (for example, when I drive my car into the driveway), and the motion sensor sees me, the lights go to 100%.
I would like after e.g. 2 minutes that the lighting goes back to the original set lighting strength.
Now it is 25%, but if I decide at a later time to make it 30% or 35%, I want it to go back to that setting.
How can I get that done?
Thanks in advance for your help.
Can there be a condition to not control the lights if the Lights (or the group) already manually ON? further can we make the brightness lower at night (time controlled) to just have a bit of stair lights for a walking down at night?
Yes, you can add a check in the condition if the lights are already on. And see this video how to set up adaptive lighting: ua-cam.com/video/c1cnccmgl3k/v-deo.html
Question: In Use Case 1 I did not see you use the "stopped detecting motion" trigger ID anywhere in the Actions. Was that intentional?
Hmm, one question regarding use case #2, Ed.
If someone walks to the door outside the inside and outside light turn on.
The person realises wrong house and moves off. Motion outside stopped and the outside light turns off.
There was no trigger to detect motion start inside, so how is the inside light tuned off again?
Will there be an automatic trigger for stop motion inside?
Still a big thank you for the tutorials you do.
Cheers,
Klaus
Exactly Claus, that's another use case. I already know how to fix this and will add that to my article and github.
In my scenario's I have two motion sensors in my bathroom, both are in different corners of the bathroom. Currently I used the HA helper to create a group of these sensors.
And after viewing you're video I changed my automations from a separate 'on' and a seperate 'off' automation to just one which seems to work fine for me.
But in your video it's not really clear, atleast not for me, if this is the best solution, OR should I just add both sensors separately to the Automation?
Currently it looks like this:
YAML:
alias: Badkamer (Z2M groep) - op beweging
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.badkamer_motion_sensors
id: beweging-start
to: "on"
alias: Badkamer beweging gedetecteerd
- platform: state
entity_id:
- binary_sensor.badkamer_motion_sensors
id: beweging-stop
to: "off"
alias: Badkamer beweging niet meer gedetecteerd
condition: []
action:
- if:
- condition: trigger
id: beweging-start
then:
- service: light.turn_on
data:
brightness_pct: 100
target:
entity_id: light.badkamer_led_strip_in
else:
- condition: trigger
id: beweging-stop
- service: light.turn_off
data: {}
target:
entity_id: light.badkamer_led_strip_in
mode: single
YAML
The sensors are Z-Wave motion sensors, the light involved is a Philips Hue outdoor strip, which is not connected via Zigbee2mqtt but via the Philips HUE bridge and that integration.
I would use a group too indeed.
A curiosity question.
When you used the automations to turn on lights you used the Device rather than Call Service light.on
Does one method make for less code?
I wanted to keep the tutorial clear and not clutter it up with too much code on the screen when I use the service light.turn_on. If you want to turn on the light in a specific color, then you should use the service instead.
@@SmartHomeJunkie I am glad I had watched the Trigger ID video first. It is almost a prerequisite.
I think it was good that you didn’t make the automations in the demo. Especially for time and how much you delivered
My only critique would be to have mentioned these trigger ids were created and named by me when I made the automations before making the video and “if you watched my super excellent video of how to use Trigger IDs, you would figure this out.”
I can only imagine the number of questions if I hadn’t watch the Trigger ID vid first.
@@BELSERVICEMAN Hi Rich, I think I mention the Trigger ID video in the first and the thirth use case. It's unbelievable that people don't know about trigger IDs. They are super valuable!
Started to work on use case one using 2022.9 automations. Do not see if-then-else automation type. Assume its now replaced?
Found the IF THEN. Did not show in drop down originally. Will continue.
Is there a way that I can have a helper the saves a light mode/dim level ?, my use case is that I would like to turn on my outdoor lights on low at sunset and off again at sunrise, but at the same time being able to overwrite the light dim level, via a motion detector, so I need to return t te "old" light level not just to off after a motion has been detected..
I would use scenes on the fly for that. Check this video. And especially the scenes on steroids part:
Scenes on Steroids in Home Assistant - How To - Tutorial
ua-cam.com/video/JW9PC6ptXcM/v-deo.html
The biggest challenge I faced was managing the cool off period of zigbee motion sensors. The best solution I found was to set automations to wait 1 min before turning lights off for example.
Yeah, I hear that a lot. I have all my automations set to at least 5 minutes and than they work fine. I know that you can hack the Aqara sensors, but I do believe that the battery life will be shorter after that.
Ik heb een aqara motion sensor waarmee ik een scherm van een ipad wil activeren als ik de ruimte betreed, ik wil dit automatiseren in Home assistant maar tot op heden is dat niet gelukt, wel kan ik een tekst bericht naar de Ipad sturen via een automatisering in HA. Hoe kan ik ervoor zorgen dat het scherm van de Ipad via een automatisering aangaat?
I have Aqara motion/occupancy/light sensor and several Zigbee Third Reality battery operated units.
commenting cuz I appreciate the article. I don't even have home assistant LOL
Haha! Thanks anyway!
From what I notice in the second case the outside sensor turns on the outside light and the one inside, but if I decide not to enter in the house and I leave, the outside light goes out after 5 minutes but the one inside stays on until there is movement inside, maybe this is just the next day. The same goes for case 3, if I only go to the boiler room and then return to the house, the light in the garage stays on. For this reason it may be advisable to use only motion detection on and automation in repeat mode and if there is no movement for 5 minutes all lights go off.
Good point. I think adding a motion sensor group (with the all entities flag off) and one automation that checks if the group is on or off will do the trick. If the whole group is off, then turn off all the lights. This will work for both use cases I think.
i'll add it to Github. Thx!
@@SmartHomeJunkie Yes, and I think that works correctly, or case 3 can be divided into several cases 2.
@@florins1567 Thanks for your sharp Eye Florin! Much appreciated!
Hi there I have a situation. I have 2 mmWave sensors that triggers the same lightswitch in the living room. 1 sensor is at our desk and 1 sensor sits at the tv towards the couch. When the kids are watching tv and the sensor is triggered, and I sit at the desk, and they leave the lights turns off. While what I need is that the light stay on while I’m still working. I can’t get this to work. Anybody some advise?
Put the two sensors in a group (helper) and trigger on the state of the group
@@SmartHomeJunkie I came back to say THANK YOU🙏🏽 . I was struggling a while with this. It works perfectly now. I had all kinds of crazy conditions 🤪. But I totally forgot about groups. Thanks again my fellow Dutchman 🙏🏽🙏🏽
@@d.d.9731 Graag gedaan!
i'm sitting here "dude... what hole?"
Nog nooit meegemaakt dat één van je sensoren niet meer terugkeert van "Detected" naar "Clear"... ?
Nope, die van mij niet. m'n maar als dat bij jou de statussen zijn, dan kan je die gebruiken.
@@SmartHomeJunkie Ooit één keer (zijn nochtans Philips Hue...) en dat was de laatste keer : voortaan laat ik steeds veiligheidshalve een timer starten die het licht nogmaals dichtdoet indien het niet zou uitgegaan zijn via de "Clear gedurende 5 minuten". Opvangen van worst case scenario :-)
@@christian1603 Dat lijkt me een uitstekende oplossing!
can't follow this. there is no trigger id and everything look different.
The trigger ID is under the three dots at the trigger field nowadays.
please to much bass in microphone
Thank you for your feedback!