Package: gw2pvo
gw2pvo is a command line tool to upload solar data from a GoodWe power
inverter to the PVOutput.org website.InstallationYou need to have Python 3 and pip installed. Then:sudopip3install--upgradegw2pvoNext determine the Station ID from the GoodWe site as follows. Open theSems Portal. The Plant Status will
reveal the Station ID in the URL. Example:https://www.semsportal.com/powerstation/powerstatussnmin/9a6415bf-cdcc-46af-b393-2b442fa89a7fSo the Station ID is9a6415bf-cdcc-46af-b393-2b442fa89a7f.Furthermore, you need a (free)PVOutputaccount.
Register a device and enable the API. From PVOutput you need:The API KeyThe System Id of your deviceNetatmoIn case you have some Netatmo weather station nearby, you can use it to
fetch the local temperature. First you need to create an (free) account
atdevelopers portal. Next create an app.
This gives you a username, password, client_id, and a client_secret,
which you need to supply togw2pvo.You have the option to either letgw2pvofind the nearest public
weather station, or to select one yourself.Dark SkyOptionally, for actual weather information you can get a (free)Dark
Sky APIaccount. Register and get 1,000
free calls per day. Note that Dark Sky willshut
downit’s API in
2021 and does not accept new signups anymore.Usageusage:gw2pvo[-h][--configFILE][--gw-station-idID][--gw-accountACCOUNT][--gw-passwordPASSWORD][--pvo-system-idID][--pvo-api-keyKEY][--pvo-interval{5,10,15}][--darksky-api-keyDARKSKY_API_KEY][--netatmo-usernameNETATMO_USERNAME][--netatmo-passwordNETATMO_PASSWORD][--netatmo-client-idNETATMO_CLIENT_ID][--netatmo-client-secretNETATMO_CLIENT_SECRET][--netatmo-device-idNETATMO_DEVICE_ID][--log{debug,info,warning,critical}][--dateYYYY-MM-DD][--pv-voltage][--skip-offline][--cityCITY][--csvCSV][--version]UploadGoodWepowerinverterdatatoPVOutput.orgoptionalarguments:-h,--helpshowthishelpmessageandexit--configFILESpecifyconfigfile--gw-station-idIDGoodWestationID--gw-accountACCOUNTGoodWeaccount--gw-passwordPASSWORDGoodWepassword--pvo-system-idIDPVOutputsystemID--pvo-api-keyKEYPVOutputAPIkey--pvo-interval{5,10,15}PVOutputintervalinminutes--darksky-api-keyDARKSKY_API_KEYDarkSkyWeatherAPIkey--netatmo-usernameNETATMO_USERNAMENetatmousername--netatmo-passwordNETATMO_PASSWORDNetatmopassword--netatmo-client-idNETATMO_CLIENT_IDNetatmoOAuthclientid--netatmo-client-secretNETATMO_CLIENT_SECRETNetatmoOAuthclientsecret--netatmo-device-idNETATMO_DEVICE_IDNetatmodeviceid--log{debug,info,warning,critical}Setloglevel(defaultinfo)--dateYYYY-MM-DDCopyallreadings(max14/90daysago)--pv-voltageSendpvvoltageinsteadofgridvoltage--skip-offlineSkipuploadswheninverterisoffline--cityCITYSetstimezoneandskipuploadsfromdusktilldawn--csvCSVAppendreadingstoaExcelcompatibleCSVfile,DATEinthenamewillbereplacedbythecurrentdate--versionshowprogram'sversionnumberandexitThe list of allowed cities can be found in theAstral
documentation.Examplesgw2pvo--gw-station-idGWID--gw-accountACCOUNT--gw-passwordPASSWORD--pvo-system-idPVOID--pvo-api-keyKEY--logdebugIf you want to save readings in a daily CSV file:gw2pvo--gw-station-idGWID--gw-accountACCOUNT--gw-passwordPASSWORD--pvo-system-idPVOID--pvo-api-keyKEY--csv"Solar DATE.csv"Replace GWID, ACCOUNT, PVOID, PASSWORD, and KEY by the proper values.
DATE is a template and will be automatically substituted by the current
date.Config fileIt is more secure to define credentials in a config file instead of
adding it to the command line. E.g. if you createdgw2pvo.cfgas
follows:[Defaults]gw_station_id=...gw_account=...gw_password=...pvo_api_key=...pvo_system_id=...darksky_api_key=...city=...Then this will also upload your inverter data to PVOutput:gw2pvo--configgw2pvo.cfg--logdebugYou can add any argument setting to the config file as you like.Automatic uploadsThe power graph on PVOutput is not based on the power reading from
GoodWe, but on the amount of energy produced this day. This has the
advantage that it does not matter if you skip one or more readings.PVOutput gives you the option to choose to upload each 5, 10, or 15
minutes. Make sure you upload at the same rate as configured at
PVOutput.The inverter updates goodwe-power.com each 8 minutes. The API gives
resolution for produced energy of only 0.1 kWh. So for a 5 minute
interval we get a resolution of 1200 watt, which is pretty big. To get
smooth PVOutput graphs, we apply a running average which depends on the
configured PVOutput upload interval time.Systemd serviceIf you run gw2pvo on a Systemd based Linux, you could install the script
as a service, like:[Unit]Description=Read GoodWe inverter and upload data to PVOutput.org[Service]WorkingDirectory=/home/gw2pvoExecStart=/usr/local/bin/gw2pvo --config /etc/gw2pvo.cfg --pvo-interval 5 --skip-offlineRestart=alwaysRestartSec=300User=gw2pvo[Install]WantedBy=multi-user.targetStore the file as/etc/systemd/system/gw2pvo.serviceand run:sudouseradd-mgw2pvosudosystemctlenablegw2pvosudosystemctlstartgw2pvosudosystemctlstatusgw2pvosudojournalctl-ugw2pvo-fDockerYou can use theDockerfileto run a Docker container as follows:dockerbuild--taggw2pvo.Add all settings to config file namedgw2pvo.cfglike:[Defaults]gw_station_id=...gw_account=...gw_password=...pvo_api_key=...pvo_system_id=...city=Amsterdamlog=infopvo_interval=5skip_offline=yesDo setcityto avalid
valueotherwise the container will use the UTC timezone. Then start the
container like:dockerrun--rm-v$(pwd)/gw2pvo.cfg:/gw2pvo.cfggw2pvoRecover missed dataYou can copy a day of readings from GoodWe to PVOutput. Interval will be
10 minutes as this is what the API provides. Syntax:gw2pvo--configgw2pvo.cfg--dateYYYY-MM-DDBeware that the date parameter must be not be older than 14 days from
the current date. In donation mode, not more than 90 days.Disclaimer and warrentyGw2pvo isnotan official software from GoodWe/Sems and it is not
endorsed or supported by this company. Gw2pvo has been written as a
personal work. Feel free to improve or adapt it to your own needs.GoodWe API access is based on the Chinese Sems Swagger documentation:global,Europe. It could be
very well that at a certain point GoodWe decides to alter or disable the
API.The software is provided “as is”, without warranty of any kind, express
or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.