cancel
Showing results for 
Search instead for 
Did you mean: 

Is it Possible for the okGoogleevent trigger in home script lab to lock to a certain device

Jack20
Community Member

I wanted to make a script where i can have my living room lights turned on seperatly by saxing different voice commands and I wanted to solve that via different okgoogleevent triggers then i realisied i cant say its for just one certain device and it would go for every device so if i for example say the phrase hey google turn on leds it would turn on the living room leds only so if I say that in another room it will also only turn on the living room leds i saw that you can add device: to a okgoogleevent trigger but it just throws errors anyone knows a workaround or maybe google can implement this feature idk

1 Recommended Answer

sipriyadarshi
Solutions Expert
Solutions Expert

Hello @Jack20 ,

Thanks for reaching out to us with your issue. What you are requesting is possible through the automation in the consumer script editor. You can make use of the okgoogle starter (https://developers.home.google.com/automations/schema/reference/entity/assistant/ok_google_event#exa...) and issue an onOff command (https://developers.home.google.com/automations/schema/reference/entity/sht_device/on_off_command#exa...) to an array of devices of their choice.

I don't recommend that you create an automation though because what you are requesting is already available without use of an automation template. You can say hey google turn on the living room lights and the lights in the living room will turn on. Likewise you can also say hey google turn off the office lights and it will turn off all of the lights in the office. This is already supported natively through google assistant.

View Recommended Answer in original post

3 REPLIES 3

sogo188
Community Member

sipriyadarshi
Solutions Expert
Solutions Expert

Hello @Jack20 ,

Thanks for reaching out to us with your issue. What you are requesting is possible through the automation in the consumer script editor. You can make use of the okgoogle starter (https://developers.home.google.com/automations/schema/reference/entity/assistant/ok_google_event#exa...) and issue an onOff command (https://developers.home.google.com/automations/schema/reference/entity/sht_device/on_off_command#exa...) to an array of devices of their choice.

I don't recommend that you create an automation though because what you are requesting is already available without use of an automation template. You can say hey google turn on the living room lights and the lights in the living room will turn on. Likewise you can also say hey google turn off the office lights and it will turn off all of the lights in the office. This is already supported natively through google assistant.

Hi @sipriyadarshi 
I have a specific action that is not supported by the normal "OK Google" but the action is exposed by scripting. I am wanting to achieve a similar thing where I say "OK Google - Turn off MY aircon" and it will go ahead and close off just my vent.
I can make this happen in script, one for each room speaker, but as far as I can tell the struct for assistant.event.OkGoogle query does not accept device? 
Is this correct? Any work arounds that you know of that can avoid the user having to say the specific device name? Thanks. AA