
The automation will then pause at that point for 2 minutes. The easiest, is to simply add a delay after the light is turned on (I think it is called “wait for time to pass” now in the list of things you can select for an action). There are a few ways to get the light to turn back off after 2 minutes. You don’t need the for at all in your trigger since you aren’t using it. Happy to accept any pointers if there is a way to make do it all in one single automation. Not sure if this is the most efficient or elegant way but it does seem to work the way I expect it to now.

id: '1637523993802'Īlias: Turn On Rear Garden Security Light when Motion is Detected (Home)Īlias: Turn Off Rear Garden Security Light when no Motion is Detectedĭevice_id: 154fde006f6a7da72fc58ea8f3538826
#Turn off motion alarm on vmeyesuper code#
One automation will turn the light on, the second will turn the light off after no motion has been detected, here is the Yaml code just in case anyone is interested although I built the automation using the UI. I’m wondering how other people have achieved this in HA as I guess this would be quite a common automation that people are running I could set up a second automation for this part I guess but feels like it should all be part of the same script to me like it was in WebCore, although in WebCore it is 2 separate branches of code with 2 separate if statements. Motion is detected and the light comes on fine but I am missing the part where it turns off after 2 minutes if motion is no longer detected. I assume above is expecting motion to be detected for 2 minutes before the light will switch on so removed it to look like below: - id: '1637523993802' code is below: - id: '1637523993802'Įntity_id: binary_sensor.hue_outdoor_motion_sensor_1_motion I thought I had the solution but turns out the solution was only for the colour temperature, I changed the trigger to state which seemed works, I then added the time values and it prevents it from working.

I did find this piece of code: from: 'on'īut not sure where it should be placed (I am nearly 2 weeks into home assistant) and been reading lots but really struggling with building automation and editing Yaml (Happy to be pointed in the direction of where I can read more about yaml and what values you can place for what devices\sensors. I have had a search around and read a lot of the documentation but cannot see what I am looking for.
#Turn off motion alarm on vmeyesuper how to#
Unable to find the time setting to turn the light off when no motion has been detected for 60 secondsĪnother issue I had was when I set 30 minutes to sunset and 30 minute past sunrise the automation stopped working, so I removed this part but would like to know how to achieve that too.ĭevice_id: f55ee4aa6c897bd26753bed686c2059bĮntity_id: binary_sensor.hue_outdoor_motion_sensor_1_motion_2Įntity_id: sensor.hue_outdoor_motion_sensor_1_light_level_2ĭevice_id: 355588737af8c3aa202dc270655e88cb.

