Pet Presence with Whistle 3


#1

I’m interested in using my dog’s Whistle 3 to indicate presence to ST. It appears they have an undocumented API. Someone here has been able to query it using php:

Assume this is some sort of REST API. Is this something I could directly setup with WebCoRE, or would I need to run a script on a Pi at an interval and then update WebCoRE with a WebHook?

Any thoughts? Anyone else using Whistle?


#2

I have no experience with Whistle3, but I would probably write something in python on my rp3, have it execute every X minutes, and that script could make a URL call to the piston with whatever $args to update it.
Might have to be considerate of how many API calls you make though, they could be limited.


#3

I know this is an older thread but I just put something similar together and it works pretty well. Whistle sends an e-mail, usually within about 30 seconds of the dog arriving or leaving home. I tag in G-Mail with either an away or home tag based on the title of the e-mail. From there I have an IFTTT trigger that triggers based on that tag and calls a webhook to either announce the dog as home or away.

It’s not the best way but it works. I only see about a 45 to 60 second delay from the time she runs to the time Alexa makes the announcement.


#4

I use whistle. I have cobbled together a bunch of stuff to change colors on my HS-WD200+ switches.

Whistle has an IFTTT channel, but it only alerts on two conditions.
-low battery
-done charging

For the other conditions, I use the gmail IFTTT channel. Set up labels.

-Docked
-Home
-Off
-Out (of Zone)

(Note: I had to set up a google voice account as not all whistle notifications come in email or text.) Here are the label in gmail…

In ST, I have three virtual switches set up for each dog…

Battery_Low/Docked
Battery_Charge/Dead
Home/Away

In IFTTT, I have the applets set up to turn those switches on or off based on the whistle/gmail triggers.

Then, this piston, does all the heavy lifting changing the colors on my LEDs…


#5

This is great. I’ll be setting up the email method for virtual presence later tonight. Still hoping eventually someone with the Groovy know how can write a SmartApp, or at the very least Whistle needs to add Location to the IFTTT channel…

Two other recent examples of direct integrations, one with Home Assistant, so hopefully a seasoned ST dev gets an escape artist dog and gets inspired to pick up a direct integration.


#6

I’ve actually made some good progress on this, and provided the ‘make web request’ feature in CoRE is capable of doing the following, I think at directing integration could be fairly easy.

  1. Send POST to https://app.whistle.com/api/login
    with some headers and my username and pass in the body

  2. This returns an “auth_token” and “refresh_token”. Store the auth token as a variable.

  3. Do a simple GET to https://app.whistle.com/api/pets with the token.

  4. From the result, I am just looking to parse one value in a single json key that corresponds to the dog being home or not. If it matches I’ll set a simulated presence sensor as present, if not, not present.


#7

It looks like this will need to be done in an actual SmartApp, since webCoRE doesn’t support passing headers in POST requests.


#8

Well that didn’t take long. I’ve written a basic DTH here that can directly pull presence and battery % into ST. Enjoy.


#9

Wow! I’ll have to look at this.