In case any one else comes along, I thought I would detail how I got this to work:

You first need to install Swiftmailer so open a terminal and type:

git -C /opt/emoncms/modules clone -b 'v5.4.8' --single-branch https://github.com/swiftmailer/swiftmailer.git

Then you need to edit var/www/emoncms/settings.ini to add the following (I’m using Yahoo but yours may vary):

[smtp]
; Email address to email proccessed input values
default_emailto = ‘youremail@yahoo.co.uk’

host = “smtp.mail.yahoo.com”
; 25, 465, 587
port = “465”
from_email = ‘youremail@yahoo.co.uk’
from_name = ‘youremail’
; sendmail, when enabled we use local email server instead smtp relay
sendmail = false
; Comment lines below that dont apply
; ssl, tls
encryption = “ssl”
username = “youremail@yahoo.co.uk”
password = “abcd efgh ivkl mnop”

To increase security, email providers don’t want you using your email account login with 3rd party apps so you have to generate a unique code for emoncms. Googling ‘Yahoo app passwords’ takes you to their help page explaining how to do this. You can use any name for the app - it’s used mainly to help you remember what it’s for. The generated password doesn’t replace the normal password you use to login - it is just for emoncms to use so it can send out emails.

Now you need to configure the input processing. Mine is set up like this:

This sends me an email when the house use drops below 130W, then again after at least an hour (3600 seconds) rather than every 10 seconds that the input process is worked through. I set a minimum value of 100W to weed out false alarms (as various inverters and diverters juggle with balancing supply and demand - I get the house use below 130W momentarily really frequently) and use the rate process for the same reason. I still get the odd email once every 3 or so weeks - I just delete that. If the treatment plant is off then I get several emails in a day so I know then to investigate.

At one point I was worried that I wanted to do this processing on the ‘log to feed’ value but also needed to use the ‘Power to kWh’ process. Note that the ‘Power to kWh’ doesn’t modify the value that’s passed along to the next step in the chain so these steps are actually working on the ‘log to feed’ value not the ‘Power to kWh’ value!

2 Likes