Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

high priority not working #12

Open
identd113 opened this issue Oct 21, 2020 · 15 comments
Open

high priority not working #12

identd113 opened this issue Oct 21, 2020 · 15 comments

Comments

@identd113
Copy link

The priority function does not seem to work as designed.
This is my config:
{ "name": "Deep Freeze Open", "message": "Deep Freeze Open", "priority": "high" }
This does send a message, but as a regular priority
According to pushover documentation, the request to api.pushover.net should be "1" and not "0" or "-1"

@meg768
Copy link
Owner

meg768 commented Oct 30, 2020

You may be right! Make a pull request and I will merge it.

@FSTNDonald
Copy link

Hi,

this plugin is the only way for homekit alarm devices to swap from IOS tri-cord notifications (over-heard) to a real alarm sound on iPhone.
... but ... the priority parameter does not work as expected. YOu can specify key words or numbers, the iphone app only uses 'normal' sound.
Furthermore value "2" priority adds a continous repeating sound, which needs to be stopped by the user on the iphone (ref another request.

@identd113
Copy link
Author

I do not have any skills to do this, just reporting the issue.

@FSTNDonald
Copy link

Hi @identd113, sorry, my remark was meant @meg768 (owner of the code to my understanding).
Not sure, whether he is monitoring this thread ...

@meg768
Copy link
Owner

meg768 commented Jan 18, 2021

The documentation is a bit confusing. Priority "high" means that a message should be sent even though the master switch is turned off. It has nothing to do with Pushover priority. All messages are sent with priority 0 to Pushover. This is of course wrong.

@meg768
Copy link
Owner

meg768 commented Jan 18, 2021

So, if I changed the "priority" property to be the actual integer Pushover value, would that be OK? Translating "lowest" to -2, "low" to -1, "normal" to 0 and "high" to 1. It would be a bit more understandable for Pushover users. When should a message be sent when the master switch is turned off? My suggestion is when set to "normal" or "high", or priority >= 0. Would appreciate your input.

@identd113
Copy link
Author

identd113 commented Jan 18, 2021

the "priority" in the config is ambiguous. I would leave the current priority to mean whatever it means now, and add a new key/value pair to set message priority. If no key is used, the default 0 is used. Also "2" is emergency priority, which should be included as a valid option.
Setting a new key would prevent this being a breaking change.

@FSTNDonald
Copy link

Hi, @meg768
not sure, what "master switch" refers to ...? Same what is the intent of priority in current implementation, a master is a master ...?

Let me explain my plan please.
My setup: homebridge (RasPi) with pushover plugin, offering "virtual buttons" to automations (on iOS), which want to signal an event on iOS. The standard iOS sound is tri-cord, which is over-heard, thus pushover app.

My intention is to signal an event such way, that the settings of pushover (in the iOS app) for "alert setting", especially critical alerts und volume (... deafening) apply.

In case a sensor detects such alarm event, it shall trigger the respective message (refer name: ALARM in attached homebridge config file for example) and the iPhone shall play the sound as per setting for alerts.
As the iOS app has 2 sounds only: "default" and "high-priority", and for "high-priority" sound in addition a switch to make it a "critical-alert" with individual volume, there are apparently only 2 alert types in the homebrige config: default and high-priority.
I would of course prefer to have the full manifold of settings available, but that would require to change the iOS app also I think.
BR Donald

current homebridge config, not working as expected:
{
"platform": "Pushover",
"name": "Messages",
"pushover": {
"user": "u.......1c19",
"token": "......."
},
"messages": [
{
"name": "Info 1",
"message": "Information 1"
},
{
"name": "Info 2",
"message": "Information 2"
},
{
"name": "ALARM",
"message": "Security Alarm",
"priority": "high"
}
]
}

@identd113
Copy link
Author

Another value needs to get passed in the POST. Pushover should always provide some value, and have a corresponding config line item to set this value.

Lowest Priority (-2)

When the priority parameter is specified with a value of -2, messages will be considered lowest priority and will not generate any notification. On iOS, the application badge number will be increased.

Low Priority (-1)

Messages with a priority parameter of -1 will be considered low priority and will not generate any sound or vibration, but will still generate a popup/scrolling notification depending on the client operating system. Messages delivered during a user's quiet hours are sent as though they had a priority of (-1).

Normal Priority (0)

Messages sent without a priority parameter, or sent with the parameter set to 0, will have the default priority. These messages trigger sound, vibration, and display an alert according to the user's device settings. On iOS, the message will display at the top of the screen or as a modal dialog, as well as in the notification center. On Android, the message will scroll at the top of the screen and appear in the notification center.

If a user has quiet hours set and your message is received during those times, your message will be delivered as though it had a priority of -1.

High Priority (1)

Messages sent with a priority of 1 are high priority messages that bypass a user's quiet hours. These messages will always play a sound and vibrate (if the user's device is configured to) regardless of the delivery time. High-priority should only be used when necessary and appropriate.

High-priority messages are highlighted in red in the device clients.

Emergency Priority (2)

Emergency-priority notifications are similar to high-priority notifications, but they are repeated until the notification is acknowledged by the user. These are designed for dispatching and on-call situations where it is critical that a notification be repeatedly shown to the user (or all users of the group that the message was sent to) until it is acknowledged. The first user in a group to acknowledge a message will cancel retries for all other users in the group.

Applications sending emergency notifications are issued a receipt that can be used to get the status of a notification and find out whether it was acknowledged, or automatically receive a callback when the user has acknowledged the notification.

-https://pushover.net/api

@Galapgs
Copy link

Galapgs commented Apr 3, 2021

You may be right! Make a pull request and I will merge it.

Done ;-) Also included to add a title.
Emergency priority (2) throws an error though: expire must be supplied with priority=2

@meg768
Copy link
Owner

meg768 commented Apr 3, 2021

I will fix it tomorrow, hopefully. 😊

@meg768
Copy link
Owner

meg768 commented Apr 3, 2021

Fixed. Version 1.0.14 on npm. Default is retry:60 and expire:3600

@Galapgs
Copy link

Galapgs commented Apr 3, 2021

Thanks!

@meg768
Copy link
Owner

meg768 commented Apr 3, 2021

Need to update the documentation regarding this...

@identd113
Copy link
Author

I believe documentation still needs to be done but otherwise this can be closed as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants