Here you are, very basic but it works. Change IP and password accordingly
The only thing I’m not sure about are the ID/references, these might be different for you.
I’ve found out by running the script in parts and using “print r.text”
#!/usr/bin/python
import json
import requests
Total=0
Today=0
url = ‘http://192.168.1.31/dyn/login.json’
payload = (‘{“pass” : “YourPassHere”, “right” : “usr”}’)
headers = {‘Content-Type’: ‘application/json’, ‘Accept-Charset’: ‘UTF-8’}
r = requests.post(url, data=payload, headers=headers)
j = json.loads(r.text)
sid = j[‘result’][‘sid’]
url = ‘http://192.168.1.31/dyn/getValues.json?sid=’ + sid
payload = (‘{“destDev”:,“keys”:[“6400_00260100”,“6400_00262200”]}’)
headers = {‘Content-Type’: ‘application/json’, ‘Accept-Charset’: ‘UTF-8’}
r = requests.post(url, data=payload, headers=headers)
j = json.loads(r.text)
Total = j[‘result’][‘012F-730ACDF3’][‘6400_00260100’][‘1’][0][‘val’]
Today = j[‘result’][‘012F-730ACDF3’][‘6400_00262200’][‘1’][0][‘val’]
d = {}
d[“Total”] = Total
d[“Today”] = Today
print json.dumps(d, ensure_ascii=False)