Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Solar-Assistant reports by email

Featured Replies

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 etc

Hope you guys enjoy and if this helped you, consider supporting my efforts with a beer or two 😁🍻

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.

jf66MZB.png

  • 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.

jf66MZB.png

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.

  • 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.

jf66MZB.png

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]

OR

For multiple recipients: EMAIL_TO=[email protected], [email protected], [email protected]

To update your code, simply run the below from your cloned directory:


git pull

docker-compose down

docker-compose up -d --build

Let me know if it works for you.

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]

OR

For multiple recipients: EMAIL_TO=[email protected], [email protected], [email protected]

To update your code, simply run the below from your cloned directory:


git pull

docker-compose down

docker-compose up -d --build

Let me know if it works for you.

Got it working. Thanks for the quick update!

I picked up two more things while testing.

  1. The Email sent successfully text still gets sent on the Log even though it failed. (I entered the wrong password.)

  2. 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.

Blww7TK.png

  • Author
34 minutes ago, ScuBaLlama said:

Got it working. Thanks for the quick update!

I picked up two more things while testing.

  1. The Email sent successfully text still gets sent on the Log even though it failed. (I entered the wrong password.)

  2. 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.

Blww7TK.png

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 by StefanV

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.

R5snub4.png

  • 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.

R5snub4.png

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:

image.png

Just do a pull again and rebuild and you should be good. 🙂

Edited by StefanV

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:

image.png

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.

  • 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.

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.