Package: ghome
ghome: Simple CLI for Google Home & MiniThis is an application of the google home API Blueprint reportedhere. While a lot of the end points maybe of interest to quite a few people, I used the ones I use most and I thought would be most useful and created a command line tool for you to search for a Google home mini device and then use this tool to interact with it and perform actions as needed. A large thanks goes to bothrithvikvibhufor the blueprint and finally toleikoiljafor excellent work on implementingglocaltokens.Table of contentsInstallationGetting startedghome Simple CLI for Earth Engine Uploadsauthdevice_listdevce_inforebootalarm_listalarm_volumealarm_deletebluetooth_statusbluetooth_scanbluetooth_pairedbluetooth_discoverywifi scansaved_networkInstallationThis assumes that you have native python & pip installed in your system, you can test this by going to the terminal (or windows command prompt) and trying. On a windows machine , install pycryptodomex first by using theinstructions hereThis also includes following importantlyDownloadBuild Tools for Visual Studio 2019. In the installer, select the C++ build tools, the Windows 10 SDK, and the latest version of MSVC v142 x64/x86 build tools.pythonand thenpip listIf you get no errors and you have python 3.6 or higher you should be good to goTo installghome: Simple CLI for Google Home & Miniyou can install using two methods.pip install ghomeor you can also trygit clone https://github.com/samapriya/ghome.git
cd ghome
python setup.py installFor Linux use sudo or trypip install ghome --user.The advantage of having it installed is that ghome can be executed as any command line tool. I recommend installation within a virtual environment. .Getting startedAs usual, to print help:usage: ghome [-h]
             {auth,device_list,devinfo,reboot,alarm_list,alarm_volume,alarm_delete,bstat,bscan,bpaired,bdisc,wscan,saved_network}
             ...

Simple Google Home Mini Client

positional arguments:
  {auth,device_list,devinfo,reboot,alarm_list,alarm_volume,alarm_delete,bstat,bscan,bpaired,bdisc,wscan,saved_network}
    auth                Auth to get Master Token: Use only once
    device_list         Print device list for Google Home devices
    devinfo             Provides Device Info based on device name or IP
                        address
    reboot              Reboot or Factory Reset a google home device using IP
                        address or Name
    alarm_list          Get alarm list on a google home device using IP
                        address or Name
    alarm_volume        Set alarm volume on a google home device using IP
                        address or Name
    alarm_delete        Delete all alarms on a google home device using IP
                        address or Name
    bstat               Bluetooth status on a google home device using IP
                        address or Name
    bscan               Bluetooth scan for devices on a google home device
                        using IP address or Name
    bpaired             Get Bluetooth paired devices on a google home device
                        using IP address or Name
    bdisc               Change Bluetooth discoverability on a google home
                        device using IP address or Name
    wscan               Wireless scan on a google home device using IP address
                        or Name
    saved_network       Get saved wifi networks on a google home device using
                        IP address or Name

optional arguments:
  -h, --help            show this help message and exitTo obtain help for specific functionality, simply call it withhelpswitch, e.g.:ghome wscan -h. If you didn't install ghome, then you can run it just by going toghomedirectory and runningpython ghome.py [arguments go here]ghome Simple CLI for Earth Engine UploadsThe tool is based on currently unofficial API blueprint published for the device and is subject to change in the future.authThis tool is originally based on the implementation of glocaltokens from thegist. This should be used only once as suggested on theglocaltokens siteand is to avoid Google delinking devices or anything else. The auth tool create a config-file and write a master authentication token which can be used by the tool to then generate local device tokens as they expire every 24 hours.ghome authdevice_listThis tool generates a list of all google home devices connected to your network and prints the name and ip address of each. This is a quick way to check specific name or ip address to use for a device.ghome device_listdevice_infoThis tool uses device name or ip addrss to get all information available for said device and prints it out as a json object.(venv3) Î» ghome devinfo -h
