11-22-2023 03:06 PM
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
Answered! Go to the Recommended Answer.
12-04-2023 11:58 AM
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.
11-25-2023 11:05 AM
12-04-2023 11:58 AM
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.
02-25-2024 06:25 PM
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