8

Using IFTTT, I am able to send POST REST requests, which then it is able to flip the lights on/off on my Raspberry Pi.

I can make a GET REST request (using postman) to get the value of the light, but I can't seem to figure out how to get google home/assistant to read that value for me.

Value returned from the GET REST request:

{
    "id": "sw1",
    "state": "off",
    "name": "Pi light"
}

This is the flow:

Question:

"Hey Google, is the light on or off?"

Google assistant answer:

"The light is turned on" or "The light is turned off"

I have searched everywhere, tried a couple things using IFTTT webhooks, but I just don't seem to be able to connect the dots.

How can this be achieved?

migrated from stackoverflow.com Jan 15 '18 at 15:21

This question came from our site for professional and enthusiast programmers.

  • 1
    How do you imagine this working? What have you done to link Google Assistant to the Pi? Is it through IFTTT? Can Google Assistant do other IFTTT actions? – Heath Raftery Jan 29 '18 at 20:25
  • 1
    You can add Google assistant on IFTTT (then-Field) on the IFTTT android app so it automatically fetch data from internet and triggers assistant accordingly. – Adil Saju Sep 27 '18 at 12:24
2

Well, it can be done by switching to Alexa ;-)

I'm in a similar fix: I have a weather station that can report current conditions with a JSON message in response to an HTTP request. I was able to write an Alexa skill that could fetch the message and compose a spoken response.

I picked up a Home Mini during the Christmas sale because I've read it does better at things like web searches, and am trying to do something similar with it.

As far as I can tell, that can't be done with IFTTT: you can send commands, but there's no "then that" service that will query and speak a response.

It looks like it can be done with Google Actions, but I can't be certain yet: I've had a hard time finding simple examples or tutorials to learn and/or crib from. It's annoying when makers name their products with common words like "home" or "actions": it's a request to the gods to make finding info about them as difficult as possible.

Look into the "Actions SDK" on Google Actions. Avoid Dialogflow: it's for making really complex interactions, and will make an attempt at a simple one complicated. Not that the SDK is all that simple, but it looks like the only option at the moment.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.