Search code examples
mqttwebhooksgoogle-home

How to send direct command from Google Home to custom smart device without app name?


I try to build my custom IoT device that will be controlled via Google Home device, and serve people with disabilities.

The device itself is Tiva C Launchpad, that I program from scratch, meaning I will have a full control on it.

In my vision, the user wil say something like: "Ok Google, press play button", and as a result, the Google Home device will send a direct command of press_play_button to the IoT device, preferably via the local network.

I found the Google Action SDK, alongside with the Local SDK extention, but if I understood correctly, I have to be in the app mode first ("OK Google, play {app_name}") before pronouncing the action I want, which is inconvenient.

Is there any way to achieve my requirement? If not, I may give up on the local network control, and use sort of a webhook to send HTTP request to my smart device, and in that case I wonder if MQTT will be more suitable.

Thanks.


Solution

  • The Local SDK is an extension to the Smart Home API. If your device matches up with the device types and traits that the Smart Home API supports then you can use that to control your device.

    It has support for media players so things like play/stop should be possible.

    I have build generic Smart Home control using MQTT to reach the device, but you have to provide a HTTP endpoint for the Google System to interface with. This take a little thought as you have to map MQTT asynchronous approach to HTTP's synchronous nature.