Android: Send notifications to Pebble using Llama

If you want to skip my pre-amble, you can jump straight to the juicy bits.

I was lucky enough to receive my Pebble watch a couple of weeks ago (I’m a day-1 backer of a black watch, living in the UK). There are already plenty of in-depth reviews so I won’t go into detail here other than to say that I’m impressed with what this small team have achieved (even given the delays). The build quality is solid and for me the current features are both useful and reliable so I’m excited to see what more can be achieved when the team hit full development pace on the software side and when the SDK drops.

There are already a couple of android apps that hook in to the Android accessibility service and push notifications to the watch via the Pebble app installed on the phone. They do this by taking advantage of the Pebble Intent API.

Another app that I’ve been experimenting with recently is Llama. Much like Tasker and Locale, Llama enables you to trigger actions when your phone detects a predefined condition. Here are a few examples of rules that I’ve set up:

  • Set phone to “quiet” when I enter a cell location that I’ve identified as “at work”.
  • Connect to WiFi when I arrive home or when I enter a bar that I know has free WiFi (and subsequently disable WiFi when I leave).
  • Set phone to “silent” Monday to Friday from 11pm until 7am, and 11:30pm until 8:30am at Weekends.
  • Launch music player when bluetooth headphones connect.
  • Set phone to “silent” during events in my calendar that are marked as “busy”.

I’ve now figured out how to have Llama send a notification to my Pebble under certain conditions. For example if I have an appointment in my calendar (think important meeting, movie at the cinema etc), one of my Llama rules will switch my phone to silent, but because I’m paranoid I’m likely to pull out my phone (at least once) to check that it really is on silent. It would be kinda cool to get a confirmation message on my watch when the rule fires.

how I did it:

  1. Open up your Llama event for editing, and add a new Action: Android intent
  2. Set Intent send mode to Broadcast
  3. Leave Package Name and Class name fields blank
  4. Set Action to com.getpebble.action.SEND_NOTIFICATION (make sure there are no spaces, and pay attention to capitalisation).
  5. Leave Categories, Data, and Data type fields blank
  6. Click Add new ‘extra’ row 3 times and set the 3 new rows as below (the sender field can be set to whatever you like):
messageType string PEBBLE_ALERT
sender string Llama
notificationData string [{"title":"Phone silenced","body":"Phone set to silent for calendar event"}]

The screenshots below show the important bits:

Llama config #1

Llama config #2

That’s it, hit Ok, then Test Actions and you should get a notification on your phone like the one below.

#PebbleTime

A quick tip – if you’re setting up multiple notifications in Llama it’s a bit of pain to enter all this config each time so it’s easier to make a copy of the whole Llama rule and then edit the other condition/actions to suit.

3 Comments to “Android: Send notifications to Pebble using Llama”

  1. Deepak 10 September 2015 at 6:15 am #

    Thank you i learnt something new

  2. Steve 18 May 2016 at 7:13 pm #

    Nice one and good to see this still works with my new Pebble Time (replaced my KS Pebble a few months back)

    • tdroza 18 May 2016 at 7:22 pm #

      Awesome – glad to see that someone found this useful!


Leave a Reply to Deepak