cancel
Showing results for 
Search instead for 
Did you mean: 

turn on light for a set time

iPinque
Community Member

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.

3 REPLIES 3

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]"

MarciaMellow
Community Member

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

 

Thanks! That worked perfectly.