cancel
Showing results for 
Search instead for 
Did you mean: 

Device condition type

beansgum
Community Member

I want to write a script that opens or close a curtain depending on which google nest mini device received the command but I cant seem to find the command type for that, any ideas? 

I wrote an example snippet of what I want to achieve those this piece of code isnt valid.

 

metadata:
  name: Curtain Automation
  description: Opens the curtain in the living room or master bedroom based on your location when you say "Hey Google, open the curtain".

automations:
  starters:
    - type: voice
      phrase: "Hey Google, open the curtain"

  conditions:
    - type: location
      is: Living Room
    - type: location
      is: Master Bedroom

  actions:
    - type: conditional
      condition:
        - type: location
          is: Living Room
      actions:
        - type: device.command.OpenClose
          open: true
          devices: Living Room Curtain
    - type: conditional
      condition:
        - type: location
          is: Master Bedroom
      actions:
        - type: device.command.OpenClose
          open: true
          devices: Master Bedroom Curtain

 

2 Recommended AnswerS

armen_dpe
Solutions Expert
Solutions Expert

Google Assistant currently doesn't support a way to directly target the specific Nest Mini device that received the voice command within the Script Editor. 

Use a single Nest Mini and assign different phrases to each room.  For example, for Living Room: "Hey Google, open the living room curtain"

View Recommended Answer in original post

beansgum
Community Member

- type: assistant.event.OkGoogle
eventData: query
is: "close the curtains"
devices: Office speaker - Office

can devs please add a device struct to the  assistant.event.OkGoogle event, this will solve this issue.

View Recommended Answer in original post

4 REPLIES 4

armen_dpe
Solutions Expert
Solutions Expert

Google Assistant currently doesn't support a way to directly target the specific Nest Mini device that received the voice command within the Script Editor. 

Use a single Nest Mini and assign different phrases to each room.  For example, for Living Room: "Hey Google, open the living room curtain"

beansgum
Community Member

I dont want to have to specify each room or curtain, english is not my first language and I twist my tongue when prompting long sentences 

beansgum
Community Member

Whenever I say "Hey Google, turn off the spot light" it sometimes turns off the spot light in another room. Do I have to say "Turn of the living room spot light" while I am currently in the living room because that is a really weird way to prompt

beansgum
Community Member

- type: assistant.event.OkGoogle
eventData: query
is: "close the curtains"
devices: Office speaker - Office

can devs please add a device struct to the  assistant.event.OkGoogle event, this will solve this issue.