Emoncms.org Email Reports

Appreciate you making those changes @TrystanLea - I just pulled and tried again but got the following;

Fatal error: Call to a member function get() on boolean in /home/web/emailreport/emailreport-module/emailreport_controller.php on line 62

I don’t have redis enabled on my install and that line seems to correspond to;

 "ukenergy"=>json_decode($redis->get("ukenergy-stats"))

The good news is I was able to save the email report config in the web UI (which wasn’t working previously) so we are making progress!!

I managed to get the email to send by removing all references to ukenergy in both emailreport_controller.php and emailreportgenerator.php.

Could I be cheeky and ask for an option to disable this part of the email since it has no relevance to us folk outside of the UK?

Really very cool feature tho - going to get some good use out of this!

Thanks for adding this email feature.

Regarding "UK household average " value, would it be possible to add a variable so that we can compare our consumption to another country?

thanks again for all your work.
Walter

Hey @TrystanLea

I have the EmonCMS 9.8.7 set on the Synology NAS. I try to install the module, but I do not know how to make a symlink on Synology NAS.

Setup

Symlink the web part of the emailreport module into emoncms/Modules, if not using Raspberry Pi replace ‘pi’ with your home folder name:

ln -s /home/user/emailreport/emailreport-module /var/www/emoncms/Modules/emailreport

What will the command look like in my case?

EmonCMS Installed along the path:

/volume1/web/emoncms

Module emailreport Installed along the path:

/volume1/web/emoncms/Modules/emailreport

emailreport-module

/volume1/web/emoncms/Modules/emailreport/emailreport-module

Thank you.

P.S. I moved all the files from
/volume1/web/emoncms/Modules/emailreport/emailreport-module
to /volume1/web/emoncms/Modules/emailreport
and the module started work. But I received an error message:

Fatal error: Uncaught Error: Call to a member function get() on boolean in /volume1/web/emoncms/Modules/emailreport/emailreport_controller.php:62 Stack trace: #0 /volume1/web/emoncms/core.php(64): emailreport_controller() #1 /volume1/web/emoncms/index.php(180): controller('emailreport') #2 {main} thrown in /volume1/web/emoncms/Modules/emailreport/emailreport_controller.php on line 62

A quick note to say that I’ve fixed a number of bugs that became apparent on this weeks email out. Pushed all changes to the master branch on github.

I havent yet had a chance to make it possible to disable the uk energy stats.

@Tehnoinstyle_Aleksey I think the error your getting relates to the line requesting the uk energy stats from redis, once I’ve sorted an option to toggle that it should work for you.

Hi @TrystanLea

I updated the version of the emoncms to 9.8.8 and, accordingly, all the modules, including the mailreport. But again errors, and the module does not work for me.

What am I doing wrong?

P.S. I removing all references to “ukenergy” in both emailreport_controller.php and emailreportgenerator.php I got a preview:

But I can not send mail, get an error:

How to fix it? Thank you.

Hello @Tehnoinstyle_Aleksey I appreciate your enthusiasm but your moving too fast :slight_smile: The errors you are getting I think are as a result of redis being missing on Synology NAS. I mentioned I hadnt yet had a chance to develop the ability to switch uk energy stats off and the primary development target is emoncms.org then followed by emonpi/emonbase installs and so redis is currently a requirement. Please wait a little longer :slight_smile:

Ok, tell me please, when he’ll be ready.

I can try to install Radis if required. Install Redis on Synology

But I would like without it.

11 posts were split to a new topic: Email reports: pcharts licencing

Hello @TrystanLea

There are no changes? How to receive mail sending?

Thanks.

Hi @TrystanLea,

Following all notes, when i test php module, show error on line 70 in ‘weekly-cron.php’

pi@emonpi(rw):Modules$ php /var/www/emoncms/Modules/emailreport/weekly-cron.php >> /var/log/emoncms/emailreport.log
PHP Fatal error:  Call to a member function fetch_object() on boolean in /var/www/emoncms/Modules/emailreport/weekly-cron.php on line 70

Content of Line 70 is:

$result = $mysqli->query("SELECT * FROM emailreport");
while($row = $result->fetch_object()) {

but i can not see table ‘emailreport’ on emomcms database.

Database changed
mysql> show tables;
+-------------------+
| Tables_in_emoncms |
+-------------------+
| app_config        |
| dashboard         |
| feeds             |
| graph             |
| input             |
| multigraph        |
| rememberme        |
| schedule          |
| users             |
+-------------------+
9 rows in set (0.00 sec)

In another hand , symlink failed because File exist.

pi@emonpi(rw):Modules$ ln -s /home/pi/emailreport/emailreport-module /var/www/emoncms/Modules/emailreport
ln: failed to create symbolic link ‘/var/www/emoncms/Modules/emailreport/emailreport-module’: File exists

My apologies but may be procedure is not so clear for my. :frowning: Can you help me?

The command will only work once, then if you try it again it will fail as the symlink is already there, that’s expected and most likely good news as it strongly suggests the symlink is in place.

Have you used the “Update & check” button from the admin page in emoncms since adding the symlink? The “emailreport” table needs adding to the database before it will work.

do we have a walk through guide on how to enable and set this up on an emonpi?

+1, just want to find out if there has been any further development towards getting email reports working on emoncms base installations (not emoncms.org)?

1 Like

I dont think so, this module has not changed really in 3 years, its probably not too difficult to fix, probably needs updating to link in with update swift mailer class here emoncms/email.php at master · emoncms/emoncms · GitHub

Im not likely to get a chance to look at this for a while though unfortunately.

I’ve created an issue to keep track of this here: Fix & test on standard emoncms installation · Issue #6 · emoncms/emailreport · GitHub

BTW: It’s been a while since I last receive an email report from emoncms.org
Is something wrong on my side?

Regards

Sorry about this @Jujonet, this is now fixed. There was a file permission issue resulting from the recent server migration.

Very welcomed!!!

1 Like

Hi folks,

I am new to this community but have started to work with OEM. Thanks for the great work that is being done in this space. Before I get too far into it I am wanting to understand if anyone has / is it possible to modify the email report code to set up and email for various data feeds in emoncms?

I would like to be able to pull heat meter and electricity meter data and email it monthly.

Thanks in advance.