Whistle is a gadget you attach to your dog’s collar and it tracks exercise and location (GPS)
Previous versions had a web interface so it was pretty easy to figure out what the API was like. Version 3, though, only works with Whistle’s mobile apps.
No problem: after a bit of sniffing, I created a Python package that consumes this API (Pypi package)
I can now display my dog’s status in Home Assistant, using a custom component: Source Code
Note that an additional attribute is supported: entity_picture which can be used to match one of the Whistle service’s picture sizes (default: 60x60) – I am not sure how to use this one right now and I am using a gravatar instead to display my dog’s picture, in the view itself.
If you look at the Pypy source file you will see that the library can retrieve much more information. I have not figured out what would make sense to integrate in HA, yet, beyond device location, so let me know if you have suggestions.
This is amazing! My dog does not run, but she’ll feel free to wander given the opportunity. The Whistle 3 has afforded us peace of mind for nearly 2 years. I’ve asked the company via email to allow access to the API, with no response, so I really appreciate the work by @Fusion and hope that this can evolve into a very useful project.
Unfortunately, I’m not able to get this working. I’ve installed pywhistle via pip:
I suspect this has to do with some breaking changes in HA. I am still running 83.3 but googling similar errors I am seeing references to similar issues with other components in releases >= 89
I will try an upgrade and see how well/poorly things shake out.
On the other hand, if anyone has any idea how I could get a discount on a replacement Whistle device…my stupid dogs keep trying to catch a skunk and, not too surprisingly, the device doesn’t seem to enjoy being regularly bathed in sulfur!
Thanks for a great addition to Home Assistant. I recently setup a new instance and I’m running into an issue. After cloning from Github and adding to my sensors.yaml I get the following in my logs. I’m new to Python and I’m not even sure where to start looking.
2019-08-13 20:23:32 ERROR (MainThread) [homeassistant.config] Failed to get platform sensor.whistle
Traceback (most recent call last):
File "/usr/src/app/homeassistant/config.py", line 795, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/app/homeassistant/loader.py", line 235, in get_platform
"{}.{}".format(self.pkg_path, platform_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.whistle.sensor'
Hey Chris, I was hoping for more information in the trace as well but that’s all I could find. To answer your questions I’m running 0.97.2 in a Docker container. My hierarchy does match.
root@docker:/# ls -lR /config/custom_components/whistle
/config/custom_components/whistle:
total 20
-rw-r--r-- 1 root root 3071 Aug 13 19:59 README.md
-rw-r--r-- 1 root root 31 Aug 13 19:59 __init__.py
drwxr-xr-x 2 root root 4096 Aug 13 20:03 __pycache__
-rw-r--r-- 1 root root 3478 Aug 13 20:25 device_tracker.py
-rw-r--r-- 1 root root 268 Aug 13 19:59 manifest.json
Firstly - I just want to say that this plugin is freaking amazing. My partner has no interest in home automation but even she couldn’t help but be impressed to see our dogs activity in HA. I would be delighted to chip in to a fund or buy you a virtual coffee for your work on this.
I was wondering how I could track “Last walked…” based on the Away status. Has anyone done this? It would be cool to not only have alerts for “if doggo has not been walked for n hours” but also to be able to show that in the status board.
(If whistle is listening - this API is far more valuable to me than the GPS monitoring features!)
I just put this on my HA and I have to say - I love it. I have two dogs and I love to track their daily activity to see who is getting more and when.
If you set up the dog as a known device, you can copy the URL that comes from the base integration data and it will automatically pick up the image of whatever you have stored in the Whistle profile!
Now I just wish that I could somehow re-direct the account to connect to the beta test tracker that I have been using for one of my dogs.
Technically - if you are tracking your presence from your cell phone, coupled together with tracking presence of your dog from Whistle, you could set up a group in your groups.yaml where it determines if you are both away from the house. Then you could build an automation that would trigger based on the status of the group (which is saying you are away from the house together) and do something. Then you can build another automation that tracks and triggers based on how long it has been since the “Group” was away, and send an alert like your quote above. Pretty easy I would think, and can be done in HA with the groups and automation capabilities. You could even have HA track how many walks occur over time…