|
1 | 1 | # Pushbullet Binding
|
2 | 2 |
|
3 |
| -The Pushbullet binding allows you to notify iOS, Android & Windows 10 Phone & Desktop devices of a message using the Pushbullet API web service. |
| 3 | +The Pushbullet binding allows you to notify supported devices of a message using the [Pushbullet API](https://docs.pushbullet.com). |
| 4 | +To get started you need to [create an account](#creating-an-account) and [obtain an access token](#obtaining-an-access-token). |
4 | 5 |
|
5 | 6 | ## Supported Things
|
6 | 7 |
|
7 |
| -This binding supports a generic "bot" which is a representation of the client. |
8 |
| - |
9 |
| -## Discovery |
10 |
| - |
11 |
| -This binding provides no discovery. |
12 |
| -The desired bots must be configured manually or via a things file. |
13 |
| - |
14 |
| -## Binding Configuration |
15 |
| - |
16 |
| -The binding has no configuration options itself, all configuration is done at 'Things' level. |
| 8 | +| Thing | Type | Description | |
| 9 | +| ----- | ----- | ------------------------- | |
| 10 | +| bot | Thing | Bot to send messages with | |
17 | 11 |
|
18 | 12 | ## Thing Configuration
|
19 | 13 |
|
20 |
| -### Bot (`bot`) |
21 |
| - |
22 |
| -The bot thing is used to send messages to other recipients. |
23 |
| -It has the following parameters: |
| 14 | +### `bot` |
24 | 15 |
|
25 |
| -| Config | Description | Required | Advanced | |
26 |
| -|------------|------------------------------------------------------------------|----------|----------| |
27 |
| -| token | Pushbullet [API token](#obtaining-an-api-key) to send to devices | Yes | False | |
28 |
| -| name | Explicit Name, for later use when the bot can receive messages | No | True | |
29 |
| -| apiUrlBase | Address of own Pushbullet server, for testing purposes | No | True | |
30 |
| - |
31 |
| -```java |
32 |
| -Thing pushbullet:bot:r2d2 "R2D2" @ "Somewhere" [ token = "verysecretwonttellyou" ] |
33 |
| - |
34 |
| -``` |
| 16 | +| Parameter | Required | Description | |
| 17 | +| --------- | :------: | ---------------------------------------------------- | |
| 18 | +| token | Yes | Access token obtained from the account settings page | |
35 | 19 |
|
36 | 20 | ## Channels
|
37 | 21 |
|
38 |
| -| Channel ID | Channel Description | Supported item type | Advanced | |
39 |
| -|------------|-------------------------------------------------|----------------------|----------| |
40 |
| -| recipient | for later use when the bot can receive messages | String | False | |
41 |
| -| title | for later use when the bot can receive messages | String | False | |
42 |
| -| message | for later use when the bot can receive messages | String | False | |
| 22 | +Currently the binding does not support any channels. |
43 | 23 |
|
44 | 24 | ## Rule Action
|
45 | 25 |
|
@@ -71,110 +51,47 @@ For the `sendPushbulletNote` action, parameter `message` is required.
|
71 | 51 | Likewise, for `sendPushbulletLink`, `url` and for `sendPushbulletFile`, `content` parameters are required.
|
72 | 52 | Any other parameters for these actions are optional and can be set to `null`.
|
73 | 53 |
|
74 |
| -Examples: |
75 |
| - |
76 |
| -```java |
77 |
| -val actions = getActions("pushbullet", "pushbullet:bot:r2d2") |
78 |
| -actions .sendPushbulletNote( "[email protected]", "Note Example", "This is the pushed note.") |
79 |
| -actions .sendPushbulletLink( "[email protected]", "Link Example", "This is the pushed link", "https://example.com") |
80 |
| -actions .sendPushbulletFile( "[email protected]", "File Example", "This is the pushed file", "https://example.com/image.png") |
81 |
| -actions .sendPushbulletFile( "[email protected]", null, null, "/path/to/somefile.pdf", "document.pdf") |
82 |
| -actions .sendPushbulletFile( "[email protected]", ImageItem.state .toFullString) |
83 |
| -``` |
84 |
| - |
85 | 54 | ## Full Example
|
86 | 55 |
|
87 |
| -_Provide a full usage example based on textual configuration files (*.things, *.items, *.sitemap)._ |
88 |
| - |
89 |
| -pushbullet.things: |
90 |
| - |
91 |
| -```java |
92 |
| -Thing pushbullet:bot:r2d2 "R2D2" @ "Somewhere" [ token = "verysecretwonttellyou" ] |
93 |
| - |
94 |
| -``` |
95 |
| - |
96 |
| -pushbullet.items |
| 56 | +demo.things: |
97 | 57 |
|
98 | 58 | ```java
|
99 |
| -Switch Pushbullet_R2D2_Button "Pushbullet Action bot R2D2" |
100 |
| -``` |
101 |
| - |
102 |
| -pushbullet.sitemap |
| 59 | +Thing pushbullet:bot:r2d2 [ token="<ACCESS_TOKEN>" ] |
103 | 60 |
|
104 |
| -```java |
105 |
| -sitemap pushbullet label="Pushbullet" |
106 |
| -{ |
107 |
| - Switch item=Pushbullet_R2D2_Button |
108 |
| -} |
109 | 61 | ```
|
110 | 62 |
|
111 |
| -pushbullet.rules |
| 63 | +demo.rules |
112 | 64 |
|
113 | 65 | ```java
|
114 |
| -rule "Pushbullet R2D2 changed" |
115 |
| -when |
116 |
| - Item Pushbullet_R2D2_Button changed |
117 |
| -then |
118 |
| - logInfo(filename, "Button R2D2 changed - OH2...") |
119 |
| - |
120 |
| - if (Pushbullet_R2D2_Button.state == ON) |
121 |
| - { |
122 |
| - sendCommand(Pushbullet_R2D2_Button, OFF) |
123 |
| - |
124 |
| - val actions = getActions("pushbullet", "pushbullet:bot:r2d2") |
125 |
| - logInfo(filename, "Actions for 'R2D2' are: " + actions) |
126 |
| - |
127 |
| - if (actions != null) |
128 |
| - { |
129 |
| - val result = actions .sendPushbulletNote( "[email protected]", "Title R2D2 OH2", "This has been sent by the new R2D2 bot") |
130 |
| - logInfo(filename, "Result of send action is: " + result) |
131 |
| - } |
132 |
| - } |
133 |
| -end |
| 66 | +val actions = getActions("pushbullet", "pushbullet:bot:r2d2") |
| 67 | +// push a note |
| 68 | +actions .sendPushbulletNote( "[email protected]", "Note Example", "This is the pushed note.") |
| 69 | +// push a link |
| 70 | +actions .sendPushbulletLink( "[email protected]", "Link Example", "This is the pushed link", "https://example.com") |
| 71 | +// push a file |
| 72 | +actions .sendPushbulletFile( "[email protected]", "File Example", "This is the pushed file", "https://example.com/image.png") |
| 73 | +actions .sendPushbulletFile( "[email protected]", null, null, "/path/to/somefile.pdf", "document.pdf") |
| 74 | +// use toFullString method to push the content of an Image item |
| 75 | +actions .sendPushbulletFile( "[email protected]", ImageItem.state .toFullString) |
134 | 76 | ```
|
135 | 77 |
|
136 |
| -## Creating an account for your bot(s) |
| 78 | +## Creating an account |
137 | 79 |
|
138 |
| -The pushbullet accounts are bound to either Google or Facebook accounts. |
| 80 | +A Pushbullet account is linked to either a Google or Facebook account. |
139 | 81 |
|
140 |
| -- Create a bot account with either Facebook or Google |
141 |
| -- Go to "<https://www.pushbullet.com/>" |
142 |
| -- Chose to either "Sign up with Google" or "Sign up with Facebook". |
| 82 | +- Go to the [Pushbullet](https://www.pushbullet.com) website. |
| 83 | +- Select either "Sign up with Google" or "Sign up with Facebook". |
143 | 84 | - Complete the signup process as guided by the pushbullet web site.
|
144 |
| -- Continue with "Obtaining an API key". |
145 | 85 |
|
146 |
| -## Obtaining an API key |
| 86 | +## Obtaining an access token |
147 | 87 |
|
148 |
| -The API keys are bound to the pushbullet account. |
| 88 | +An access token is linked to a Pushbullet account. |
149 | 89 |
|
150 |
| -- Go to the pushbullet site. |
151 |
| -- Log in with either your personal account or the one you created for your bot. |
152 |
| -- Go to "<https://www.pushbullet.com/#settings/account>" |
| 90 | +- Go to your [Pushbullet account settings](https://www.pushbullet.com/#settings/account) page. |
153 | 91 | - Click on "Create Access Token".
|
154 |
| -- Copy the token created on the site. |
155 |
| - |
156 |
| -You must at least provide an API token (Private or Alias Key from Pushbullet.com) and a message in some manner before a message can be pushed. |
157 |
| -All other parameters are optional. |
158 |
| -If you use an alias key, the parameters (device, icon, sound, vibration) are overwritten by the alias setting on pushbullet. |
| 92 | +- Copy the created access token. |
159 | 93 |
|
160 | 94 | ## Rate limits
|
161 | 95 |
|
162 |
| -As of 2019, free accounts have a limit of 100 pushes per month. |
163 |
| -This action does not evaluate the rate limiting headers though. |
164 |
| - |
165 |
| -## Translation |
166 |
| - |
167 |
| -This project is being translated on transifex. |
168 |
| -If you want to help, please join the project at the URL: |
169 |
| - |
170 |
| -- <https://www.transifex.com/hakan42/openhab-binding-pushbullet/dashboard/> |
171 |
| - |
172 |
| -## Libraries |
173 |
| - |
174 |
| -This action has been written without using libraries as jpushbullet or jpushbullet2. |
175 |
| -Both of those libraries use various libraries themselves which makes integrating them into openHAB a challenge. |
176 |
| - |
177 |
| -## pushbullet API |
178 |
| - |
179 |
| -- <https://docs.pushbullet.com/> |
180 |
| -- <https://docs.pushbullet.com/#push-limit> |
| 96 | +As of 2024, free accounts are [limited](https://docs.pushbullet.com/#limits) to 500 pushes per month. |
| 97 | +Going over will result in a warning message being logged indicating when your account rate limit will reset. |
0 commit comments