2020-09-21 01:58:32 +02:00
|
|
|
# Pushbullet Binding
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
The Pushbullet binding allows you to notify supported devices of a message using the [Pushbullet API](https://docs.pushbullet.com).
|
|
|
|
To get started you need to [create an account](#creating-an-account) and [obtain an access token](#obtaining-an-access-token).
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
## Supported Things
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
| Thing | Type | Description |
|
|
|
|
| ----- | ----- | ------------------------- |
|
|
|
|
| bot | Thing | Bot to send messages with |
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
## Thing Configuration
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
### `bot`
|
2020-09-21 01:58:32 +02:00
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
| Parameter | Required | Description |
|
|
|
|
| --------- | :------: | ---------------------------------------------------- |
|
|
|
|
| token | Yes | Access token obtained from the account settings page |
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
## Channels
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
Currently the binding does not support any channels.
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
## Rule Action
|
|
|
|
|
|
|
|
This binding includes rule actions for sending notes.
|
|
|
|
Two different actions available:
|
|
|
|
|
2022-12-14 16:52:43 +01:00
|
|
|
- `sendPushbulletNote(String recipient, String messsage)`
|
|
|
|
- `sendPushbulletNote(String recipient, String title, String messsage)`
|
2024-09-28 22:58:23 +02:00
|
|
|
- `sendPushbulletLink(String recipient, String url)`
|
|
|
|
- `sendPushbulletLink(String recipient, String title, String messsage, String url)`
|
|
|
|
- `sendPushbulletFile(String recipient, String content)`
|
|
|
|
- `sendPushbulletFile(String recipient, String title, String messsage, String content)`
|
|
|
|
- `sendPushbulletFile(String recipient, String title, String messsage, String content, String fileName)`
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
Since there is a separate rule action instance for each `bot` thing, this needs to be retrieved through `getActions(scope, thingUID)`.
|
2021-07-26 09:28:06 +02:00
|
|
|
The first parameter always has to be `pushbullet` and the second is the full Thing UID of the bot that should be used.
|
2020-09-21 01:58:32 +02:00
|
|
|
Once this action instance is retrieved, you can invoke the action method on it.
|
|
|
|
|
2021-07-26 09:28:06 +02:00
|
|
|
The recipient can either be an email address, a channel tag or `null`.
|
|
|
|
If it is not specified or properly formatted, the note will be broadcast to all of the user account's devices.
|
|
|
|
|
2024-09-28 22:58:23 +02:00
|
|
|
The file content can be an image URL, a local file path or an Image item state.
|
|
|
|
|
|
|
|
The file name is used in the upload link and how it appears in the push message for non-image content.
|
|
|
|
If it is not specified, it is automatically determined from the image URL or file path.
|
|
|
|
For Image item state content, it defaults to `image.jpg`.
|
|
|
|
|
|
|
|
For the `sendPushbulletNote` action, parameter `message` is required.
|
|
|
|
Likewise, for `sendPushbulletLink`, `url` and for `sendPushbulletFile`, `content` parameters are required.
|
|
|
|
Any other parameters for these actions are optional and can be set to `null`.
|
|
|
|
|
2020-09-21 01:58:32 +02:00
|
|
|
## Full Example
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
demo.things:
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
```java
|
2024-10-05 21:46:49 +02:00
|
|
|
Thing pushbullet:bot:r2d2 [ token="<ACCESS_TOKEN>" ]
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
demo.rules
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
```java
|
2024-10-05 21:46:49 +02:00
|
|
|
val actions = getActions("pushbullet", "pushbullet:bot:r2d2")
|
|
|
|
// push a note
|
|
|
|
actions.sendPushbulletNote("someone@example.com", "Note Example", "This is the pushed note.")
|
|
|
|
// push a link
|
|
|
|
actions.sendPushbulletLink("someone@example.com", "Link Example", "This is the pushed link", "https://example.com")
|
|
|
|
// push a file
|
|
|
|
actions.sendPushbulletFile("someone@example.com", "File Example", "This is the pushed file", "https://example.com/image.png")
|
|
|
|
actions.sendPushbulletFile("someone@example.com", null, null, "/path/to/somefile.pdf", "document.pdf")
|
|
|
|
// use toFullString method to push the content of an Image item
|
|
|
|
actions.sendPushbulletFile("someone@example.com", ImageItem.state.toFullString)
|
2020-09-21 01:58:32 +02:00
|
|
|
```
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
## Creating an account
|
2020-09-21 01:58:32 +02:00
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
A Pushbullet account is linked to either a Google or Facebook account.
|
2020-09-21 01:58:32 +02:00
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
- Go to the [Pushbullet](https://www.pushbullet.com) website.
|
|
|
|
- Select either "Sign up with Google" or "Sign up with Facebook".
|
2020-09-21 01:58:32 +02:00
|
|
|
- Complete the signup process as guided by the pushbullet web site.
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
## Obtaining an access token
|
2020-09-21 01:58:32 +02:00
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
An access token is linked to a Pushbullet account.
|
2020-09-21 01:58:32 +02:00
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
- Go to your [Pushbullet account settings](https://www.pushbullet.com/#settings/account) page.
|
2020-09-21 01:58:32 +02:00
|
|
|
- Click on "Create Access Token".
|
2024-10-05 21:46:49 +02:00
|
|
|
- Copy the created access token.
|
2020-09-21 01:58:32 +02:00
|
|
|
|
|
|
|
## Rate limits
|
|
|
|
|
2024-10-05 21:46:49 +02:00
|
|
|
As of 2024, free accounts are [limited](https://docs.pushbullet.com/#limits) to 500 pushes per month.
|
|
|
|
Going over will result in a warning message being logged indicating when your account rate limit will reset.
|