Use the API on your Google Home to view things like alarms, music playing, volume,...
I'm not sure if this is common knowledge but I've never came across anything while searching Google.
Basically, you can call the API on your Google Home to get info about things like alarms in JSON format. For example, I'll use this to display current alarms and timers on a screen in the same room as the Google Home.
How to do it: First you'll need to find the IP address of your Google Home. You can use something like Fling (Android app) for this or just log in to your router. Then make a simple GET call like this: http://192.168.X.XX:8008/setup/assistant/alarms. Change 192.168.X.XX to your IP.
This will give a response like this:
{"alarm":[{"date_pattern":{"day":15,"month":1,"year":2018},"fire_time":1515995400000.0,"id":"alarm/5a77ecee-0000-24fd-9251-001a114cb4cc","status":1,"time_pattern":{"hour":6,"minute":50,"second":0}}],"timer":[]}
I'm not sure what other calls you can make but I'm pretty sure you should be able to call everything that the Google Home App is able to display (i.e. current music). You can use an app like Packet Capture and hook it into the Google Home app to find out about other API calls it makes.
Hope this was useful to someone!
Edit: While looking a bit more into the API, I found the following values:
{"ble_supported":true,"bluetooth_audio_sink_supported":true,"bluetooth_audio_source_supported":false,"bluetooth_supported":true}
Could this mean using the Google Home as bluetooth source instead of bluetooth sink is or will be possible?
Posted Jan 15, 2018, 1:11 AM UTC · edited
Awesome! Never thought of checking this. Will try to find more endpoints when I get back home.
Nice! Let me know if you find any!
Goodie! Found some and they seem useful. Going to create a repo on GitHub to document this. Anyone willing to contribute, please let me know
Edit: Worked on this: https://rithvikvibhu.github.io/GHLocalApi/ Can you guys test it out and add more stuff? u/henrylim96 u/TurnTM u/insureventures u/roflcoopter1
Wow good find! Super useful for me as I am building a smart digital clock using Android Things! (currently able to show what song is casting) https://medium.com/@limhenry/diy-android-things-smart-digital-clock-e6e79d26a3bb
(update) * to get what song is casting, you actually can use Google Cast API to do that. It works on all cast-supported devices. And you can use that API to get other info like current volume, set volume, next track, previous track, etc.
and this is the method i am using for the digital clock: https://stackoverflow.com/questions/38269861/android-get-current-playing-media-on-chromecast / https://developers.google.com/cast/v2/android_sender
since google home is also a chromecast device, some endpoints are actually same as the "normal chromecast", you should able to find some from google :)
You are godlike and I want to kiss you.
...in a totally Platonic, you are an awesome nerd sort of way. No hobo.
Definitely! I'll help out!
Nice. Im in.
[deleted]
I'd also like to contribute!
More HTTP endpoints (but not really useful) : https://www.iot-tests.org/2017/09/ok-google-home-what-about-privacy/
and u can get gHome device info: http://<ip_address>:8008/setup/eureka_info?params=version,name,build_info,device_info,net,setup,settings,opt_in,opencast,multizone&options=detail
since the request between the google home app and google home is not encrypted, i think we should able to use wireshark to get all possible http endpoints/url right?
Thanks! I see more in my logs than that. New features since 9-2017 I think.