cancel
Showing results for 
Search instead for 
Did you mean: 

Script to turn lights on and off

RobotIAmNot
Community Member

I am trying to write a script that will turn my flash my floodlights on and off every second for 2 minutes when I issue the voice command "lights on and off".

I keep getting a validation error 'Required field for Struct is missing. Expected subfields: [type]."  on the line 

   - repeat:

metadata:
name: Lights on and off
description: Turn the floodlight on and off every second for 2 minutes
automations:
- starters:
- type: assistant.event.OkGoogle
eventData: query
is: Lights on and off

actions:
- repeat:
times: 60
actions:
- type: action.devices.commands.OnOff
devices: ["Floodlight - ADU"]
parameters:
on: true
- type: time.delay
duration: 1s
- type: action.devices.commands.OnOff
devices: ["Floodlight - ADU"]
parameters:
on: false
- type: time.delay
duration: 1s

 

Can anyone see what I am doing wrong?




1 REPLY 1

Nes58
Community Member

I don't think -repeat is an supported option