# Pushover action: Syntax

**URL:** <https://community.openhab.org/t/pushover-action-syntax/23188>\
**Category:** Actions\
**Tags:** pushover\
**Created:** [February 17, 2017, 3:18pm UTC](https://community.openhab.org/t/pushover-action-syntax/23188 "2017-02-17T15:18:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![binderth](https://community.openhab.org/user_avatar/community.openhab.org/binderth/32/56257_2.png) [@binderth](https://community.openhab.org/u/binderth)\
**Post date:** [February 17, 2017, 3:18pm UTC](https://community.openhab.org/t/pushover-action-syntax/23188/1 "2017-02-17T15:18:46Z")

</div>

I’m just testing pushover (OH2) and it works fine:

```php
	pushover("Waschmaschine ist gerade fertig geworden!")

```

But I’d like to change the title, priority, devices and sound individually per rule/action I use pushover. It seems, that if I’m adding more arguments, pushover-action expects me to put in my UserKey and TokenKey in each and every command? is that right? I didn’t find a Wikipage except this one:

> **[Actions](https://github.com/openhab/openhab1-addons/wiki/Actions#pushover-actions)**
>
> Add-ons for openHAB 1.x. Contribute to openhab/openhab1-addons development by creating an account on GitHub.

I’m in utter confusion! There seems to be a logic in place, I don’t get.  
e.g.: I’m using four Arguments, which one is it then:

- `pushover(String message, int priority, String url, String urlTitle`) or
- `pushover(String apiToken, String userKey, String message, String device)`

If I use more than one Argument, I get this Errors in my openhab.log:

```php
2017-02-17 16:00:48.479 [WARN] [org.openhab.io.net.http.HttpUtil] - Method failed: HTTP/1.1 400 Bad Request
2017-02-17 16:00:48.491 [ERROR] [ab.action.pushover.internal.Pushover] - Received error message from Pushover: application token is invalid

```

How do I configure my pushover.cfg AND how do I call pushover() in a rule to have:

- specific title
- specific message
- specific priority
- specific sound

on each action/rule I set up. I’m lost.

For reference my config and my rule.

```csv
rule "Waschmaschine voll TEST"
when
	Item Binder_WaMa_Full changed to ON
then
	pushover("Waschmaschine ist gerade fertig geworden!", "ThomasPhone", 1)
end

```

addons.cfg:

```php
...
# A comma-separated list of actions to install (e.g. "mail,pushover")
action = mail, pushover
...

```

pushover.cfg

```php
# The timeout for the communication with the Pushover service (optional, defaults
# to 10000 milliseconds)
#defaultTimeout=

# You need to provide a Pushover API token to send to devices. If not here, than during
# the action call itself.
defaultToken=myTokenKey

# You need to provide a Pushover User Key to send to devices. If not here, than during
# the action call itself.
defaultUser=myUserKey

# Name of the sending application (optional). Defaults to 'openHAB'.
defaultTitle=openHAB2

# The priority to use for messages if not specified otherwise. Can range from
# -2 (lowest) to 2 (highest)
#defaultPriority=

# Url to attach to the message if not specified in the command (optional). Can be left empty.
#defaultUrl=

# Url Title to attach to the message if not specified in the command (optional). Can be left empty.
#defaultUrlTitle=

# When priority is high priority (2), how often in seconds should messages be resent. Defaults to 300 seconds.
#defaultRetry=

# When priority is high priority (2), how long to continue resending messages until acknowledged. Defaults to 3600 seconds.
#defaultExpire=

```

---

<div class="post-metadata">

**Author:** ![crackerstealth](https://community.openhab.org/user_avatar/community.openhab.org/crackerstealth/32/70687_2.png) [@crackerstealth](https://community.openhab.org/u/crackerstealth)\
**Post date:** [February 27, 2017, 10:02pm UTC](https://community.openhab.org/t/pushover-action-syntax/23188/2 "2017-02-27T22:02:27Z")

</div>

I submitted a code change that will handle your use case ([[Pushover] Default Value Usage Fix by CrackerStealth · Pull Request #5123 · openhab/openhab1-addons · GitHub](https://github.com/openhab/openhab1-addons/pull/5123)).

The change will use any default values in the **pushover.cfg** file when an empty value (_null_ or _“”_) is passed into the primary pushover call. Except for priority because _int’s_ cannot be _null_.

An update to the latest code once it’s accepted and built will work like this for your specific case:

```auto
pushover(null, null, "Waschmaschine ist gerade fertig geworden!", null, "Waschmaschine voll TEST", null, null, 1, "magic")

```
