1

I once thought what if I could create a virtual (software) light. That is, I create a software bridge to turn on things that do not understand Google Assistant. See the illustration below.

[User]---("Turn on the light!")---->[Google Home/Assistant]---("Hey, you said you are a light, right? Turn yourself on.")---->[My virtual light software]---("Yeah... thaaaat's right, I'm a light... (NOT!)" and sends some proprietary signal to turn on a device)--->[A dumb device].

Smart bulbs from famous companies can be turned on with such a command, but the only thing I could achieve was "Hey Google, tell X" and then saying "turn on Y", which is not as convenient as saying just "Hey Google, turn on Y". I assumed it was impossible for me to make such a virtual light software and gave up.

Now, I have read a software development request from a (presumably small) light bulb company. It seems that they already have an Android app to turn on their light bulb or to change the brightness of it, but they want to let it be controlled using Google Assistant. Does this company need a special permission from or a contract with Google?

If there is a way to implement such feature without those, doesn't it mean that I could also create a virtual light software to turn on other things (like my cheap, dumb electronic fan, which I can already turn on with my simple app by sending an IR code)?

Prisoner
  • 49,922
  • 7
  • 53
  • 105
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135

1 Answers1

3

it's actually really easy for any third-party developer or company to get started with integrating their Smart Home devices with the Google Assistant.

The documentation shows how to get started, and there's a sample which lets you create virtual lights, vacuums, and a few other devices.

Everything works over cloud integrations, not directly through IR signals or any other local wireless protocol. If you have one of these, you will need to have an intermediate hub that connects to a cloud and processes requests.

Basically you will need to handle three different intents. When the user links their Google account to your cloud service, your service will get a SYNC intent. You will have to respond with the devices for that user, which is in a JSON payload.

When the user gives a direct command, your cloud service will get an EXECUTE intent with a JSON payload. From here, you will need to send a message to your device/hub with the result. If you want to turn a device on, you will get a command of type OnOff with the key-value pair on: true.

The Smart Home docs show a handful of devices that are supported, such as lightbulbs. For types that aren't supported, you can pretend your whatever is a light. As long as your device is marked with the supported traits, the grammars for turning on and off will work regardless. (Although saying "turn on the lights" may result in an unexpected user experience)

Nick Felker
  • 11,536
  • 1
  • 21
  • 35