# Discussion: update \`node-red-node-pushover\`

**URL:** https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912
**Category:** Developing Nodes
**Created:** [27 October 2020 20:48 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912 "2020-10-27T20:48:20Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [27 October 2020 20:48 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/1 "2020-10-27T20:48:21Z")

</div>

I've just prepared an update for `node-red-node-pushover` and would like to invite comments.

Pushover currently provides 5 levels of priority, where `Level -2` is the lowest, and creates no notification - just a message in the Pushover app, whilst `Level 2` is the highest level which generates audio & visual alerts which bypass a user's quiet hours. In this level, the Pushover app alert contains an 'Acknowledgment' button to confirm that the message was received.  
If however the message remains un-acknowledged, the Pushover server will continue to send further push messages at least every 30 seconds (user determined time), for up to 3hrs (user determined time) until acknowledgement is confirmed or the time expires.  
In addition to this Pushover also provide `Receipts` to indicate if the acknowledgement has been made, by whom and what time.

I've tried to expose these features in the node, making them available to use within the flow.  
Examples of uses could include; if an alert is not acknowledged within 5 minutes, then another alert could be sent to a different person.  
Maybe to log medication alerts, or just to ensure that you don't miss alerts by being away from your phone for a few minutes...

**OUTPUTS**  
I've added an output to the node which provides confirmation that the message has been received by the Pushover server;  
`status: 1`  
and a receipt, which can then be used to ask the Pushover server for a status report to see if the msg was acknowledged.  
`receipt: "rn74yjg5d32hbfmrwv2bf7hm3uea3w"`

![pushnode](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/91c121c6386cdeea61654ed84b0e311b03d370bb.jpeg)

**NODE CONFIG**  
I've added 3 further options to the node config which are exposed if Level 3 is selected;

- `Retry` where the time between each alert can be set, with a minimum period of every 30 seconds.

- `Expire` sets the amount of time that the alerts will continue before expiration (maximum 3hrs)

- `Receipt URL` entering a publicly accessible url where the Pushover server can send a POST request when the alert has been acknowledged.

 ![level](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0d930cba5138a5419609ea02139e806224d00248.gif)

**RECEIPTS**  
There are two ways to find out if an alert has been acknowledged;

The first is to send a GET request to the Pushover server in the following format;  
`https://api.pushover.net/1/receipts/(your receipt).json?token=(your app token)`

The response will take the format;

![conf1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bc019db9c187a3f61a843f41e0b8c8032cab939d.jpeg)

The second way is to create a public accessible HTTP endpoint, where Pushover can POST confirmation as soon as the alert is acknowledged (to the `receipt URL` described above);

![conf](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/30b1df4d22e31d5a7eabf889084cd0487d36712a.jpeg)

- `acknowledged` indicates either `0` or `1` (no or yes)
- `acknowledged_at` shows the time it was acknowledged.
- `acknowledged_by_device` shows the device (in my case - a Pixel phone)

Further details of Pushover receipts [can be found here](https://pushover.net/api/receipts).

The changes so far [can be seen in my repo](https://github.com/Paul-Reed/node-red-nodes/tree/pushover_features/social/pushover), but I have not yet documented the changes in the readme or node html as yet.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [27 October 2020 21:36 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/2 "2020-10-27T21:36:49Z")

</div>

Looks good. The options only appear when required. Nice. Do the status reports appear for all levels ? Or can the output pin be optional as well ? Presumably the callback url can be omitted safely.

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [27 October 2020 22:12 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/3 "2020-10-27T22:12:22Z")

</div>

> [@dceejay](#):
>
> The options only appear when required. Nice

Thanks to @hotNipi for the help with that!  
`node-red-contrib-ui-level` was used for the template.

> [@dceejay](#):
>
> Do the status reports appear for all levels

Yes, it confirms receipt by the Pushover servers across all levels.

> [@dceejay](#):
>
> Or can the output pin be optional as well ?

Because it can be used at all levels, it's permanent present at the moment.

> [@dceejay](#):
>
> Presumably the callback url can be omitted safely.

There are no errors in the response msg back from the Pushover server with or without the url being present, but if the url is malformed, such as `hppb://myserver.com/receipt` then it will report an error in the debug.

```auto
Error: {"callback":"must be a valid URL","errors":["callback must be a valid URL when included"]

```

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [29 October 2020 19:37 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/4 "2020-10-29T19:37:46Z")

</div>

> [@Best notification app on android?](https://discourse.nodered.org/t/best-notification-app-on-android/16809/30):
>
> This could be a fun contribution to do when I some day will regain my inspiration to hacking stuff

@ristomatti, is this the sort of thing that you had in mind?

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [30 October 2020 06:06 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/5 "2020-10-30T06:06:56Z")

</div>

Well I hadn't yet thought about the details at all. Could you maybe add more details to what I you'd like me to comment on? 🙂

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [30 October 2020 09:00 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/6 "2020-10-30T09:00:43Z")

</div>

You commented about Level 3 confirmations a week or so ago in this thread -

> [@Best notification app on android?](https://discourse.nodered.org/t/best-notification-app-on-android/16809/24):
>
> I'm not sure though if any of the existing Node-RED nodes for Pushover support this feature(?).

... which I've tried to implement.  
Do these proposed changes fulfill the feature that you commented about?

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [2 November 2020 05:06 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/7 "2020-11-02T05:06:39Z")

</div>

Ah sorry, I've been too busy to keep my focus properly the last two weeks. I'll push the defer button and will come back to this. In short what I'm after is to get a NR message in one way or another when an emergency level notification is acknowledged. If your proposal fulfils this then it's likely what I was after. I'll anyway come back to this when I have time to read what you proposer with some thought!

---

<div class="post-metadata">

### Author: ![lukesav1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lukesav1/32/33339_2.png) [@lukesav1](https://discourse.nodered.org/u/lukesav1)
#### Post date: [9 December 2020 14:23 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/8 "2020-12-09T14:23:35Z")

</div>

@Paul-Reed The changes look great, Thanks

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [7 February 2021 14:23 UTC](https://discourse.nodered.org/t/discussion-update-node-red-node-pushover/34912/9 "2021-02-07T14:23:42Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