usage: ghome devinfo [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome devinfo --ip 192.168.1.10orghome devinfo --name "Kitchen Speaker"rebootThis is a powerful tool since the only current way of rebooting a device is to physically unplug and plug the device back in. This also allows you to do a factory reset soUse reset with CAUTION.usage: ghome reboot [-h] [--ip IP]

optional arguments:usage: ghome reboot [-h] [--action ACTION] [--ip IP] [--name NAME]

optional arguments:
  -h, --help       show this help message and exit

Required named arguments.:
  --action ACTION  reboot or reset the device

Optional named arguments:
  --ip IP          Google Home IP Address
  --name NAME      Google Home Device NameSimple usage to rebootghome reboot --action reboot --ip 192.168.1.10ghome reboot --action reboot --name "Kitchen Speaker"or to factory resetghome reboot --action reset --ip 192.168.1.10ghome reboot --action reset --name "Kitchen Speaker"alarm_listThis tool will simply list all alarms currently on your device including date , time and time zone.usage: ghome alarm_list [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome alarm_list --ip 192.168.1.10orghome alarm_list --name "Kitchen Speaker"alarm_volumeSet the alarm volume for a device, this only changes the alarm volume and nothing else. Alarm volumes can be set for values 0-1 which represents volume from 0-100% so 0.1 means 10% volume and so on.usage: ghome alarm_volume [-h] [--volume VOLUME] [--ip IP] [--name NAME]

optional arguments:
  -h, --help       show this help message and exit

Required named arguments.:
  --volume VOLUME  between 0-1 represents 0-100

Optional named arguments:
  --ip IP          Google Home IP Address
  --name NAME      Google Home Device NameSimple usageghome alarm_volume --volume 0.1 --ip 192.168.1.10orghome alarm_volume --volume 0.1 --name "Kitchen Speaker"alarm_deleteDelete all alarms on a google home device based on ip or name.usage: ghome alarm_delete [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome alarm_delete --ip 192.168.1.10orghome alarm_delete --name "Kitchen Speaker"bluetooth_statusThe bluetooth status prints whether the device discovery is enabled, whether scanning is enabled and whether it is connected to a device.usage: ghome bstat [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome bstat --ip 192.168.1.10orghome bstat --name "Kitchen Speaker"bluetooth scanThis prints bluetooth status, including is possible bluetooth device name and mac nameusage: ghome bscan [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome bscan --ip 192.168.1.10orghome bscan --name "Kitchen Speaker"bluetooth_pairedCheck if device is paried via bluetooth to any current device as well as history of all deviced connected, last connected and whether or not they are currently connected.usage: ghome bpaired [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome bpaired --ip 192.168.1.10orghome bpaired --name "Kitchen Speaker"bluetooth_discoveryThis is to enable or disable bluetooth discovery to allow for pairing as needed. The action can be to enable or disable coupled with the ip or device name.usage: ghome bdisc [-h] [--action ACTION] [--ip IP] [--name NAME]

optional arguments:
  -h, --help       show this help message and exit

Required named arguments.:
  --action ACTION  enable or disable Bluetooth discoverability

Optional named arguments:
  --ip IP          Google Home IP Address
  --name NAME      Google Home Device NameSimple usageghome bpaired --action enable --ip 192.168.1.10orghome bpaired --action enable --name "Kitchen Speaker"saved_networkwifi scanPrints the wifi scan results of all available wifi connections and their ssid based on the proximity of the device to other connections. You might want to run this twice, since it may not build the device cache directly.usage: ghome wscan [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome wscan --action enable --ip 192.168.1.10orghome wscan --action enable --name "Kitchen Speaker"saved_networkThis tool allows you to print any saved network on the device and nothing else it may provide only information on current network being used if there is only a single network it was connected to .usage: ghome saved_network [-h] [--ip IP] [--name NAME]

optional arguments:
  -h, --help   show this help message and exit

Optional named arguments:
  --ip IP      Google Home IP Address
  --name NAME  Google Home Device NameSimple usageghome saved_network --action enable --ip 192.168.1.10orghome saved_network --action enable --name "Kitchen Speaker"Changelogv0.0.3Install instruction for pycryptodomex addedglocaltokens fixed to 0.2.3 to avoid charmap issues.v0.0.2Added major revisions to the code to use autheticated device tokensMakes use of master token and autogenerates new one every 24 hoursDevice ports are adjusted for authenicated endpoints based on endpointsAdditional tools were added and overall improvements were madeTool supports Python 3 only.