WeeWX and pv?

218 views
Skip to first unread message

kludo

unread,
Jan 7, 2022, 5:05:13 AM1/7/22
to weewx-user

I have installed WeeWX in the last few weeks and have come to know and appreciate the software.

But now i would like to add the solar yield of my pv system to the weewx database as well. Unfortunately, I have not found any suitable database fields for this. Do I have to adapt the database schema for this? Is there possibly already a ready-made solution for this?

Thanks

Peter Fletcher

unread,
Jan 7, 2022, 9:11:26 AM1/7/22
to weewx-user
You have at least two options. One is to keep your detailed solar records separately and pull the data items you want to display into either new fields or 'spare' fields in the weewx database. The other, of course, is to add all the fields you need to the weewx database. AFAIK, there is no ready-made 'package' that does this.

I don't incorporate my solar data in weewx, because I created a separate application that records all the data locally before I got into weather, and my solar provider has an excellent web-based App which displays the real-time data. I do, however, use the first approach to combine some of the data from my ecobee thermostat with weewx's weather data for display. Assuming that you have some degree of comfort with database design and Python programming, the weewx documentation will help you greatly with either approach, but you will also be able to get useful help and advice about implementation details here.

Karen K

unread,
Jan 7, 2022, 9:56:14 AM1/7/22
to weewx-user
There is no general solution to include PV values in WeeWX. As far as I know, an extension is available for one single german manufacturer, only.

kludo

unread,
Jan 9, 2022, 10:22:25 AM1/9/22
to weewx-user
Thank you for the answers, I will have to look into the subject more intensively. My PV system is already very old and there is no support from the manufacturer, but I can tap the harvest data via serial interface. Let's see which solution brings me the faster success.

kludo

unread,
Jan 20, 2022, 2:50:07 AM1/20/22
to weewx-user

Since I only want to display a few PV data, I decided to use the two database fields "signal1" and "signal2" as storage location for the output data of my two inverters.
In principle, this also works, but I do not receive totalized yield data. This means that at the end of the day, I can display the history, but not the daily output.

Another issue is the subsequent import of the stored data into the WeeWX database. I wanted, to have the year 2022 complete, to transfer the data saved as csv to the WeeWX database afterwards using wee_import.

I have prepared the csv accordingly and assigned "signal1" and "signal2" to the group group_energy in the units.py file. If I start the import with the parameter "--dry-run" everything is fine. Without "--dry-run" the process also runs without errors, but the data is not included in the database due to a UNIQUE problem.

However, I would like to add the PV values to the respective existing data record and not create a new data record. Is there no way to keep the existing record and only save the additional values?

I am very thankful for any tip

Tom Keffer

unread,
Jan 20, 2022, 8:51:27 AM1/20/22
to weewx-user
On Wed, Jan 19, 2022 at 11:50 PM kludo <udo.kl...@gmail.com> wrote:

Since I only want to display a few PV data, I decided to use the two database fields "signal1" and "signal2" as storage location for the output data of my two inverters.
In principle, this also works, but I do not receive totalized yield data. This means that at the end of the day, I can display the history, but not the daily output.


I'm not following you here. Why can't you display daily output? For example, $day.signal1.sum should show the sum of signal1 for the day. Same strategy for plots.

Another issue is the subsequent import of the stored data into the WeeWX database. I wanted, to have the year 2022 complete, to transfer the data saved as csv to the WeeWX database afterwards using wee_import.

I have prepared the csv accordingly and assigned "signal1" and "signal2" to the group group_energy in the units.py file. If I start the import with the parameter "--dry-run" everything is fine. Without "--dry-run" the process also runs without errors, but the data is not included in the database due to a UNIQUE problem.

However, I would like to add the PV values to the respective existing data record and not create a new data record. Is there no way to keep the existing record and only save the additional values?

I am very thankful for any tip


I can think of two strategies.

First, would be to write a small python program that imports the data using a SQL UPDATE command, rather than the INSERT command used by wee_import. There might be a database tool that can do this for you.

Alternatively, set up a second database with just PV data. Then use a 2nd database binding to show data from it. See the section Adding a second data source in the Customizing Guide.

Peter Fletcher

unread,
Jan 20, 2022, 9:33:19 AM1/20/22
to weewx-user
To expand slightly on Tom's response to the second half of your query, wee_import is designed to import complete archive records (or, at least, as complete as the source device produces) from an external source into the weewx database. It is not intended to update selected fields in existing records, which is what you want to do, nor can it be used to do so. Depending on your comfort with SQL and/or Python programming, you will need either to use the sqlite3 app directly to update the records or follow one of his suggested strategies.

kludo

unread,
Jan 23, 2022, 12:21:18 PM1/23/22
to weewx-user
Thank you very much for your support. I have solved the problem over the weekend by writing an according Python program. Now I have the current values and also the past values in my database.
Reply all
Reply to author
Forward
0 new messages