cancel
Showing results for 
Search instead for 
Did you mean: 

Use google assistant to switch a lamp on and off

CBTekie
Community Member

Can I use google assistant to control a "Smart Life" plug.  I want to use the plug to control a lamp.    To come on at sunset  - off at midnight - then on again at say 2am  off at say 3am  and finally off at sunrise.  The smart kife app allows you to automate at sunset and sunrise or schedule on and off times but you cannot combine the two "scenes" as they are referred to. Google assistant can be linked to the smart life app.  Any suggestions on how I can do this?

 

1 REPLY 1

Pitsom
Community Member

Hi, i think you have to write a script.

Just an Example:

metadata:
  name
: Scheduled light
  description
: Turn the light on and off at specific times
automations
:
 
- starters:
     
- type: time.schedule
        at
: 1:00 PM
    actions
:
     
- type: device.command.OnOff
        devices
: Desk light - Office
        on
: true
 
- starters:
     
- type: time.schedule
        at
: 1:05 PM
    actions
:
     
- type: device.command.OnOff
        devices
: Desk light - Office
        on
: false