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

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

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.

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

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

  • 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.

The changes so far can be seen in my repo, but I have not yet documented the changes in the readme or node html as yet.

1 Like

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.

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

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

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

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.

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

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

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? :slightly_smiling_face:

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

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

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!

1 Like