Gegevens Goodwe omvormer inlezen met Python
#!/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