Edit: As of version 0.1.0, both GPS and non-GPS whistle devices are supported.
Just wanted to share a new custom component that I created for Whistle GPS Pet trackers. It can be installed via HACS or manually. Details and documentation can be found in the github repo. It uses a modified pywhistle API library, which was originally created by github user Fusion in order to grab more extensive details about the battery and additional attributes not available in the original pywhistle custom component.
Setup is done through the UI with your Whistle username (e-mail) and password instead of configuration.yaml
Notable things:
Whistle devices are exposed as device_tracker entities and have a state that displays place name as defined in the Whistle app. For example, if youâve set up two places in the Whistle app, Home and Vet, if the whistle tracker is located at Home then the state of the device_tracker will be Home. If the whistle tracker is found to be at the Vet, then the state of the device_tracker will be Vet. If the device tracker is not located in any of the predefined places, the state of the device_tracker will be Away.
Icon: the icon of the device_tracker will either be a cat or a dog depending on the pet associated with the Whistle device.
Available attributes:
Attribute
Description
battery_level
Current battery charge level in percent
latitude
Last known latitude coordinate
longitude
Last Known longitude coordinate
gps_accuracy
GPS uncertainty in meters
battery_status
Displays if the battery is on or off
battery_days_left
Estimated number of days left before battery is empty
pending_locate
If locating pet is pending. Can be either true or false
activity_streak
Number of days in a row your pet has reached its activity goal
activity_minutes_active
Number of minutes your pet has been active today
active_minutes_rest
Number of minutes your pet has been resting today
activity_goal
Current activity goal, in minutes, for today as set up from the app
activity_distance
Distance covered, in miles, by your pet today
activity_calories
Number of calories burned by your pet today
24h_battery_wifi_usage
Amount of time in the last 24 hours, in percent, the Whistle used Wi-Fi (also known as Power Save Mode)
24h_battery_cellular_usage
Amount of time in the last 24 hours, in percent, the Whistle used the cellular network (this occurs when the tracker is not connected to Wi-Fi)
last_check_in
Last date and time the Whistle device contacted the Whistle servers
Is there a way to convert the attributes into to entities which can be passed through to Google Assistant? I use Google Assistant as my voice assistant, and itâd be nice to ask Google questions about the catâs whereabouts, but I donât think that functionality currently exists.
You can use template sensors to create sensor entities from the device_tracker entity attributes. However, I donât believe youâll be able to ask Google Assistant where your pet is (seems to be a Google Assistant limitation). If you visit the Home Assistant Google Assistant documentation, you can see that sensor entities can be exposed to Google Assistant, but not device_tracker entities. If you were to create a template sensor which uses the current state of the device_tracker entity, youâd be able to expose said sensor to Google Assistant, but I donât believe Google Assistant would tell you the state of that sensor if you were to ask it.
To get around this:
Create a template sensor that takes in the device_tracker entityâs state and puts it in a sentence, which the TTS service will use. For example âThe cat is at Xâ with X being the device_tracker entityâs state.
Then create a script in Home Assistant that calls the TTS service using the state of the sensor mentioned above. Only problem is, if you have multiple Google Assistant devices, you wonât be able to specify TTS to run on the particular Google Assistant device that you asked. If know youâre only going to be asking a specific Google Assistant device where your cat is then you can have the script call the TTS service on only that specific device. If not, you could have the TTS service run on all the Google Assistant devices in your home.
After creating the script youâll need to expose it to Google Assistant. You wonât see it in the Google Home app- Home assistant scripts are exposed as âscenesâ in Google Home.
You would then create a routine in Google Home that runs the âsceneâ (Home Assisstant Script) when you ask Google Assistant âWhere is the catâ.
Iâm not sure this will be of any use if youâre trying to get exact coordinates for your car as this would only use the state of the device tracker which takes on a value corresponding to the preset safe spaces that you defined in the Whistle app.
Only two entities are created (the device tracker entity and event sensor entity). The device tracker entity has several attributes. Be sure to read the documentation on the Github page that outlines all the features.
For those who arenât aware (currently running a version below 0.1.0), a new backend has been written and the integration has been completely rewritten. If you are running a version below 0.1.0 be sure to read the 0.1.0 release notes before updating.
Version 0.1.2 introduces the ability to select if you want to use zones defined within the Whistle app or your Home Assistant zones. By default, Whistle zones are used. In order to change this, from the Home Assistant integrations page, click on configure and pick between Whistle or Home Assistant: