2

I recently made a basic Google Smart Home app for one of my devices. I was wondering if there was a way to query my device for information such as energy consumption. For example, if I asked "How much has energy has my heater used today?", would it be possible to get a real-time value for this (from my fulfillment)?

HappyXD
  • 61
  • 8

1 Answers1

1

The answer to your question specifically is no. Traits that are not supported in the Smart Home documentation will not be available to query in the Home Graph.

However, you can use the Actions on Google platform to build a separate fulfillment which can provide some of these custom user queries. The two can be developed as separate projects but using the same backend.

You: "OK Google, turn up the heater to 80 degrees"

Google Assistant: "Okay"

You: "OK Google, ask My Heater how much energy you've used today"

Google Assistant: "Getting your heater."

Heater: "Today you have used 10 energy units. That's 5% more than yesterday."

Nick Felker
  • 11,536
  • 1
  • 21
  • 35
  • Ah, thanks alot for your response. I was hoping for a method of doing this without creating a separate dialogFlow project. Nevertheless, if I were to take that approach, how would my backend be able to identify the user? I am assuming that there are many users of the app all saying "ask my heater how much energy i've used today?" Do I have to implement "required sign-in" for the intent? I dont have it enabled at the moment and I can't really see any identifying information. All your help is much appreciated. – HappyXD Jan 18 '18 at 02:49
  • Yes you would need to use the same account linking setup that you use for your Smart Home fulfillment. – Nick Felker Jan 18 '18 at 04:15
  • How would a user go through the account linking process? Lets say for example I enabled account linking for my actions on google dialogflow project. I've only been accessing my test app by saying "ask test app to ...", would the user go through the account linking via voice? – HappyXD Jan 19 '18 at 04:31
  • No for the initial setup they'd need to use a screen to authenticate your service with the Google Assistant. After that each invocation will handle the token refresh behind the scenes. – Nick Felker Jan 19 '18 at 21:35
  • that sucks, google must add this feature soon with graph and card reporting components to show energy consumption – Inzamam Malik Aug 01 '18 at 12:27