Closed modem7 closed 1 year ago
Since I have never used "ntfy" myself, I just created an account at Ntfy.sh and entered the data accordingly into the Pi.Alert configuration. Here the event notification and also the test notification works completely without problems.
Have you tried to send a test notification via "pialert-cli"? Errors may be displayed here, which can be used to further isolate the problem.
Apologies - this was my own fault. Seems that my Cloudflare bot rules were a bit too tight.
This is the script that finally helped me figure it out (it's crude, but my Python knowledge is next to zero, no doubt it could be improved):
#!/usr/bin/env python3
import requests
from requests_toolbelt.utils import dump
# To generate the auth token, use echo "Basic $(echo -n 'testuser:fakepassword' | base64)"
# As per https://docs.ntfy.sh/publish/#authentication
response = requests.post("https://ntfy.example.com/topicname",
data="Look ma, with auth",
headers={
"Authorization": "Basic authtoken"
})
print(dump.dump_all(response).decode("utf-8"))
No problem
Heya,
This may be an ID10T issue, but I can't seem to get NTFY to work.
I've set the following:
I've tried the following and this works:
Note, I haven't installed NTFY-cli on the server. I have checked
requests
is installed:Unsure where I may be going wrong.
On another note, would it also be possible to allow for bearer tokens as well as username + password?