An Apple "Find My" client for the Pebble smartwatch and accompanying server to interface with iCloud through pyicloud.
The watchapp can login to the API server and get an access token in order to list your devices and send a request to find a particular device.
The server/
folder implements a REST API in Python for initiating "Find My" requests using picklepete/pyicloud.
The watchapp/
folder contains the source for the Pebble app. The PebbleKit JS component communicates with the server and sends the device information to the Pebble.
- Use pipenv to install the dependencies
$ cd server $ pip install pipenv $ pipenv install
- Open a pipenv shell and configure your iCloud account for 2FA, see the pyicloud documentation for more details.
- It is recommended that you save your password/2FA in the keyring using the
icloud
command. - This will make server startup seamless without the need for interaction
$ pipenv shell $ icloud [email protected] ICloud Password for [email protected]: Save password in keyring? (y/N)
- It is recommended that you save your password/2FA in the keyring using the
- Create a .env file in the server folder and set the variables. See
server/.env.example
for values- If you don't specify APPLE_PASSWORD, pyicloud will attempt to use the keyring
- Start the server from the pipenv shell with
python main.py
OR explicitly run it through pipenv with:$ pipenv run python main.py
- Build and install the watchapp using the Pebble SDK
- Make sure your server is running
- Configure your server URL, and username/password to match the API user and password you set for the server.
- Launch the watchapp and select a device to trigger a Find My alert on it.
- List devices on watchapp
- Trigger "Find My" alert from watchapp
- Additional information on watchapp
- Show request success/failure on Pebble
- Icons for device class
- Battery level and status
- Location name using reverse geocoding API
- Add endpoints to login/save iCloud credentials without pyicloud's
icloud
CLI. - Additional endpoint to set "Lost Mode"
- Server authentication
- Gevent WSGI server
- Clay configuration
- Inspiration/Resources
- pebble-examples - For examples of basic functionality and Pebble design patterns.
- Rebble - for keeping the Pebble alive in 2022.
- limbo/smartthings-remote - For inspiration on handling the devices.
- Libraries
- pebble/clay - Pebble Config Framework
- mode80/crc8js - JS CRC implementation to create a map of device IDs to avoid sending large device IDs to the Pebble
- vimalloc/flask-jwt-extended - JWT support for Flask.
- smallstoneapps/js-message-queue - PebbleKit JS AppMessage queue library
- matthewtole/pebble-assist.h - Utility macros for Pebble development
- picklepete/pyicloud - Python iCloud wrapper.