April 9, 20251 yr Hi everyone, so I had the need to get daily, weekly and monthly solar statistics emailed to me but after requesting this directly from the Solar-Assistant team for months, I decided to create it myself. I have made it available to all if you can find the use for it and can be found here - https://github.com/Stef1986/email_scheduler_solar_assistant Once you have cloned the repo locally, you simply edit the .env file with your Solar Assistant's MQTT details as well as your reporting preferences and run the docker-compose up. Just have a look at the README.md, it should be detailed enough to get you going. As a quick overview, basically what will happen is on the host of your choosing, you will run the docker container that will subscribe to the MQTT topic created in Solar-Assistant and will ingest all the data. It will then (based on your choosing) schedule daily, weekly and/or monthly statistic reports to be emailed to your inbox. The body of the email will contain a nice table with statistics (configurable in the .env file) with min/max/avg values as well as a csv attachment (also configurable) containing the totals for daily, weekly and monthly for stats like PV generated, Battery in, Battery out, etc etcHope you guys enjoy and if this helped you, consider supporting my efforts with a beer or two 😁🍻
April 10, 20251 yr Thank you so much for this! I set up a docker on my homelab last night, and it's working as intended. Any chance that a report can be sent to two email addresses? Attached is an example output I got for someone who wants to see what the report would look like.
April 10, 20251 yr Author 9 minutes ago, ScuBaLlama said:Thank you so much for this! I set up a docker on my homelab last night, and it's working as intended. Any chance that a report can be sent to two email addresses? Attached is an example output I got for someone who wants to see what the report would look like.Your are most welcome and I am glad it helps you. With regards to this report being sent to multiple emails, I can most definitely build in the functionality for you. I will see if I can get to that either today or tomorrow.
April 10, 20251 yr Author 1 hour ago, ScuBaLlama said:Thank you so much for this! I set up a docker on my homelab last night, and it's working as intended. Any chance that a report can be sent to two email addresses? Attached is an example output I got for someone who wants to see what the report would look like.Multi-recipient functionality added with whitespace support so you could add email addresses in your .env file like:For a single recipient: EMAIL_TO=[email protected] For multiple recipients: EMAIL_TO=[email protected],[email protected],[email protected] ORFor multiple recipients: EMAIL_TO=[email protected], [email protected], [email protected] To update your code, simply run the below from your cloned directory:git pulldocker-compose downdocker-compose up -d --buildLet me know if it works for you.
April 10, 20251 yr 8 hours ago, StefanV said:Multi-recipient functionality added with whitespace support so you could add email addresses in your .env file like:For a single recipient: EMAIL_TO=[email protected]For multiple recipients: EMAIL_TO=[email protected],[email protected],[email protected]ORFor multiple recipients: EMAIL_TO=[email protected], [email protected], [email protected] To update your code, simply run the below from your cloned directory:git pulldocker-compose downdocker-compose up -d --buildLet me know if it works for you.Got it working. Thanks for the quick update! I picked up two more things while testing. The Email sent successfully text still gets sent on the Log even though it failed. (I entered the wrong password.)Do I need to rebuild the docker image for the CSV Report = 0 to work? I changed the env variable and restarted the container, but it's still sending me the CSV.
April 10, 20251 yr Author 34 minutes ago, ScuBaLlama said:Got it working. Thanks for the quick update!I picked up two more things while testing.The Email sent successfully text still gets sent on the Log even though it failed. (I entered the wrong password.)Do I need to rebuild the docker image for the CSV Report = 0 to work? I changed the env variable and restarted the container, but it's still sending me the CSV.Please pull the new version and test. I just cannot test at the moment. The success message should not display if the email fails. Also you should now be able to set the csv attachment to 0 and should just need to restart the container to take effect. Edited April 10, 20251 yr by StefanV
April 10, 20251 yr 39 minutes ago, StefanV said:Please pull the new version and test. I just cannot test at the moment. The success message should not display if the email fails. Also you should now be able to set the csv attachment to 0 and should just need to restart the container to take effect.I still get the same success message after an error with the email password. Thanks for the CSV Report fix. It's now working by just changing the env variable and restarting.I truly hope this repo gets to be part of the official solar assistant workings in the future.
April 10, 20251 yr Author 31 minutes ago, ScuBaLlama said:I still get the same success message after an error with the email password.Thanks for the CSV Report fix. It's now working by just changing the env variable and restarting.I truly hope this repo gets to be part of the official solar assistant workings in the future.Ah I found the issue. There was an additional success message being printed from the report_generator.py where the emailer.py already handled that part. Should be fixed now.I inputted my email password incorrect to replicate your use case:Just do a pull again and rebuild and you should be good. 🙂 Edited April 10, 20251 yr by StefanV
April 11, 20251 yr 11 hours ago, StefanV said:Ah I found the issue. There was an additional success message being printed from the report_generator.py where the emailer.py already handled that part. Should be fixed now.I inputted my email password incorrect to replicate your use case:Just do a pull again and rebuild and you should be good. 🙂Amazing! Thank you so much for the quick turnaround. I'm glad I could help with the testing process. It's working as expected now.
April 11, 20251 yr Author 5 minutes ago, ScuBaLlama said:Amazing! Thank you so much for the quick turnaround. I'm glad I could help with the testing process. It's working as expected now.Only a pleasure bud. And thanks for the help with the testing.
May 8, 20251 yr Just checking in here again. I didn't get my report last night, and my container was still running but not reporting anymore. This was the error message from the log :
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.