pvpower


Namepvpower JSON
Version 0.3.16 PyPI version JSON
download
home_page
Summaryphotovoltaic, forecast, power, solar, PV, weather, DWD, machine learning, energy management
upload_time2023-04-02 16:24:49
maintainer
docs_urlNone
authorGregor Roth
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # photovoltaic power forecast

pv_forecast provides a set of artifacts to obtain PV solar power forecast. The library uses machine learning approaches to perform forecasts.
To get appropriated results, real measured PV power values must be delivered, periodically. Internally, the library makes use of [DWD](https://dwd-geoportal.de/products/G_FJM/) weather forecast data.

**Installing the library**

To install this software you may use [PIP](https://realpython.com/what-is-pip/) package manager such as shown below
```
sudo pip install pvpower
```

**Using the library**

After this installation you should configure the library with your environment parameters.
You have to set the closest DWD station id of our PV system location. Refer [DWD station list](https://www.dwd.de/DE/leistungen/met_verfahren_mosmix/mosmix_stationskatalog.cfg?view=nasPublication&nn=16102) to select the proper station id.     
```
from pvpower.forecast import PvPowerForecast

dwd_station_id = 'L160'
pv_power_forecast = PvPowerForecast(dwd_station_id)
```

To get a power forecast, the predict method has to be called
```
tomorrow = datetime.now() + timedelta(days=1)
power_watt_tomorrow = forecast.predict(tomorrow)
```

**Train the library with real measurements**

It is essential that the PvPowerForecast library is provided with real measured PV values of our PV system. 
The provided real data is used to adapt the internal machine learning engine to your specific environment. 
Providing technical parameters of your PV system such as installed power or cardinal direction is not required. 
The **library is self-learning**.

```
# please provide the real measured PV power value periodically. 
# The period should be between 1 minute and 15 minutes.

while True:
    real_pv_power_watt = ...read real PV power ...
    pv_power_forecast.add_current_power_reading(real_pv_power_watt)
    time.sleep(60)
```
The provided real measurements will be stored internally on disc and be used to update the internal prediction model. 
Please consider, that a more accurate forecast requires collecting real PV measurements for at least 2-3 weeks, typically. 
Do not stop providing measurements, even though the predictions become better and better. 
You may use a periodic job to provide the real PV values

**Energy management system support**

The basic functionality of this library is to support photovoltaic power forecast. However, to maximize the yield 
of your PV system, your home appliances such as a dishwasher or laundry machine should operate only in periods when 
your PV system is delivering sufficient solar power. To manage this, the *Next24hours* convenience class can be used as shown below 
```
from pvpower.forecast import PvPowerForecast
from pvpower.forecast_24h import Next24hours

power_forecast = PvPowerForecast('L160')
next24h = Next24hours.of(power_forecast)
peek_watt = next24h.peek()
peek_time = next24h.peek_time()
...
```

To start your home appliance such as a dishwasher at the right time you may query the available execution time frames. 
In the example below the frames will be filtered considering a hypothetical basic electricity consumption of 350 watt per hour. Time frames will be considered only, 
if the solar power is higher than the expected basic electricity consumption. 
Based on the resulting time frames the best one is used to start the home appliance in a delayed way.  
```
...
pogram_duration_hours = 3
high_power_3h_frames = next24h.frames(width_hours=pogram_duration_hours).filter(min_watt_per_hour=350)
if high_power_3h_frames.empty():
    # start now (no sufficient solar power within next 24h)
    my_dishwasher.start_delayed(datetime.now())
else:
    # start delayed when best frame is reached
    best_3h_frame = high_power_3h_frames.best()
    my_dishwasher.start_delayed(best_frame.start_time)
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pvpower",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Gregor Roth",
    "author_email": "gregor.roth@web.de",
    "download_url": "https://files.pythonhosted.org/packages/96/19/d0e515437b41e2c932fdbdac0654bd59ed489224fe0530f64e14427521e0/pvpower-0.3.16.tar.gz",
    "platform": null,
    "description": "# photovoltaic power forecast\n\npv_forecast provides a set of artifacts to obtain PV solar power forecast. The library uses machine learning approaches to perform forecasts.\nTo get appropriated results, real measured PV power values must be delivered, periodically. Internally, the library makes use of [DWD](https://dwd-geoportal.de/products/G_FJM/) weather forecast data.\n\n**Installing the library**\n\nTo install this software you may use [PIP](https://realpython.com/what-is-pip/) package manager such as shown below\n```\nsudo pip install pvpower\n```\n\n**Using the library**\n\nAfter this installation you should configure the library with your environment parameters.\nYou have to set the closest DWD station id of our PV system location. Refer [DWD station list](https://www.dwd.de/DE/leistungen/met_verfahren_mosmix/mosmix_stationskatalog.cfg?view=nasPublication&nn=16102) to select the proper station id.     \n```\nfrom pvpower.forecast import PvPowerForecast\n\ndwd_station_id = 'L160'\npv_power_forecast = PvPowerForecast(dwd_station_id)\n```\n\nTo get a power forecast, the predict method has to be called\n```\ntomorrow = datetime.now() + timedelta(days=1)\npower_watt_tomorrow = forecast.predict(tomorrow)\n```\n\n**Train the library with real measurements**\n\nIt is essential that the PvPowerForecast library is provided with real measured PV values of our PV system. \nThe provided real data is used to adapt the internal machine learning engine to your specific environment. \nProviding technical parameters of your PV system such as installed power or cardinal direction is not required. \nThe **library is self-learning**.\n\n```\n# please provide the real measured PV power value periodically. \n# The period should be between 1 minute and 15 minutes.\n\nwhile True:\n    real_pv_power_watt = ...read real PV power ...\n    pv_power_forecast.add_current_power_reading(real_pv_power_watt)\n    time.sleep(60)\n```\nThe provided real measurements will be stored internally on disc and be used to update the internal prediction model. \nPlease consider, that a more accurate forecast requires collecting real PV measurements for at least 2-3 weeks, typically. \nDo not stop providing measurements, even though the predictions become better and better. \nYou may use a periodic job to provide the real PV values\n\n**Energy management system support**\n\nThe basic functionality of this library is to support photovoltaic power forecast. However, to maximize the yield \nof your PV system, your home appliances such as a dishwasher or laundry machine should operate only in periods when \nyour PV system is delivering sufficient solar power. To manage this, the *Next24hours* convenience class can be used as shown below \n```\nfrom pvpower.forecast import PvPowerForecast\nfrom pvpower.forecast_24h import Next24hours\n\npower_forecast = PvPowerForecast('L160')\nnext24h = Next24hours.of(power_forecast)\npeek_watt = next24h.peek()\npeek_time = next24h.peek_time()\n...\n```\n\nTo start your home appliance such as a dishwasher at the right time you may query the available execution time frames. \nIn the example below the frames will be filtered considering a hypothetical basic electricity consumption of 350 watt per hour. Time frames will be considered only, \nif the solar power is higher than the expected basic electricity consumption. \nBased on the resulting time frames the best one is used to start the home appliance in a delayed way.  \n```\n...\npogram_duration_hours = 3\nhigh_power_3h_frames = next24h.frames(width_hours=pogram_duration_hours).filter(min_watt_per_hour=350)\nif high_power_3h_frames.empty():\n    # start now (no sufficient solar power within next 24h)\n    my_dishwasher.start_delayed(datetime.now())\nelse:\n    # start delayed when best frame is reached\n    best_3h_frame = high_power_3h_frames.best()\n    my_dishwasher.start_delayed(best_frame.start_time)\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "photovoltaic, forecast, power, solar, PV, weather, DWD, machine learning, energy management",
    "version": "0.3.16",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f85d76c85d2eeb31efc13b85711b62eade8ae596bed8fa735ecd7ad7fb59acbc",
                "md5": "501d83754d0301b7d84280b462482abd",
                "sha256": "9c01d7b92dbc1016076823c35c8fe9d7cc355d411cdcb7bff5e3ed345dcb7b3d"
            },
            "downloads": -1,
            "filename": "pvpower-0.3.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "501d83754d0301b7d84280b462482abd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20938,
            "upload_time": "2023-04-02T16:24:48",
            "upload_time_iso_8601": "2023-04-02T16:24:48.037040Z",
            "url": "https://files.pythonhosted.org/packages/f8/5d/76c85d2eeb31efc13b85711b62eade8ae596bed8fa735ecd7ad7fb59acbc/pvpower-0.3.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9619d0e515437b41e2c932fdbdac0654bd59ed489224fe0530f64e14427521e0",
                "md5": "82f1172ae62cb10a7a56875cb5de07ed",
                "sha256": "961b6efa17ca7074c41f16fd6e027b62b1abae3b67ff4795b4b1eb01ba91cfdb"
            },
            "downloads": -1,
            "filename": "pvpower-0.3.16.tar.gz",
            "has_sig": false,
            "md5_digest": "82f1172ae62cb10a7a56875cb5de07ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20381,
            "upload_time": "2023-04-02T16:24:49",
            "upload_time_iso_8601": "2023-04-02T16:24:49.786746Z",
            "url": "https://files.pythonhosted.org/packages/96/19/d0e515437b41e2c932fdbdac0654bd59ed489224fe0530f64e14427521e0/pvpower-0.3.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-02 16:24:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "pvpower"
}
        
Elapsed time: 0.23502s