cancel
Showing results for 
Search instead for 
Did you mean: 

Motion Detector suppress as action

PrantlMarkus
Community Member

Wish:

I enter via Gemini the voice command "TestCommand", i've programmed an automation with the script editor that has the starter -> assistant.event.OkGoogle with the trigger "TestCommand".

The action is to turn of our Garden Lights.

 

The Garden Light are also combined with our motion detection in the garden. Which turns the lights off, when 5min nobody has moved.

 

So, when i give the command "TestCommand" the lights should stay on, till i give the command "Ok Google, turn off garden lights". After 5min the garden lights turn off, because nobody has moved.

 

Can i suppress the motion detectors with an action "suppressFor:" or is this only working at the starters.

Or Somebody have an work around for me.

 

Thanks Google to all this possibility they gave us for FREE!!!!!!

Keep on improving!

Markus Prantl
1 Recommended Answer

GoogleDevForum
Solutions Expert
Solutions Expert

Unfortunately, the suppressFor action can typically only be used within triggers (such as a device status change or event) and may not apply directly to the kind of situation you're describing where you need to suppress a motion sensor in real-time after an action.

To prevent your garden lights from turning off automatically after the "TestCommand" while still using motion detection, you can create a temporary override.

  1. Create a Virtual device: In your smart home system (like Home Assistant), create a virtual switch or a helper entity. This will act as a flag to control the motion sensor's behavior.

  2. Modify Motion Sensor Automation: Adjust your motion sensor automation to include a condition check. If the helper entity is in the "on" state, the automation should skip the action that turns off the lights.

  3. "TestCommand" Action: When you say "TestCommand," your Google Home script should turn the helper entity "on." This effectively disables the motion-triggered light-off action.

  4. "Turn Off Lights" Action: When you say "Ok Google, turn off garden lights," the script should turn the helper entity "off." This restores the normal behavior of the motion sensor automation.

This approach allows you to temporarily override the motion sensor's default behavior, keeping the lights on after the "TestCommand" while still utilizing motion detection for automatic shut-off when you're not actively interacting with the system.

View Recommended Answer in original post

3 REPLIES 3

GoogleDevForum
Solutions Expert
Solutions Expert

Unfortunately, the suppressFor action can typically only be used within triggers (such as a device status change or event) and may not apply directly to the kind of situation you're describing where you need to suppress a motion sensor in real-time after an action.

To prevent your garden lights from turning off automatically after the "TestCommand" while still using motion detection, you can create a temporary override.

  1. Create a Virtual device: In your smart home system (like Home Assistant), create a virtual switch or a helper entity. This will act as a flag to control the motion sensor's behavior.

  2. Modify Motion Sensor Automation: Adjust your motion sensor automation to include a condition check. If the helper entity is in the "on" state, the automation should skip the action that turns off the lights.

  3. "TestCommand" Action: When you say "TestCommand," your Google Home script should turn the helper entity "on." This effectively disables the motion-triggered light-off action.

  4. "Turn Off Lights" Action: When you say "Ok Google, turn off garden lights," the script should turn the helper entity "off." This restores the normal behavior of the motion sensor automation.

This approach allows you to temporarily override the motion sensor's default behavior, keeping the lights on after the "TestCommand" while still utilizing motion detection for automatic shut-off when you're not actively interacting with the system.

PrantlMarkus
Community Member

Thanks for that answer, i made the same work around with the google playground outlet. Not the finest way for a solution but it works. Maybe YAML will allow variables in the future.

Markus Prantl

PrantlMarkus
Community Member

Okay i just found that you can add "devices" to the google playground. So i have the possibility to use "variables"

Thats really fine. Now i can create outlets with the right names and use it as booleans.

Markus Prantl