Whistle GPS Pet Tracker [Custom Component]

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
2 Likes

This is awesome!

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.

Thanks!

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.

It looks like Whistle just killed app.whistle.com. Does this version rely on app.whistle?

Yes it uses app.whistle

Just checked with the latest app version and app.whistle is still being used:

1 Like

I tried to login to app.whistle.com and it says ‘You do not have access to this resource.’ Did you have to sign up for a developer account?

What exactly do you mean by you tried logging into app.whistle.com?

No developer account is required. The integration uses the undocumented endpoints that the whistle mobile app uses.

1 Like

That answers my question. Haha

What app did you use to get the info in your screenshot?

Charles. But there are many other options as well such as Thor.

Hi, I recently started a fresh HA instance, and when I add Whistle back, I only get two entities…

* device_tracker.whistle_{pet_name}
* sensor.whistle_{pet_name}_event

Turns out in the reinstall I forgot that this integration is entities and ATTRIBUTES rather than unique entities.

Thanks!

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:

image

1 Like