10-21-2024 01:19 AM
Hi all,
I've just recently installed a smart light switch in my garage and now want to add this into an automation which opens my garage door (which is on a smart relay)
I have a standard automation set up in the app to open the garage door when I say a certain phrase, but now I'd like to add the light to this. My issue is, I'd only want the light to come on if it's executed between sunset and sunrise.
Is this possible?
If so, do I need to have two scripted automations (one to open if sunrise condition is not met and one to open and turn light on if it is)?
Would some kind person assist me with an example?
Also, as an aside, is there a way to create a script to require a verbal code before executing an action?
Answered! Go to the Recommended Answer.
10-22-2024 11:16 AM - edited 10-22-2024 11:19 AM
@shanecb, Using the web based google home script editor (https://home.google.com/home), you would create a 2nd script that would turn the light on when the garage door is opened. Below is a sample script that I just did that will turn the light on in my sunporch when the heater in the sunporch is turned on but only after sunset and before sunrise.
metadata:
name: Turn on light when the heater is on
description: Turn on light when the heater is on
automations:
- starters:
- type: device.state.OnOff
device: Heater - Sunporch #replace this with your garage door relay name
state: on
is: true
condition:
type: time.between
after: SUNSET
before: SUNRISE
actions:
- type: device.command.OnOff
devices:
- Porch overhead - Sunporch #replace this with your garage light name
on: true
In addition, as far as I know, home automations/scripts won't ask for or wait for further instructions once activated.
10-22-2024 11:16 AM - edited 10-22-2024 11:19 AM
@shanecb, Using the web based google home script editor (https://home.google.com/home), you would create a 2nd script that would turn the light on when the garage door is opened. Below is a sample script that I just did that will turn the light on in my sunporch when the heater in the sunporch is turned on but only after sunset and before sunrise.
metadata:
name: Turn on light when the heater is on
description: Turn on light when the heater is on
automations:
- starters:
- type: device.state.OnOff
device: Heater - Sunporch #replace this with your garage door relay name
state: on
is: true
condition:
type: time.between
after: SUNSET
before: SUNRISE
actions:
- type: device.command.OnOff
devices:
- Porch overhead - Sunporch #replace this with your garage light name
on: true
In addition, as far as I know, home automations/scripts won't ask for or wait for further instructions once activated.
10-22-2024 12:41 PM
Thank you very much, that works perfectly.
10-22-2024 03:47 PM
Hi @shanecb,
Thanks for bringing your concern to our attention and posting it in the community. I apologize for the inconvenience you were having with the Google Home script.
Let us know if you have any other questions about it. If you have inquiries about any Google Nest products, don’t hesitate to ask and feel free to post them.
In addition, thanks to @GBD for your quick and easy-to-understand response.
Warm regards,
Catheryn.