04-22-2025 01:18 AM
Currently I can tell Google to turn on a light for a set time: "Hey Google turn on the bedroom light for ten minutes" and it works fine.
Is it possible to set an automation to do the same? For example so I can say "Bed 10" and the bedroom light goes on, and ten minutes later goes off, or "Bed 30" and it's on for 30 minutes.
04-22-2025 03:41 AM - edited 04-22-2025 04:17 AM
What would be even better if the custom phrase was "turn on light for 10 minutes" and you could say for example "Hey Google, Light Ten" to any speaker in a Room and only that light/s would turn on for 10 minutes.
But from another Room's speaker you would have to state the light's unique name or the "Light in [Room name]"
04-22-2025 06:29 AM - edited 04-22-2025 06:31 AM
Use something like this in the Google Script Editor (you need to join the public preview if you haven't already).
metadata:
name: Bed 10
description: Turn on bedroom light for 10 minutes
automations:
- starters:
- type: assistant.event.OkGoogle
eventData: query
is: Bed 10
actions:
- type: device.command.OnOff
devices:
- Ceiling light - Bedroom
on: true
- type: time.delay
for: 10min
- type: device.command.OnOff
devices:
- Ceiling light - Bedroom
on: false
04-25-2025 01:35 AM
Thanks! That worked perfectly.