Sacriledge, I know, but HA doesn’t have to do everything. Sounds as if you already have SmartThings - if that makes it “super easy”, why not let Smartthings do it? No need to re-invent the wheel.
I use two automation too for this purpose. The second stays on for 10 minutes AFTER the last movement. Well actually between 10 and 12 minutes since the sensor only updates every 2 minutes once motion is detected.
This is a fairly basic thing that any automation system should be able to do though. If HA can’t do it properly, it should be pretty high on the “it should be implemented immediately” list.
Personally I find it easier to separate the turn on and turn off functions into different automations. Sure you wont get any plaudits for elegant solutions but it’s easier to maintain and implement and can give you greater flexibility.
I wish that worked…here is my attempt to make that behave at a basic level and it fails.
alias: Test Office On
description: ''
trigger:
- type: motion
platform: device
device_id: db12673d26ebb3845160a1463b163cc6
entity_id: binary_sensor.samjin_motion_3aa50b01_ias_zone
domain: binary_sensor
condition: []
action:
- domain: light
entity_id: light.office_fan
device_id: d2da70e04e94b64ae2e6f4a1942f5345
type: turn_on
mode: single
alias: Test Office Off after 2 min no motion
description: test
trigger:
- device_id: db12673d26ebb3845160a1463b163cc6
entity_id: binary_sensor.samjin_motion_3aa50b01_ias_zone
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
platform: device
type: no_motion
condition: []
action:
- domain: light
entity_id: light.office_fan
device_id: d2da70e04e94b64ae2e6f4a1942f5345
type: turn_off
mode: single
This correctly turns on the light with motion. Then it promptly turns the light off after 2 minutes even with motion. Sometimes, when the light is on and it re-detects motion, it decides to turn off the light.
All I want is a simple way to turn a light on with motion, leave it on until motion is NOT detected (with a pad added to that) and to stay on if motion is re-detected during the pad time. If it turns a light on with motion and then the motion goes away and comes back while the light it still on, I do not want it to turn off the light. I’ve never had such trouble with an automation system doing this simple thing.
Note that your setup references something called “service light.turn_on”. This gives an error on my HA.
There’s a blueprint to turn a light on from motion and turn it off after a period of no detection. If detection is picked up during the on period the timer off resets.
This works fine as long as motion remains detected. Once motion drops and reappears in the 120 seconds, the light does not stay on, instead it immediately turns off…and from then on the automation works in reverse…
What I do is have one automation which is triggered from the motion sensor, this in turn starts a 5 min timer and turns on the lights. I then have a second automation that is triggered off of the expired timer to turn the lights off. This is flexible, there can be multiple ways to set the timer and when it goes off the lights will always be turned off. Just a suggestion…
The biggest issue I was having was testing with a light being controlled through a Bond Hub. There is obviously something not quite right with the Bond integration in relation to automation.
Understood. I tried a bunch of different ways to do the motion lights and the timer was by far the best solution for me. It put me in a better mindset with the event driven nature of HA. Best of luck!
Because I migrated everything from ST to HA, except the storage under the stairs. My ST hub exists only because a door switch and a lamp. I still have my ST hub connected because of this automation.
Child opens the door and triggers de door switch, turning the light on. Almost never closes the door, and the light stays on.
On ST there’s a condition to keep it on for maximum 10 minutes.