cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Automations using assistant.event.OkGoogle

JohnSta
Community Member

Should this work? I have two starters, both using assistant.event.OkGoogle. Whichever one I place first responds correctly. Trying to invoke the 2nd one just gets me a "bong".

(update. this morning it's not recognizing either one. sometimes playing music!)

metadata:
name: Office three
description: Scripted automation

automations:
- name: test 1
starters:
- type: assistant.event.OkGoogle
eventData: query
is: "Test Office Off"
actions:
- type: assistant.command.Broadcast
message: Test 1
devices: Office speaker - Office

- name: test 2
starters:
- type: assistant.event.OkGoogle
eventData: query
is: "Test Office On"
actions:
- type: assistant.command.Broadcast
message: Test 2
devices: Office speaker - Office

3 REPLIES 3

Bawt
Community Member

I'm just a user and I just got access to scripts a few days ago but in every example google provided the structure of scripts with several automations is the same:

metadata:
name:
description:

automations:

- starters:
- type:

condition:
type:

actions:
- type:
I don't think -name: test 2 is the expected structure. You can try this code and see if it works:

metadata:
name: Office three
description: Scripted automation

automations:
- starters:
- type: assistant.event.OkGoogle
eventData: query
is: "Test Office Off"

actions:
type: assistant.command.Broadcast
message: Test 1
devices: Office speaker - Office

- starters:
- type: assistant.event.OkGoogle
eventData: query
is: "Test Office On"
actions:
type: assistant.command.Broadcast
message: Test 2
devices: Office speaker - Office

 

JohnSta
Community Member

Thank you for trying to help.

I've tried it both with and without the - name. No difference. Also, there is an example in their documentation of multiple automations which uses this structure, the only significant difference being that the example is using scheduled events as starters instead of OkGoogle.

Alphabet
Community Member

I opened a similar thread a few days ago where a Googler that's active on here said they'll look into it. Please look at that issue briefly and give it kudos if it's the same. Thank you!