Woersty / LoxBerry-Plugin-APC-UPS

APC UPS Plugin
Apache License 2.0
0 stars 1 forks source link

The plugin does not trigger any notifications #4

Open osemmler opened 3 years ago

osemmler commented 3 years ago

Successfully installed and connected to the UPS. The plugin correctly shows the status: STATUS : ONBATT However, when the status changes, the loxberry notification will not be triggered and thus the email will not be sent.

LoxBerry v2.2.0.4 Plugin 2020.12.13

Woersty commented 3 years ago

It's not configured by default. You have to configure it to match your needs.

osemmler commented 3 years ago

Can you please advise me where and how to configure email sending?

osemmler commented 3 years ago

After editing the onbaterry script data/plugins /apc_ups /onbattery

!/bin/sh

apcaccess | mail -s "WARNING - UPS running on batteries" mysecret@email.com php -f /opt/loxberry/webfrontend/html/plugins/apc_ups/email.php basename "$0" hostname $1 exit 99

An email from first line has been sent. Unfortunately, sending an email using email.php will fail. I did a little research and I guess the problem could be that the mail.json file contains little information:

{ "NOTIFICATION" : { "MAIL_PLUGIN_ERRORS" : "1", "MAIL_PLUGIN_INFOS" : "1", "MAIL_SYSTEM_ERRORS" : "1", "MAIL_SYSTEM_INFOS" : "true" }, "SMTP" : { "ACTIVATE_MAIL" : 1, "EMAIL" : "mysecret@email.com", "ISCONFIGURED" : 1 } }

Woersty commented 3 years ago

I’m not sure if mail.json is used. I will check later. I don’t use this. I use the notification within Loxone.