Closed matbor closed 10 years ago
I see "HTTP Error 400: Bad Request" in there which leads me to believe something's missing ... The docs say "Rather than periodically polling our receipts API, you may also include a callback parameter when submitting your emergency notification."
We don't support that. PR welcome.
Ok.
Just FYI, this is what I used to successfully test it, will have a look at how it can be changed tmr...
import httplib, urllib
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": " insert key here ",
"user": " insert user key here ",
"title": "testing priority2",
"message": "hello world",
"priority": 2,
"retry": 60,
"expire": 3600,
}), { "Content-type": "application/x-www-form-urlencoded" })
Works here ...
2014-02-27 15:52:49,701 pushover *** MODULE=services/pushover.pyc: service=pushover, target=hippo
2014-02-27 15:52:49,701 pushover Sending pushover notification to hippo [{'priority': 2, 'retry': 60, 'expire': 3600}]...
2014-02-27 15:52:50,814 pushover Successfully sent pushover notification
Are you sure your payload is plain text?
Weird, will try again in the morning, but the payload was the same message for both of the tests above. Used mqtt inspector to send it. All I changed was the priority in the mqttwarn.conf.
Strange working today! sorry about that.
Ok.
Just FYI, this is what I used to successfully test it, will have a look at how it can be changed tmr...
import httplib, urllib conn = httplib.HTTPSConnection("api.pushover.net:443") conn.request("POST", "/1/messages.json", urllib.urlencode({ "token": " insert key here ", "user": " insert user key here ", "title": "testing priority2", "message": "hello world", "priority": 2, "retry": 60, "expire": 3600, }), { "Content-type": "application/x-www-form-urlencoded" })
9 Years Later. Thank you!
To send an emergency-priority notification, the priority
parameter must be set to 2 and the retry
and expire
parameters must be supplied.
If I use the priority map of 2 the service doesn't seem to send the notification....
2014-02-27 23:06:30,290 pushover *** MODULE=services/pushover.pyc: service=pushover, target=cfaalerts 2014-02-27 23:06:30,290 pushover Sending pushover notification to cfaalerts [{'priority': 2, 'retry': 60, 'expire': 3600}]... 2014-02-27 23:06:31,399 pushover Error sending pushover notification to cfaalerts [{'priority': 2, 'retry': 60, 'expire': 3600}]: HTTP Error 400: Bad Request 2014-02-27 23:06:31,400 mqttwarn Notification of pushover for
/notifications/cfaalerts' FAILED`But if I change it back to a 1 it works fine......
2014-02-27 23:06:55,930 pushover *** MODULE=services/pushover.pyc: service=pushover, target=cfaalerts 2014-02-27 23:06:55,930 pushover Sending pushover notification to cfaalerts [{'priority': 1, 'retry': 60, 'expire': 3600}]... 2014-02-27 23:06:57,062 pushover Successfully sent pushover notification
I tired sending the same message with another python script I wrote with a priority of 2 and the same retry and expire times and it works fine.
Matt.