I’m wanting to send an email when the battery in the emonTH is flat.
I’ve got the rules setup But I get
2021-06-23 11:01:40.959|ERROR|email.php|check() Could not find SwiftMailer, email functions are ignored.
2021-06-23 11:01:40.959|ERROR|eventp_processlist.php|Email send returned error. message=‘Could not find SwiftMailer, email not sent.’
I’ve tried to install swiftmailer with pear But i get
Hello @david emoncms currently uses an older version of swift mailer, you should be able to install using the command (assuming that you have an emonPi/base system):
I also think the time is 2 hours off. I think the log should be ‘2021-06-24 08:41’ instead of ‘06:41’. The timezone in my emoncms-account is 'GMT +02:00"
I used the example body text At {time} your {type} from {node} with key {key} named {name} had value {value}. I now changed it to A test e-mail. I’ll keep you updated.
Unfortunately to no success :-(. The strange things I see:
I don’t get get an e-mail, because error Trying to access array offset on value of type null remains.
The time in the log is 2 hours off.
As long as I exceed the value of the quarter peak, I’ll get an e-mail every 10 seconds. But first I need to fix the sending of the e-mail itself…
I tried to know if there is an issue with either sourceid or sourcetype option, by adding the following code, but newfile.txt remains empty. The strange thing is that the error still refers to eventp_processlist.php:110 which is now the line $myfile = .... So it seems emoncms is working with “the old code”.
I couldn’t fix the e-mail problem in emoncms, so I went for another solution with Node-Red that seems to work. See the topic “Calculate quarter-hour peak in kW”.
I’ve not been able to get SwiftMail to work either (emoncms version 10.2.6). The server is definitely capable of sending email from PHP - I checked that with a separate script - but it looks to be a big job to hack the emoncms code to remove the reliance on SwiftMail. I downloaded SwiftMail from git and installed it in the right place and then confirmed that email.php was finding it - but it was still throwing up errors related to using SwiftMail:
PHP Fatal error: Uncaught Error: Call to undefined method Swift_Message::newInstance() in /data/web/www/Lib/email.php
Don’t know where to go from here. All I wanted to do was to set up the password and API keys for a new user account.