forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pushbullet] Remove unimplemented channels and thing parameters (open…
…hab#17482) * [pushbullet] Remove unimplemented channels and thing parameters Signed-off-by: jsetton <[email protected]>
- Loading branch information
Showing
8 changed files
with
63 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,25 @@ | ||
# Pushbullet Binding | ||
|
||
The Pushbullet binding allows you to notify iOS, Android & Windows 10 Phone & Desktop devices of a message using the Pushbullet API web service. | ||
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). | ||
|
||
## Supported Things | ||
|
||
This binding supports a generic "bot" which is a representation of the client. | ||
|
||
## Discovery | ||
|
||
This binding provides no discovery. | ||
The desired bots must be configured manually or via a things file. | ||
|
||
## Binding Configuration | ||
|
||
The binding has no configuration options itself, all configuration is done at 'Things' level. | ||
| Thing | Type | Description | | ||
| ----- | ----- | ------------------------- | | ||
| bot | Thing | Bot to send messages with | | ||
|
||
## Thing Configuration | ||
|
||
### Bot (`bot`) | ||
|
||
The bot thing is used to send messages to other recipients. | ||
It has the following parameters: | ||
### `bot` | ||
|
||
| Config | Description | Required | Advanced | | ||
|------------|------------------------------------------------------------------|----------|----------| | ||
| token | Pushbullet [API token](#obtaining-an-api-key) to send to devices | Yes | False | | ||
| name | Explicit Name, for later use when the bot can receive messages | No | True | | ||
| apiUrlBase | Address of own Pushbullet server, for testing purposes | No | True | | ||
|
||
```java | ||
Thing pushbullet:bot:r2d2 "R2D2" @ "Somewhere" [ token = "verysecretwonttellyou" ] | ||
|
||
``` | ||
| Parameter | Required | Description | | ||
| --------- | :------: | ---------------------------------------------------- | | ||
| token | Yes | Access token obtained from the account settings page | | ||
|
||
## Channels | ||
|
||
| Channel ID | Channel Description | Supported item type | Advanced | | ||
|------------|-------------------------------------------------|----------------------|----------| | ||
| recipient | for later use when the bot can receive messages | String | False | | ||
| title | for later use when the bot can receive messages | String | False | | ||
| message | for later use when the bot can receive messages | String | False | | ||
Currently the binding does not support any channels. | ||
|
||
## Rule Action | ||
|
||
|
@@ -71,110 +51,47 @@ 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`. | ||
|
||
Examples: | ||
|
||
```java | ||
val actions = getActions("pushbullet", "pushbullet:bot:r2d2") | ||
actions.sendPushbulletNote("[email protected]", "Note Example", "This is the pushed note.") | ||
actions.sendPushbulletLink("[email protected]", "Link Example", "This is the pushed link", "https://example.com") | ||
actions.sendPushbulletFile("[email protected]", "File Example", "This is the pushed file", "https://example.com/image.png") | ||
actions.sendPushbulletFile("[email protected]", null, null, "/path/to/somefile.pdf", "document.pdf") | ||
actions.sendPushbulletFile("[email protected]", ImageItem.state.toFullString) | ||
``` | ||
|
||
## Full Example | ||
|
||
_Provide a full usage example based on textual configuration files (*.things, *.items, *.sitemap)._ | ||
|
||
pushbullet.things: | ||
|
||
```java | ||
Thing pushbullet:bot:r2d2 "R2D2" @ "Somewhere" [ token = "verysecretwonttellyou" ] | ||
|
||
``` | ||
|
||
pushbullet.items | ||
demo.things: | ||
|
||
```java | ||
Switch Pushbullet_R2D2_Button "Pushbullet Action bot R2D2" | ||
``` | ||
|
||
pushbullet.sitemap | ||
Thing pushbullet:bot:r2d2 [ token="<ACCESS_TOKEN>" ] | ||
|
||
```java | ||
sitemap pushbullet label="Pushbullet" | ||
{ | ||
Switch item=Pushbullet_R2D2_Button | ||
} | ||
``` | ||
|
||
pushbullet.rules | ||
demo.rules | ||
|
||
```java | ||
rule "Pushbullet R2D2 changed" | ||
when | ||
Item Pushbullet_R2D2_Button changed | ||
then | ||
logInfo(filename, "Button R2D2 changed - OH2...") | ||
|
||
if (Pushbullet_R2D2_Button.state == ON) | ||
{ | ||
sendCommand(Pushbullet_R2D2_Button, OFF) | ||
|
||
val actions = getActions("pushbullet", "pushbullet:bot:r2d2") | ||
logInfo(filename, "Actions for 'R2D2' are: " + actions) | ||
|
||
if (actions != null) | ||
{ | ||
val result = actions.sendPushbulletNote("[email protected]", "Title R2D2 OH2", "This has been sent by the new R2D2 bot") | ||
logInfo(filename, "Result of send action is: " + result) | ||
} | ||
} | ||
end | ||
val actions = getActions("pushbullet", "pushbullet:bot:r2d2") | ||
// push a note | ||
actions.sendPushbulletNote("[email protected]", "Note Example", "This is the pushed note.") | ||
// push a link | ||
actions.sendPushbulletLink("[email protected]", "Link Example", "This is the pushed link", "https://example.com") | ||
// push a file | ||
actions.sendPushbulletFile("[email protected]", "File Example", "This is the pushed file", "https://example.com/image.png") | ||
actions.sendPushbulletFile("[email protected]", null, null, "/path/to/somefile.pdf", "document.pdf") | ||
// use toFullString method to push the content of an Image item | ||
actions.sendPushbulletFile("[email protected]", ImageItem.state.toFullString) | ||
``` | ||
|
||
## Creating an account for your bot(s) | ||
## Creating an account | ||
|
||
The pushbullet accounts are bound to either Google or Facebook accounts. | ||
A Pushbullet account is linked to either a Google or Facebook account. | ||
|
||
- Create a bot account with either Facebook or Google | ||
- Go to "<https://www.pushbullet.com/>" | ||
- Chose to either "Sign up with Google" or "Sign up with Facebook". | ||
- Go to the [Pushbullet](https://www.pushbullet.com) website. | ||
- Select either "Sign up with Google" or "Sign up with Facebook". | ||
- Complete the signup process as guided by the pushbullet web site. | ||
- Continue with "Obtaining an API key". | ||
|
||
## Obtaining an API key | ||
## Obtaining an access token | ||
|
||
The API keys are bound to the pushbullet account. | ||
An access token is linked to a Pushbullet account. | ||
|
||
- Go to the pushbullet site. | ||
- Log in with either your personal account or the one you created for your bot. | ||
- Go to "<https://www.pushbullet.com/#settings/account>" | ||
- Go to your [Pushbullet account settings](https://www.pushbullet.com/#settings/account) page. | ||
- Click on "Create Access Token". | ||
- Copy the token created on the site. | ||
|
||
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. | ||
All other parameters are optional. | ||
If you use an alias key, the parameters (device, icon, sound, vibration) are overwritten by the alias setting on pushbullet. | ||
- Copy the created access token. | ||
|
||
## Rate limits | ||
|
||
As of 2019, free accounts have a limit of 100 pushes per month. | ||
This action does not evaluate the rate limiting headers though. | ||
|
||
## Translation | ||
|
||
This project is being translated on transifex. | ||
If you want to help, please join the project at the URL: | ||
|
||
- <https://www.transifex.com/hakan42/openhab-binding-pushbullet/dashboard/> | ||
|
||
## Libraries | ||
|
||
This action has been written without using libraries as jpushbullet or jpushbullet2. | ||
Both of those libraries use various libraries themselves which makes integrating them into openHAB a challenge. | ||
|
||
## pushbullet API | ||
|
||
- <https://docs.pushbullet.com/> | ||
- <https://docs.pushbullet.com/#push-limit> | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
bundles/org.openhab.binding.pushbullet/src/main/resources/OH-INF/update/instructions.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd"> | ||
|
||
<thing-type uid="pushbullet:bot"> | ||
<instruction-set targetVersion="1"> | ||
<remove-channel id="recipient"/> | ||
<remove-channel id="title"/> | ||
<remove-channel id="message"/> | ||
</instruction-set> | ||
</thing-type> | ||
|
||
</update:update-descriptions> |