I followed your instructions and it's not working?
If I feed it some text into notifycmd.sh for example [ ./etc/nut/notifycmd.sh "test" ] I get a notification on Telegram, like this
But when I test the UPS, by pulling power, I don't get any notification?
Here's my notifycmd.sh
#!/bin/bash
GROUP_ID=#######
BOT_TOKEN=######
NOW=$(date)
case "${NOTIFYTYPE}" in
ONLINE|COMMOK)
EMOJI=$'\xE2\x9C\x85' # white heavy check mark
;;
ONBATT|COMMBAD|REPLBATT)
EMOJI=$'\xE2\x9A\xA0' # warning sign
;;
LOWBATT|FSD|NOCOMM|SHUTDOWN)
EMOJI=$'\xF0\x9F\x86\x98' # squared sos
;;
NOPARENT)
EMOJI=$'\xF0\x9F\x94\x84' # anticlockwise downwards and upwards open circle arrows
;;
esac
EMOJI+=$'\xEF\xB8\x8F' # The emoji should be displayed with emoji presentation
MESSAGE="${EMOJI} UPS Notification%0A"
MESSAGE+="UPS Name: $UPSNAME %0ANotify type: $NOTIFYTYPE %0ANotify message: $*"
curl \
-s \
--data "parse_mode=HTML" \
--data "text=$MESSAGE" \
--data "chat_id=$GROUP_ID" 'https://api.telegram.org/bot'$BOT_TOKEN'/sendMessage' > /dev/null
And I added the text in the /etc/nut upsmod.config as recommended, also added the correct permission to the notifycmd.sh file and added it to the Nut group.
I followed your instructions and it's not working?
If I feed it some text into notifycmd.sh for example [ ./etc/nut/notifycmd.sh "test" ] I get a notification on Telegram, like this
But when I test the UPS, by pulling power, I don't get any notification?
Here's my notifycmd.sh
And I added the text in the /etc/nut upsmod.config as recommended, also added the correct permission to the notifycmd.sh file and added it to the Nut group.
Please help