Created
August 25, 2018 14:38
-
-
Save raspberrytipsnl/5c8d552d9e1e8a7256d54ad7da4fbf10 to your computer and use it in GitHub Desktop.
Gegevens Goodwe omvormer inlezen met Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import urllib | |
try: | |
jsonfile = json.load(urllib.urlopen('https://eu.goodwe-power.com/Mobile/GetMyPowerStationByUser?userName=GEBRUIKERSNAAM')) | |
except ValueError: | |
print 'Error data kan niet geladen worden...' | |
else: | |
print 'Current: ' + jsonfile[0]['currentPower'] | |
print 'capacity: ' + jsonfile[0]['capacity'] | |
print 'Today: ' + jsonfile[0]['value_eDayTotal'] | |
print 'Total: ' + jsonfile[0]['value_eTotal'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment